Skip to main content

aws_esdk/operation/encrypt/
_encrypt_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 EncryptInput {
8    #[allow(missing_docs)]
9pub algorithm_suite_id: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId>,
10#[allow(missing_docs)]
11pub encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12#[allow(missing_docs)]
13pub frame_length: ::std::option::Option<::std::primitive::i64>,
14#[allow(missing_docs)]
15pub keyring: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef>,
16#[allow(missing_docs)]
17pub materials_manager: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
18#[allow(missing_docs)]
19pub plaintext: ::std::option::Option<::aws_smithy_types::Blob>,
20}
21impl EncryptInput {
22    #[allow(missing_docs)]
23    pub fn algorithm_suite_id(
24        &self,
25    ) -> &::std::option::Option<
26        crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId,
27    > {
28        &self.algorithm_suite_id
29    }
30    #[allow(missing_docs)]
31    pub fn encryption_context(
32        &self,
33    ) -> &::std::option::Option<
34        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
35    > {
36        &self.encryption_context
37    }
38    #[allow(missing_docs)]
39    pub fn frame_length(&self) -> &::std::option::Option<::std::primitive::i64> {
40        &self.frame_length
41    }
42    #[allow(missing_docs)]
43    pub fn keyring(
44        &self,
45    ) -> &::std::option::Option<
46        crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
47    > {
48        &self.keyring
49    }
50    #[allow(missing_docs)]
51    pub fn materials_manager(&self) -> &::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>{
52        &self.materials_manager
53    }
54    #[allow(missing_docs)]
55    pub fn plaintext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
56        &self.plaintext
57    }
58}
59impl EncryptInput {
60    /// Creates a new builder-style object to manufacture [`EncryptInput`](crate::operation::encrypt::builders::EncryptInput).
61    pub fn builder() -> crate::operation::encrypt::builders::EncryptInputBuilder {
62        crate::operation::encrypt::builders::EncryptInputBuilder::default()
63    }
64}
65
66/// A builder for [`EncryptInput`](crate::operation::operation::EncryptInput).
67#[non_exhaustive]
68#[derive(
69    ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
70)]
71pub struct EncryptInputBuilder {
72    pub(crate) algorithm_suite_id: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId>,
73pub(crate) encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
74pub(crate) frame_length: ::std::option::Option<::std::primitive::i64>,
75pub(crate) keyring: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef>,
76pub(crate) materials_manager: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
77pub(crate) plaintext: ::std::option::Option<::aws_smithy_types::Blob>,
78}
79impl EncryptInputBuilder {
80    #[allow(missing_docs)]
81    pub fn algorithm_suite_id(
82        mut self,
83        input: impl ::std::convert::Into<
84            crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId,
85        >,
86    ) -> Self {
87        self.algorithm_suite_id = ::std::option::Option::Some(input.into());
88        self
89    }
90    #[allow(missing_docs)]
91    pub fn set_algorithm_suite_id(
92        mut self,
93        input: ::std::option::Option<
94            crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId,
95        >,
96    ) -> Self {
97        self.algorithm_suite_id = input;
98        self
99    }
100    #[allow(missing_docs)]
101    pub fn get_algorithm_suite_id(
102        &self,
103    ) -> &::std::option::Option<
104        crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId,
105    > {
106        &self.algorithm_suite_id
107    }
108    #[allow(missing_docs)]
109    pub fn encryption_context(
110        mut self,
111        input: impl ::std::convert::Into<
112            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
113        >,
114    ) -> Self {
115        self.encryption_context = ::std::option::Option::Some(input.into());
116        self
117    }
118    #[allow(missing_docs)]
119    pub fn set_encryption_context(
120        mut self,
121        input: ::std::option::Option<
122            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
123        >,
124    ) -> Self {
125        self.encryption_context = input;
126        self
127    }
128    #[allow(missing_docs)]
129    pub fn get_encryption_context(
130        &self,
131    ) -> &::std::option::Option<
132        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
133    > {
134        &self.encryption_context
135    }
136    #[allow(missing_docs)]
137    pub fn frame_length(mut self, input: impl ::std::convert::Into<::std::primitive::i64>) -> Self {
138        self.frame_length = ::std::option::Option::Some(input.into());
139        self
140    }
141    #[allow(missing_docs)]
142    pub fn set_frame_length(mut self, input: ::std::option::Option<::std::primitive::i64>) -> Self {
143        self.frame_length = input;
144        self
145    }
146    #[allow(missing_docs)]
147    pub fn get_frame_length(&self) -> &::std::option::Option<::std::primitive::i64> {
148        &self.frame_length
149    }
150    #[allow(missing_docs)]
151    pub fn keyring(
152        mut self,
153        input: impl ::std::convert::Into<
154            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
155        >,
156    ) -> Self {
157        self.keyring = ::std::option::Option::Some(input.into());
158        self
159    }
160    #[allow(missing_docs)]
161    pub fn set_keyring(
162        mut self,
163        input: ::std::option::Option<
164            crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
165        >,
166    ) -> Self {
167        self.keyring = input;
168        self
169    }
170    #[allow(missing_docs)]
171    pub fn get_keyring(
172        &self,
173    ) -> &::std::option::Option<
174        crate::deps::aws_cryptography_materialProviders::types::keyring::KeyringRef,
175    > {
176        &self.keyring
177    }
178    #[allow(missing_docs)]
179    pub fn materials_manager(
180        mut self,
181        input: impl ::std::convert::Into<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
182    ) -> Self {
183        self.materials_manager = ::std::option::Option::Some(input.into());
184        self
185    }
186    #[allow(missing_docs)]
187    pub fn set_materials_manager(
188        mut self,
189        input: ::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>,
190    ) -> Self {
191        self.materials_manager = input;
192        self
193    }
194    #[allow(missing_docs)]
195    pub fn get_materials_manager(&self) -> &::std::option::Option<crate::deps::aws_cryptography_materialProviders::types::cryptographic_materials_manager::CryptographicMaterialsManagerRef>{
196        &self.materials_manager
197    }
198    #[allow(missing_docs)]
199    pub fn plaintext(mut self, input: impl ::std::convert::Into<::aws_smithy_types::Blob>) -> Self {
200        self.plaintext = ::std::option::Option::Some(input.into());
201        self
202    }
203    #[allow(missing_docs)]
204    pub fn set_plaintext(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
205        self.plaintext = input;
206        self
207    }
208    #[allow(missing_docs)]
209    pub fn get_plaintext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
210        &self.plaintext
211    }
212    /// Consumes the builder and constructs a [`EncryptInput`](crate::operation::operation::EncryptInput).
213    pub fn build(
214        self,
215    ) -> ::std::result::Result<
216        crate::operation::encrypt::EncryptInput,
217        ::aws_smithy_types::error::operation::BuildError,
218    > {
219        ::std::result::Result::Ok(crate::operation::encrypt::EncryptInput {
220            algorithm_suite_id: self.algorithm_suite_id,
221            encryption_context: self.encryption_context,
222            frame_length: self.frame_length,
223            keyring: self.keyring,
224            materials_manager: self.materials_manager,
225            plaintext: self.plaintext,
226        })
227    }
228}