aws_db_esdk/deps/aws_cryptography_materialProviders/operation/on_decrypt/
builders.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.
4pub use crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::_on_decrypt_output::OnDecryptOutputBuilder;
5
6pub use crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::_on_decrypt_input::OnDecryptInputBuilder;
7
8impl OnDecryptInputBuilder {
9    /// Sends a request with this input using the given client.
10    pub async fn send_with(
11        self,
12        keyring: &crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
13    ) -> ::std::result::Result<
14        crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::OnDecryptOutput,
15        crate::deps::aws_cryptography_materialProviders::types::error::Error,
16    > {
17        let mut fluent_builder = keyring.on_decrypt();
18        fluent_builder.inner = self;
19        fluent_builder.send().await
20    }
21}
22/// Fluent builder constructing a request to `OnDecrypt`.
23///
24#[derive(::std::clone::Clone, ::std::fmt::Debug)]
25pub struct OnDecryptFluentBuilder {
26    keyring: crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
27    pub(crate) inner: crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::builders::OnDecryptInputBuilder,
28}
29impl OnDecryptFluentBuilder {
30    /// Creates a new `OnDecrypt`.
31    pub(crate) fn new(
32        keyring: crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
33    ) -> Self {
34        Self {
35            keyring,
36            inner: ::std::default::Default::default(),
37        }
38    }
39    /// Access the OnDecrypt as a reference.
40    pub fn as_input(&self) -> &crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::builders::OnDecryptInputBuilder{
41        &self.inner
42    }
43    /// Sends the request and returns the response.
44    pub async fn send(
45        self,
46    ) -> ::std::result::Result<
47        crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::OnDecryptOutput,
48        crate::deps::aws_cryptography_materialProviders::types::error::Error,
49    > {
50        let input = self
51            .inner
52            .build()
53            // Using Opaque since we don't have a validation-specific error yet.
54            // Operations' models don't declare their own validation error,
55            // and smithy-rs seems to not generate a ValidationError case unless there is.
56            // Vanilla smithy-rs uses SdkError::construction_failure, but we aren't using SdkError.
57            .map_err(|mut e| {
58	     let msg = format!("{:?}", e);
59             crate::deps::aws_cryptography_materialProviders::types::error::Error::OpaqueWithText {
60                obj: ::dafny_runtime::Object::from_ref(&mut e as &mut ::dafny_runtime::DynAny),
61		objMessage: msg
62             }})?;
63        crate::deps::aws_cryptography_materialProviders::operation::on_decrypt::OnDecrypt::send(
64            &self.keyring,
65            input,
66        )
67        .await
68    }
69
70    #[allow(missing_docs)]
71    pub fn encrypted_data_keys(
72        mut self,
73        input: impl ::std::convert::Into<
74            ::std::vec::Vec<
75                crate::deps::aws_cryptography_materialProviders::types::EncryptedDataKey,
76            >,
77        >,
78    ) -> Self {
79        self.inner = self.inner.encrypted_data_keys(input.into());
80        self
81    }
82    #[allow(missing_docs)]
83    pub fn set_encrypted_data_keys(
84        mut self,
85        input: ::std::option::Option<
86            ::std::vec::Vec<
87                crate::deps::aws_cryptography_materialProviders::types::EncryptedDataKey,
88            >,
89        >,
90    ) -> Self {
91        self.inner = self.inner.set_encrypted_data_keys(input);
92        self
93    }
94    #[allow(missing_docs)]
95    pub fn get_encrypted_data_keys(
96        &self,
97    ) -> &::std::option::Option<
98        ::std::vec::Vec<crate::deps::aws_cryptography_materialProviders::types::EncryptedDataKey>,
99    > {
100        self.inner.get_encrypted_data_keys()
101    }
102    #[allow(missing_docs)]
103    pub fn materials(
104        mut self,
105        input: impl ::std::convert::Into<
106            crate::deps::aws_cryptography_materialProviders::types::DecryptionMaterials,
107        >,
108    ) -> Self {
109        self.inner = self.inner.materials(input.into());
110        self
111    }
112    #[allow(missing_docs)]
113    pub fn set_materials(
114        mut self,
115        input: ::std::option::Option<
116            crate::deps::aws_cryptography_materialProviders::types::DecryptionMaterials,
117        >,
118    ) -> Self {
119        self.inner = self.inner.set_materials(input);
120        self
121    }
122    #[allow(missing_docs)]
123    pub fn get_materials(
124        &self,
125    ) -> &::std::option::Option<
126        crate::deps::aws_cryptography_materialProviders::types::DecryptionMaterials,
127    > {
128        self.inner.get_materials()
129    }
130}