Skip to main content

aws_esdk/operation/
encrypt.rs

1// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
4/// Orchestration and serialization glue logic for `Encrypt`.
5#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
6#[non_exhaustive]
7pub struct Encrypt;
8impl Encrypt {
9    /// Creates a new `Encrypt`
10    pub fn new() -> Self {
11        Self
12    }
13
14    pub(crate) async fn send(
15        client: &crate::client::Client,
16        input: crate::operation::encrypt::EncryptInput,
17    ) -> ::std::result::Result<crate::operation::encrypt::EncryptOutput, crate::types::error::Error>
18    {
19        crate::validation::validate_aws_Pcryptography_PencryptionSdk_HEncryptInput_for_AwsEncryptionSdk_Encrypt(&input)
20            .map_err(crate::types::error::Error::wrap_validation_err)?;
21        let inner_input = crate::conversions::encrypt::_encrypt_input::to_dafny(input);
22        let inner_result = ::dafny_runtime::md!(client.dafny_client.clone()).Encrypt(&inner_input);
23        if matches!(
24            inner_result.as_ref(),
25            crate::r#_Wrappers_Compile::Result::Success { .. }
26        ) {
27            Ok(crate::conversions::encrypt::_encrypt_output::from_dafny(
28                inner_result.value().clone(),
29            ))
30        } else {
31            Err(crate::conversions::error::from_dafny(
32                inner_result.error().clone(),
33            ))
34        }
35    }
36}
37
38pub use crate::operation::encrypt::_encrypt_output::EncryptOutput;
39
40pub use crate::operation::encrypt::_encrypt_input::EncryptInput;
41
42pub(crate) mod _encrypt_output;
43
44pub(crate) mod _encrypt_input;
45
46/// Builders
47pub mod builders;