|
| 1 | +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +#![deny(warnings, unconditional_panic)] |
| 5 | +#![deny(nonstandard_style)] |
| 6 | +#![deny(clippy::all)] |
| 7 | +#![allow(non_snake_case)] |
| 8 | + |
| 9 | +pub mod software { |
| 10 | + pub mod amazon { |
| 11 | + pub mod cryptography { |
| 12 | + pub mod internaldafny { |
| 13 | + pub mod StormTrackingCMC { |
| 14 | + pub use crate::storm_tracker::internal_StormTrackingCMC::*; |
| 15 | + } |
| 16 | + pub mod SynchronizedLocalCMC { |
| 17 | + pub use crate::local_cmc::internal_SynchronizedLocalCMC::*; |
| 18 | + } |
| 19 | + } |
| 20 | + pub mod dbencryptionsdk { |
| 21 | + pub mod dynamodb { |
| 22 | + pub mod itemencryptor { |
| 23 | + pub mod internaldafny { |
| 24 | + pub mod legacy { |
| 25 | + use crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::Error as DafnyError; |
| 26 | + use crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::internaldafny::types::LegacyPolicy; |
| 27 | + use ::std::rc::Rc; |
| 28 | + type Legacy = ::dafny_runtime::Object<crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::legacy::InternalLegacyOverride>; |
| 29 | + |
| 30 | + fn error(s: &str) -> Rc<DafnyError> { |
| 31 | + Rc::new(DafnyError::DynamoDbItemEncryptorException { |
| 32 | + message: |
| 33 | + dafny_runtime::dafny_runtime_conversions::unicode_chars_false::string_to_dafny_string(s), |
| 34 | + }) |
| 35 | + } |
| 36 | + pub struct InternalLegacyOverride { |
| 37 | + pub r#__i_policy: Rc<LegacyPolicy>, |
| 38 | + } |
| 39 | + fn fail_override() -> Rc< |
| 40 | + crate::_Wrappers_Compile::Result< |
| 41 | + Rc<crate::_Wrappers_Compile::Option<Legacy>>, |
| 42 | + Rc<DafnyError>, |
| 43 | + >, |
| 44 | + > { |
| 45 | + Rc::new(crate::_Wrappers_Compile::Result::Failure { |
| 46 | + error: error("Legacy configuration unsupported."), |
| 47 | + }) |
| 48 | + } |
| 49 | + fn success_override() -> Rc< |
| 50 | + crate::_Wrappers_Compile::Result< |
| 51 | + Rc<crate::_Wrappers_Compile::Option<Legacy>>, |
| 52 | + Rc<DafnyError>, |
| 53 | + >, |
| 54 | + > { |
| 55 | + Rc::new(crate::_Wrappers_Compile::Result::Success { |
| 56 | + value: Rc::new(crate::_Wrappers_Compile::Option::None {}), |
| 57 | + }) |
| 58 | + } |
| 59 | + |
| 60 | + impl InternalLegacyOverride { |
| 61 | + pub fn Build( |
| 62 | + config: &Rc<crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::DynamoDbItemEncryptorConfig>, |
| 63 | + ) -> Rc< |
| 64 | + crate::_Wrappers_Compile::Result< |
| 65 | + Rc<crate::_Wrappers_Compile::Option<Legacy>>, |
| 66 | + Rc<DafnyError>, |
| 67 | + >, |
| 68 | + > { |
| 69 | + match &**config.legacyOverride() { |
| 70 | + crate::_Wrappers_Compile::Option::Some{value} => { |
| 71 | + match &**value.policy() { |
| 72 | + LegacyPolicy::FORBID_LEGACY_ENCRYPT_FORBID_LEGACY_DECRYPT{} => success_override(), |
| 73 | + _ => fail_override() |
| 74 | + } |
| 75 | + } |
| 76 | + crate::_Wrappers_Compile::Option::None{} => success_override() |
| 77 | + } |
| 78 | + } |
| 79 | + pub fn EncryptItem(&self, _input: &Rc<crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::EncryptItemInput>) -> Rc<crate::_Wrappers_Compile::Result<Rc<crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::EncryptItemOutput>, Rc<DafnyError>>>{ |
| 80 | + todo!("InternalLLegacyOverride::EncryptItem") |
| 81 | + } |
| 82 | + pub fn DecryptItem(&self, _input: &Rc<crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::DecryptItemInput>) -> Rc<crate::_Wrappers_Compile::Result<Rc<crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::DecryptItemOutput>, Rc<DafnyError>>>{ |
| 83 | + todo!("InternalLLegacyOverride::DecryptItem") |
| 84 | + } |
| 85 | + pub fn IsLegacyInput( |
| 86 | + &self, |
| 87 | + _input: &Rc<crate::software::amazon::cryptography::dbencryptionsdk::dynamodb::itemencryptor::internaldafny::types::DecryptItemInput>, |
| 88 | + ) -> bool { |
| 89 | + false |
| 90 | + } |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | + } |
| 95 | + } |
| 96 | + } |
| 97 | + } |
| 98 | + } |
| 99 | +} |
0 commit comments