Skip to main content

aws_esdk/deps/aws_cryptography_materialProviders/operation/initialize_decryption_materials/
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::initialize_decryption_materials::_decryption_materials::DecryptionMaterialsBuilder;
5
6pub use crate::deps::aws_cryptography_materialProviders::operation::initialize_decryption_materials::_initialize_decryption_materials_input::InitializeDecryptionMaterialsInputBuilder;
7
8impl InitializeDecryptionMaterialsInputBuilder {
9    /// Sends a request with this input using the given client.
10    pub async fn send_with(
11        self,
12        client: &crate::deps::aws_cryptography_materialProviders::client::Client,
13    ) -> ::std::result::Result<
14        crate::deps::aws_cryptography_materialProviders::operation::initialize_decryption_materials::DecryptionMaterials,
15        crate::deps::aws_cryptography_materialProviders::types::error::Error,
16    >{
17        let mut fluent_builder = client.initialize_decryption_materials();
18        fluent_builder.inner = self;
19        fluent_builder.send().await
20    }
21}
22/// Fluent builder constructing a request to `InitializeDecryptionMaterials`.
23///
24#[derive(::std::clone::Clone, ::std::fmt::Debug)]
25pub struct InitializeDecryptionMaterialsFluentBuilder {
26    client: crate::deps::aws_cryptography_materialProviders::client::Client,
27    pub(crate) inner: crate::deps::aws_cryptography_materialProviders::operation::initialize_decryption_materials::builders::InitializeDecryptionMaterialsInputBuilder,
28}
29impl InitializeDecryptionMaterialsFluentBuilder {
30    /// Creates a new `InitializeDecryptionMaterials`.
31    pub(crate) fn new(
32        client: crate::deps::aws_cryptography_materialProviders::client::Client,
33    ) -> Self {
34        Self {
35            client,
36            inner: ::std::default::Default::default(),
37        }
38    }
39    /// Access the InitializeDecryptionMaterials as a reference.
40    pub fn as_input(&self) -> &crate::deps::aws_cryptography_materialProviders::operation::initialize_decryption_materials::builders::InitializeDecryptionMaterialsInputBuilder{
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::initialize_decryption_materials::DecryptionMaterials,
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::initialize_decryption_materials::InitializeDecryptionMaterials::send(&self.client, input).await
64    }
65
66    #[allow(missing_docs)]
67    pub fn algorithm_suite_id(
68        mut self,
69        input: impl ::std::convert::Into<
70            crate::deps::aws_cryptography_materialProviders::types::AlgorithmSuiteId,
71        >,
72    ) -> Self {
73        self.inner = self.inner.algorithm_suite_id(input.into());
74        self
75    }
76    #[allow(missing_docs)]
77    pub fn set_algorithm_suite_id(
78        mut self,
79        input: ::std::option::Option<
80            crate::deps::aws_cryptography_materialProviders::types::AlgorithmSuiteId,
81        >,
82    ) -> Self {
83        self.inner = self.inner.set_algorithm_suite_id(input);
84        self
85    }
86    #[allow(missing_docs)]
87    pub fn get_algorithm_suite_id(
88        &self,
89    ) -> &::std::option::Option<
90        crate::deps::aws_cryptography_materialProviders::types::AlgorithmSuiteId,
91    > {
92        self.inner.get_algorithm_suite_id()
93    }
94    #[allow(missing_docs)]
95    pub fn encryption_context(
96        mut self,
97        input: impl ::std::convert::Into<
98            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
99        >,
100    ) -> Self {
101        self.inner = self.inner.encryption_context(input.into());
102        self
103    }
104    #[allow(missing_docs)]
105    pub fn set_encryption_context(
106        mut self,
107        input: ::std::option::Option<
108            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
109        >,
110    ) -> Self {
111        self.inner = self.inner.set_encryption_context(input);
112        self
113    }
114    #[allow(missing_docs)]
115    pub fn get_encryption_context(
116        &self,
117    ) -> &::std::option::Option<
118        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
119    > {
120        self.inner.get_encryption_context()
121    }
122    #[allow(missing_docs)]
123    pub fn required_encryption_context_keys(
124        mut self,
125        input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>,
126    ) -> Self {
127        self.inner = self.inner.required_encryption_context_keys(input.into());
128        self
129    }
130    #[allow(missing_docs)]
131    pub fn set_required_encryption_context_keys(
132        mut self,
133        input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
134    ) -> Self {
135        self.inner = self.inner.set_required_encryption_context_keys(input);
136        self
137    }
138    #[allow(missing_docs)]
139    pub fn get_required_encryption_context_keys(
140        &self,
141    ) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
142        self.inner.get_required_encryption_context_keys()
143    }
144}