1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DecryptOutput {
/// <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 decrypt the ciphertext.</p>
pub key_id: ::std::option::Option<::std::string::String>,
/// <p>Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
/// <p>If the response includes the <code>CiphertextForRecipient</code> field, the <code>Plaintext</code> field is null or empty.</p>
pub plaintext: ::std::option::Option<::aws_smithy_types::Blob>,
/// <p>The encryption algorithm that was used to decrypt the ciphertext.</p>
pub encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
/// <p>The plaintext data encrypted with the public key in the attestation document.</p>
/// <p>This field is included in the response only when the <code>Recipient</code> parameter in the request includes a valid attestation document from an Amazon Web Services Nitro enclave. For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
pub ciphertext_for_recipient: ::std::option::Option<::aws_smithy_types::Blob>,
_request_id: Option<String>,
}
impl DecryptOutput {
/// <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 decrypt the ciphertext.</p>
pub fn key_id(&self) -> ::std::option::Option<&str> {
self.key_id.as_deref()
}
/// <p>Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
/// <p>If the response includes the <code>CiphertextForRecipient</code> field, the <code>Plaintext</code> field is null or empty.</p>
pub fn plaintext(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
self.plaintext.as_ref()
}
/// <p>The encryption algorithm that was used to decrypt the ciphertext.</p>
pub fn encryption_algorithm(&self) -> ::std::option::Option<&crate::types::EncryptionAlgorithmSpec> {
self.encryption_algorithm.as_ref()
}
/// <p>The plaintext data encrypted with the public key in the attestation document.</p>
/// <p>This field is included in the response only when the <code>Recipient</code> parameter in the request includes a valid attestation document from an Amazon Web Services Nitro enclave. For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
pub fn ciphertext_for_recipient(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
self.ciphertext_for_recipient.as_ref()
}
}
impl ::std::fmt::Debug for DecryptOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DecryptOutput");
formatter.field("key_id", &self.key_id);
formatter.field("plaintext", &"*** Sensitive Data Redacted ***");
formatter.field("encryption_algorithm", &self.encryption_algorithm);
formatter.field("ciphertext_for_recipient", &self.ciphertext_for_recipient);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for DecryptOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl DecryptOutput {
/// Creates a new builder-style object to manufacture [`DecryptOutput`](crate::operation::decrypt::DecryptOutput).
pub fn builder() -> crate::operation::decrypt::builders::DecryptOutputBuilder {
crate::operation::decrypt::builders::DecryptOutputBuilder::default()
}
}
/// A builder for [`DecryptOutput`](crate::operation::decrypt::DecryptOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct DecryptOutputBuilder {
pub(crate) key_id: ::std::option::Option<::std::string::String>,
pub(crate) plaintext: ::std::option::Option<::aws_smithy_types::Blob>,
pub(crate) encryption_algorithm: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>,
pub(crate) ciphertext_for_recipient: ::std::option::Option<::aws_smithy_types::Blob>,
_request_id: Option<String>,
}
impl DecryptOutputBuilder {
/// <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 decrypt the ciphertext.</p>
pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.key_id = ::std::option::Option::Some(input.into());
self
}
/// <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 decrypt the ciphertext.</p>
pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.key_id = input;
self
}
/// <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 decrypt the ciphertext.</p>
pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.key_id
}
/// <p>Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
/// <p>If the response includes the <code>CiphertextForRecipient</code> field, the <code>Plaintext</code> field is null or empty.</p>
pub fn plaintext(mut self, input: ::aws_smithy_types::Blob) -> Self {
self.plaintext = ::std::option::Option::Some(input);
self
}
/// <p>Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
/// <p>If the response includes the <code>CiphertextForRecipient</code> field, the <code>Plaintext</code> field is null or empty.</p>
pub fn set_plaintext(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
self.plaintext = input;
self
}
/// <p>Decrypted plaintext data. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.</p>
/// <p>If the response includes the <code>CiphertextForRecipient</code> field, the <code>Plaintext</code> field is null or empty.</p>
pub fn get_plaintext(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
&self.plaintext
}
/// <p>The encryption algorithm that was used to decrypt the ciphertext.</p>
pub fn encryption_algorithm(mut self, input: crate::types::EncryptionAlgorithmSpec) -> Self {
self.encryption_algorithm = ::std::option::Option::Some(input);
self
}
/// <p>The encryption algorithm that was used to decrypt the ciphertext.</p>
pub fn set_encryption_algorithm(mut self, input: ::std::option::Option<crate::types::EncryptionAlgorithmSpec>) -> Self {
self.encryption_algorithm = input;
self
}
/// <p>The encryption algorithm that was used to decrypt the ciphertext.</p>
pub fn get_encryption_algorithm(&self) -> &::std::option::Option<crate::types::EncryptionAlgorithmSpec> {
&self.encryption_algorithm
}
/// <p>The plaintext data encrypted with the public key in the attestation document.</p>
/// <p>This field is included in the response only when the <code>Recipient</code> parameter in the request includes a valid attestation document from an Amazon Web Services Nitro enclave. For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
pub fn ciphertext_for_recipient(mut self, input: ::aws_smithy_types::Blob) -> Self {
self.ciphertext_for_recipient = ::std::option::Option::Some(input);
self
}
/// <p>The plaintext data encrypted with the public key in the attestation document.</p>
/// <p>This field is included in the response only when the <code>Recipient</code> parameter in the request includes a valid attestation document from an Amazon Web Services Nitro enclave. For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
pub fn set_ciphertext_for_recipient(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
self.ciphertext_for_recipient = input;
self
}
/// <p>The plaintext data encrypted with the public key in the attestation document.</p>
/// <p>This field is included in the response only when the <code>Recipient</code> parameter in the request includes a valid attestation document from an Amazon Web Services Nitro enclave. For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
pub fn get_ciphertext_for_recipient(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
&self.ciphertext_for_recipient
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`DecryptOutput`](crate::operation::decrypt::DecryptOutput).
pub fn build(self) -> crate::operation::decrypt::DecryptOutput {
crate::operation::decrypt::DecryptOutput {
key_id: self.key_id,
plaintext: self.plaintext,
encryption_algorithm: self.encryption_algorithm,
ciphertext_for_recipient: self.ciphertext_for_recipient,
_request_id: self._request_id,
}
}
}
impl ::std::fmt::Debug for DecryptOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DecryptOutputBuilder");
formatter.field("key_id", &self.key_id);
formatter.field("plaintext", &"*** Sensitive Data Redacted ***");
formatter.field("encryption_algorithm", &self.encryption_algorithm);
formatter.field("ciphertext_for_recipient", &self.ciphertext_for_recipient);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}