aws_esdk/operation/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::operation::decrypt::_decrypt_output::DecryptOutputBuilder;
5
6pub use crate::operation::decrypt::_decrypt_input::DecryptInputBuilder;
7
8impl DecryptInputBuilder {
9    /// Sends a request with this input using the given client.
10    pub async fn send_with(
11        self,
12        client: &crate::client::Client,
13    ) -> ::std::result::Result<crate::operation::decrypt::DecryptOutput, crate::types::error::Error>
14    {
15        let mut fluent_builder = client.decrypt();
16        fluent_builder.inner = self;
17        fluent_builder.send().await
18    }
19}
20/// Fluent builder constructing a request to `Decrypt`.
21///
22#[derive(::std::clone::Clone, ::std::fmt::Debug)]
23pub struct DecryptFluentBuilder {
24    client: crate::client::Client,
25    pub(crate) inner: crate::operation::decrypt::builders::DecryptInputBuilder,
26}
27impl DecryptFluentBuilder {
28    /// Creates a new `Decrypt`.
29    pub(crate) fn new(client: crate::client::Client) -> Self {
30        Self {
31            client,
32            inner: ::std::default::Default::default(),
33        }
34    }
35    /// Access the Decrypt as a reference.
36    pub fn as_input(&self) -> &crate::operation::decrypt::builders::DecryptInputBuilder {
37        &self.inner
38    }
39    /// Sends the request and returns the response.
40    pub async fn send(
41        self,
42    ) -> ::std::result::Result<crate::operation::decrypt::DecryptOutput, crate::types::error::Error>
43    {
44        let input = self
45            .inner
46            .build()
47            // Using Opaque since we don't have a validation-specific error yet.
48            // Operations' models don't declare their own validation error,
49            // and smithy-rs seems to not generate a ValidationError case unless there is.
50            // Vanilla smithy-rs uses SdkError::construction_failure, but we aren't using SdkError.
51            .map_err(|mut e| {
52                let msg = format!("{:?}", e);
53                crate::types::error::Error::OpaqueWithText {
54                    obj: ::dafny_runtime::Object::from_ref(&mut e as &mut ::dafny_runtime::DynAny),
55                    objMessage: msg,
56                }
57            })?;
58        crate::operation::decrypt::Decrypt::send(&self.client, input).await
59    }
60
61    #[allow(missing_docs)]
62    pub fn ciphertext(
63        mut self,
64        input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
65    ) -> Self {
66        self.inner = self.inner.ciphertext(input.into());
67        self
68    }
69    #[allow(missing_docs)]
70    pub fn set_ciphertext(
71        mut self,
72        input: ::std::option::Option<::aws_smithy_types::Blob>,
73    ) -> Self {
74        self.inner = self.inner.set_ciphertext(input);
75        self
76    }
77    #[allow(missing_docs)]
78    pub fn get_ciphertext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
79        self.inner.get_ciphertext()
80    }
81    #[allow(missing_docs)]
82    pub fn encryption_context(
83        mut self,
84        input: impl ::std::convert::Into<
85            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
86        >,
87    ) -> Self {
88        self.inner = self.inner.encryption_context(input.into());
89        self
90    }
91    #[allow(missing_docs)]
92    pub fn set_encryption_context(
93        mut self,
94        input: ::std::option::Option<
95            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
96        >,
97    ) -> Self {
98        self.inner = self.inner.set_encryption_context(input);
99        self
100    }
101    #[allow(missing_docs)]
102    pub fn get_encryption_context(
103        &self,
104    ) -> &::std::option::Option<
105        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
106    > {
107        self.inner.get_encryption_context()
108    }
109    #[allow(missing_docs)]
110    pub fn keyring(
111        mut self,
112        input: impl ::std::convert::Into<
113            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
114        >,
115    ) -> Self {
116        self.inner = self.inner.keyring(input.into());
117        self
118    }
119    #[allow(missing_docs)]
120    pub fn set_keyring(
121        mut self,
122        input: ::std::option::Option<
123            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
124        >,
125    ) -> Self {
126        self.inner = self.inner.set_keyring(input);
127        self
128    }
129    #[allow(missing_docs)]
130    pub fn get_keyring(
131        &self,
132    ) -> &::std::option::Option<
133        crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
134    > {
135        self.inner.get_keyring()
136    }
137    #[allow(missing_docs)]
138    pub fn materials_manager(
139        mut self,
140        input: impl ::std::convert::Into<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
141    ) -> Self {
142        self.inner = self.inner.materials_manager(input.into());
143        self
144    }
145    #[allow(missing_docs)]
146    pub fn set_materials_manager(
147        mut self,
148        input: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
149    ) -> Self {
150        self.inner = self.inner.set_materials_manager(input);
151        self
152    }
153    #[allow(missing_docs)]
154    pub fn get_materials_manager(&self) -> &::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>{
155        self.inner.get_materials_manager()
156    }
157}