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