Skip to main content

aws_esdk/deps/aws_cryptography_materialProviders/operation/create_multi_keyring/
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::create_multi_keyring::_create_keyring_output::CreateKeyringOutputBuilder;
5
6pub use crate::deps::aws_cryptography_materialProviders::operation::create_multi_keyring::_create_multi_keyring_input::CreateMultiKeyringInputBuilder;
7
8impl CreateMultiKeyringInputBuilder {
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::types::keyring::KeyringRef,
15        crate::deps::aws_cryptography_materialProviders::types::error::Error,
16    > {
17        let mut fluent_builder = client.create_multi_keyring();
18        fluent_builder.inner = self;
19        fluent_builder.send().await
20    }
21}
22/// Fluent builder constructing a request to `CreateMultiKeyring`.
23///
24/// Creates a Multi-Keyring comprised of one or more other Keyrings.
25#[derive(::std::clone::Clone, ::std::fmt::Debug)]
26pub struct CreateMultiKeyringFluentBuilder {
27    client: crate::deps::aws_cryptography_materialProviders::client::Client,
28    pub(crate) inner: crate::deps::aws_cryptography_materialProviders::operation::create_multi_keyring::builders::CreateMultiKeyringInputBuilder,
29}
30impl CreateMultiKeyringFluentBuilder {
31    /// Creates a new `CreateMultiKeyring`.
32    pub(crate) fn new(
33        client: crate::deps::aws_cryptography_materialProviders::client::Client,
34    ) -> Self {
35        Self {
36            client,
37            inner: ::std::default::Default::default(),
38        }
39    }
40    /// Access the CreateMultiKeyring as a reference.
41    pub fn as_input(&self) -> &crate::deps::aws_cryptography_materialProviders::operation::create_multi_keyring::builders::CreateMultiKeyringInputBuilder{
42        &self.inner
43    }
44    /// Sends the request and returns the response.
45    pub async fn send(
46        self,
47    ) -> ::std::result::Result<
48        crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
49        crate::deps::aws_cryptography_materialProviders::types::error::Error,
50    > {
51        let input = self
52            .inner
53            .build()
54            // Using Opaque since we don't have a validation-specific error yet.
55            // Operations' models don't declare their own validation error,
56            // and smithy-rs seems to not generate a ValidationError case unless there is.
57            // Vanilla smithy-rs uses SdkError::construction_failure, but we aren't using SdkError.
58            .map_err(|mut e| {
59	     let msg = format!("{:?}", e);
60             crate::deps::aws_cryptography_materialProviders::types::error::Error::OpaqueWithText {
61                obj: ::dafny_runtime::Object::from_ref(&mut e as &mut ::dafny_runtime::DynAny),
62		objMessage: msg
63             }})?;
64        crate::deps::aws_cryptography_materialProviders::operation::create_multi_keyring::CreateMultiKeyring::send(&self.client, input).await
65    }
66
67    /// A list of keyrings (other than the generator) responsible for wrapping and unwrapping the data key.
68    pub fn child_keyrings(
69        mut self,
70        input: impl ::std::convert::Into<
71            ::std::vec::Vec<
72                crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
73            >,
74        >,
75    ) -> Self {
76        self.inner = self.inner.child_keyrings(input.into());
77        self
78    }
79    /// A list of keyrings (other than the generator) responsible for wrapping and unwrapping the data key.
80    pub fn set_child_keyrings(
81        mut self,
82        input: ::std::option::Option<
83            ::std::vec::Vec<
84                crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
85            >,
86        >,
87    ) -> Self {
88        self.inner = self.inner.set_child_keyrings(input);
89        self
90    }
91    /// A list of keyrings (other than the generator) responsible for wrapping and unwrapping the data key.
92    pub fn get_child_keyrings(
93        &self,
94    ) -> &::std::option::Option<
95        ::std::vec::Vec<
96            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
97        >,
98    > {
99        self.inner.get_child_keyrings()
100    }
101    /// A keyring responsible for wrapping and unwrapping the data key. This is the first keyring that will be used to wrap the data key, and may be responsible for additionally generating the data key.
102    pub fn generator(
103        mut self,
104        input: impl ::std::convert::Into<
105            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
106        >,
107    ) -> Self {
108        self.inner = self.inner.generator(input.into());
109        self
110    }
111    /// A keyring responsible for wrapping and unwrapping the data key. This is the first keyring that will be used to wrap the data key, and may be responsible for additionally generating the data key.
112    pub fn set_generator(
113        mut self,
114        input: ::std::option::Option<
115            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
116        >,
117    ) -> Self {
118        self.inner = self.inner.set_generator(input);
119        self
120    }
121    /// A keyring responsible for wrapping and unwrapping the data key. This is the first keyring that will be used to wrap the data key, and may be responsible for additionally generating the data key.
122    pub fn get_generator(
123        &self,
124    ) -> &::std::option::Option<
125        crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
126    > {
127        self.inner.get_generator()
128    }
129}