1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct EncryptOutput {
6/// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
7pub ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
8/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
9pub key_id: ::std::option::Option<::std::string::String>,
10/// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
11pub encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
12 _request_id: Option<String>,
13}
14impl EncryptOutput {
15/// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
16pub fn ciphertext_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
17self.ciphertext_blob.as_ref()
18 }
19/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
20pub fn key_id(&self) -> ::std::option::Option<&str> {
21self.key_id.as_deref()
22 }
23/// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
24pub fn encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
25self.encryption_algorithm.as_ref()
26 }
27}
28impl ::aws_types::request_id::RequestId for EncryptOutput {
29fn request_id(&self) -> Option<&str> {
30self._request_id.as_deref()
31 }
32}
33impl EncryptOutput {
34/// Creates a new builder-style object to manufacture [`EncryptOutput`](crate::operation::encrypt::EncryptOutput).
35pub fn builder() -> crate::operation::encrypt::builders::EncryptOutputBuilder {
36crate::operation::encrypt::builders::EncryptOutputBuilder::default()
37 }
38}
3940/// A builder for [`EncryptOutput`](crate::operation::encrypt::EncryptOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct EncryptOutputBuilder {
44pub(crate) ciphertext_blob: ::std::option::Option<::aws_smithy_types::Blob>,
45pub(crate) key_id: ::std::option::Option<::std::string::String>,
46pub(crate) encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
47 _request_id: Option<String>,
48}
49impl EncryptOutputBuilder {
50/// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
51pub fn ciphertext_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
52self.ciphertext_blob = ::std::option::Option::Some(input);
53self
54}
55/// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
56pub fn set_ciphertext_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
57self.ciphertext_blob = input;
58self
59}
60/// <p>The encrypted plaintext. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
61pub fn get_ciphertext_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
62&self.ciphertext_blob
63 }
64/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
65pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66self.key_id = ::std::option::Option::Some(input.into());
67self
68}
69/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
70pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71self.key_id = input;
72self
73}
74/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN">key ARN</a>) of the KMS key that was used to encrypt the plaintext.</p>
75pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
76&self.key_id
77 }
78/// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
79pub fn encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
80self.encryption_algorithm = ::std::option::Option::Some(input);
81self
82}
83/// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
84pub fn set_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
85self.encryption_algorithm = input;
86self
87}
88/// <p>The encryption algorithm that was used to encrypt the plaintext.</p>
89pub fn get_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
90&self.encryption_algorithm
91 }
92pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
93self._request_id = Some(request_id.into());
94self
95}
9697pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
98self._request_id = request_id;
99self
100}
101/// Consumes the builder and constructs a [`EncryptOutput`](crate::operation::encrypt::EncryptOutput).
102pub fn build(self) -> crate::operation::encrypt::EncryptOutput {
103crate::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}