aws_sdk_kms/operation/encrypt/
_encrypt_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct EncryptOutput {
6 pub ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
8 pub key_id: ::std::option::Option<::std::string::String>,
10 pub encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
12 _request_id: Option<String>,
13}
14impl EncryptOutput {
15 pub fn ciphertext_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
17 self.ciphertext_blob.as_ref()
18 }
19 pub fn key_id(&self) -> ::std::option::Option<&str> {
21 self.key_id.as_deref()
22 }
23 pub fn encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
25 self.encryption_algorithm.as_ref()
26 }
27}
28impl ::aws_types::request_id::RequestId for EncryptOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl EncryptOutput {
34 pub fn builder() -> crate::operation::encrypt::builders::EncryptOutputBuilder {
36 crate::operation::encrypt::builders::EncryptOutputBuilder::default()
37 }
38}
39
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct EncryptOutputBuilder {
44 pub(crate) ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
45 pub(crate) key_id: ::std::option::Option<::std::string::String>,
46 pub(crate) encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
47 _request_id: Option<String>,
48}
49impl EncryptOutputBuilder {
50 pub fn ciphertext_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
52 self.ciphertext_blob = ::std::option::Option::Some(input);
53 self
54 }
55 pub fn set_ciphertext_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
57 self.ciphertext_blob = input;
58 self
59 }
60 pub fn get_ciphertext_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
62 &self.ciphertext_blob
63 }
64 pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.key_id = ::std::option::Option::Some(input.into());
67 self
68 }
69 pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.key_id = input;
72 self
73 }
74 pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
76 &self.key_id
77 }
78 pub fn encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
80 self.encryption_algorithm = ::std::option::Option::Some(input);
81 self
82 }
83 pub fn set_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
85 self.encryption_algorithm = input;
86 self
87 }
88 pub fn get_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
90 &self.encryption_algorithm
91 }
92 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93 self._request_id = Some(request_id.into());
94 self
95 }
96
97 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98 self._request_id = request_id;
99 self
100 }
101 pub fn build(self) -> crate::operation::encrypt::EncryptOutput {
103 crate::operation::encrypt::EncryptOutput {
104 ciphertext_blob: self.ciphertext_blob,
105 key_id: self.key_id,
106 encryption_algorithm: self.encryption_algorithm,
107 _request_id: self._request_id,
108 }
109 }
110}