aws_esdk/operation/decrypt/
_decrypt_input.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#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6#[allow(missing_docs)]
7pub struct DecryptInput {
8    #[allow(missing_docs)]
9pub ciphertext: ::std::option::Option<::aws_smithy_types::Blob>,
10#[allow(missing_docs)]
11pub encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12#[allow(missing_docs)]
13pub keyring: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef>,
14#[allow(missing_docs)]
15pub materials_manager: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
16}
17impl DecryptInput {
18    #[allow(missing_docs)]
19    pub fn ciphertext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
20        &self.ciphertext
21    }
22    #[allow(missing_docs)]
23    pub fn encryption_context(
24        &self,
25    ) -> &::std::option::Option<
26        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
27    > {
28        &self.encryption_context
29    }
30    #[allow(missing_docs)]
31    pub fn keyring(
32        &self,
33    ) -> &::std::option::Option<
34        crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
35    > {
36        &self.keyring
37    }
38    #[allow(missing_docs)]
39    pub fn materials_manager(&self) -> &::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>{
40        &self.materials_manager
41    }
42}
43impl DecryptInput {
44    /// Creates a new builder-style object to manufacture [`DecryptInput`](crate::operation::decrypt::builders::DecryptInput).
45    pub fn builder() -> crate::operation::decrypt::builders::DecryptInputBuilder {
46        crate::operation::decrypt::builders::DecryptInputBuilder::default()
47    }
48}
49
50/// A builder for [`DecryptInput`](crate::operation::operation::DecryptInput).
51#[non_exhaustive]
52#[derive(
53    ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
54)]
55pub struct DecryptInputBuilder {
56    pub(crate) ciphertext: ::std::option::Option<::aws_smithy_types::Blob>,
57pub(crate) encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
58pub(crate) keyring: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef>,
59pub(crate) materials_manager: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
60}
61impl DecryptInputBuilder {
62    #[allow(missing_docs)]
63    pub fn ciphertext(
64        mut self,
65        input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
66    ) -> Self {
67        self.ciphertext = ::std::option::Option::Some(input.into());
68        self
69    }
70    #[allow(missing_docs)]
71    pub fn set_ciphertext(
72        mut self,
73        input: ::std::option::Option<::aws_smithy_types::Blob>,
74    ) -> Self {
75        self.ciphertext = input;
76        self
77    }
78    #[allow(missing_docs)]
79    pub fn get_ciphertext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
80        &self.ciphertext
81    }
82    #[allow(missing_docs)]
83    pub fn encryption_context(
84        mut self,
85        input: impl ::std::convert::Into<
86            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
87        >,
88    ) -> Self {
89        self.encryption_context = ::std::option::Option::Some(input.into());
90        self
91    }
92    #[allow(missing_docs)]
93    pub fn set_encryption_context(
94        mut self,
95        input: ::std::option::Option<
96            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
97        >,
98    ) -> Self {
99        self.encryption_context = input;
100        self
101    }
102    #[allow(missing_docs)]
103    pub fn get_encryption_context(
104        &self,
105    ) -> &::std::option::Option<
106        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
107    > {
108        &self.encryption_context
109    }
110    #[allow(missing_docs)]
111    pub fn keyring(
112        mut self,
113        input: impl ::std::convert::Into<
114            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
115        >,
116    ) -> Self {
117        self.keyring = ::std::option::Option::Some(input.into());
118        self
119    }
120    #[allow(missing_docs)]
121    pub fn set_keyring(
122        mut self,
123        input: ::std::option::Option<
124            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
125        >,
126    ) -> Self {
127        self.keyring = input;
128        self
129    }
130    #[allow(missing_docs)]
131    pub fn get_keyring(
132        &self,
133    ) -> &::std::option::Option<
134        crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
135    > {
136        &self.keyring
137    }
138    #[allow(missing_docs)]
139    pub fn materials_manager(
140        mut self,
141        input: impl ::std::convert::Into<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
142    ) -> Self {
143        self.materials_manager = ::std::option::Option::Some(input.into());
144        self
145    }
146    #[allow(missing_docs)]
147    pub fn set_materials_manager(
148        mut self,
149        input: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
150    ) -> Self {
151        self.materials_manager = input;
152        self
153    }
154    #[allow(missing_docs)]
155    pub fn get_materials_manager(&self) -> &::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>{
156        &self.materials_manager
157    }
158    /// Consumes the builder and constructs a [`DecryptInput`](crate::operation::operation::DecryptInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<
162        crate::operation::decrypt::DecryptInput,
163        ::aws_smithy_types::error::operation::BuildError,
164    > {
165        ::std::result::Result::Ok(crate::operation::decrypt::DecryptInput {
166            ciphertext: self.ciphertext,
167            encryption_context: self.encryption_context,
168            keyring: self.keyring,
169            materials_manager: self.materials_manager,
170        })
171    }
172}