aws_esdk/operation/encrypt/
_encrypt_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 EncryptOutput {
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 ciphertext: ::std::option::Option<::aws_smithy_types::Blob>,
14    #[allow(missing_docs)]
15    pub encryption_context: ::std::option::Option<
16        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
17    >,
18}
19impl EncryptOutput {
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 ciphertext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
30        &self.ciphertext
31    }
32    #[allow(missing_docs)]
33    pub fn encryption_context(
34        &self,
35    ) -> &::std::option::Option<
36        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
37    > {
38        &self.encryption_context
39    }
40}
41impl EncryptOutput {
42    /// Creates a new builder-style object to manufacture [`EncryptOutput`](crate::operation::encrypt::builders::EncryptOutput).
43    pub fn builder() -> crate::operation::encrypt::builders::EncryptOutputBuilder {
44        crate::operation::encrypt::builders::EncryptOutputBuilder::default()
45    }
46}
47
48/// A builder for [`EncryptOutput`](crate::operation::operation::EncryptOutput).
49#[non_exhaustive]
50#[derive(
51    ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
52)]
53pub struct EncryptOutputBuilder {
54    pub(crate) algorithm_suite_id: ::std::option::Option<
55        crate::deps::aws_cryptography_materialProviders::types::EsdkAlgorithmSuiteId,
56    >,
57    pub(crate) ciphertext: ::std::option::Option<::aws_smithy_types::Blob>,
58    pub(crate) encryption_context: ::std::option::Option<
59        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
60    >,
61}
62impl EncryptOutputBuilder {
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 ciphertext(
93        mut self,
94        input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
95    ) -> Self {
96        self.ciphertext = ::std::option::Option::Some(input.into());
97        self
98    }
99    #[allow(missing_docs)]
100    pub fn set_ciphertext(
101        mut self,
102        input: ::std::option::Option<::aws_smithy_types::Blob>,
103    ) -> Self {
104        self.ciphertext = input;
105        self
106    }
107    #[allow(missing_docs)]
108    pub fn get_ciphertext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
109        &self.ciphertext
110    }
111    #[allow(missing_docs)]
112    pub fn encryption_context(
113        mut self,
114        input: impl ::std::convert::Into<
115            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
116        >,
117    ) -> Self {
118        self.encryption_context = ::std::option::Option::Some(input.into());
119        self
120    }
121    #[allow(missing_docs)]
122    pub fn set_encryption_context(
123        mut self,
124        input: ::std::option::Option<
125            ::std::collections::HashMap<::std::string::String, ::std::string::String>,
126        >,
127    ) -> Self {
128        self.encryption_context = input;
129        self
130    }
131    #[allow(missing_docs)]
132    pub fn get_encryption_context(
133        &self,
134    ) -> &::std::option::Option<
135        ::std::collections::HashMap<::std::string::String, ::std::string::String>,
136    > {
137        &self.encryption_context
138    }
139    /// Consumes the builder and constructs a [`EncryptOutput`](crate::operation::operation::EncryptOutput).
140    pub fn build(
141        self,
142    ) -> ::std::result::Result<
143        crate::operation::encrypt::EncryptOutput,
144        ::aws_smithy_types::error::operation::BuildError,
145    > {
146        ::std::result::Result::Ok(crate::operation::encrypt::EncryptOutput {
147            algorithm_suite_id: self.algorithm_suite_id,
148            ciphertext: self.ciphertext,
149            encryption_context: self.encryption_context,
150        })
151    }
152}