aws_sdk_qldb/operation/get_digest/
_get_digest_output.rs

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)]
5pub struct GetDigestOutput {
6    /// <p>The 256-bit hash value representing the digest returned by a <code>GetDigest</code> request.</p>
7    pub digest: ::aws_smithy_types::Blob,
8    /// <p>The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
9    pub digest_tip_address: ::std::option::Option<crate::types::ValueHolder>,
10    _request_id: Option<String>,
11}
12impl GetDigestOutput {
13    /// <p>The 256-bit hash value representing the digest returned by a <code>GetDigest</code> request.</p>
14    pub fn digest(&self) -> &::aws_smithy_types::Blob {
15        &self.digest
16    }
17    /// <p>The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
18    pub fn digest_tip_address(&self) -> ::std::option::Option<&crate::types::ValueHolder> {
19        self.digest_tip_address.as_ref()
20    }
21}
22impl ::std::fmt::Debug for GetDigestOutput {
23    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
24        let mut formatter = f.debug_struct("GetDigestOutput");
25        formatter.field("digest", &self.digest);
26        formatter.field("digest_tip_address", &"*** Sensitive Data Redacted ***");
27        formatter.field("_request_id", &self._request_id);
28        formatter.finish()
29    }
30}
31impl ::aws_types::request_id::RequestId for GetDigestOutput {
32    fn request_id(&self) -> Option<&str> {
33        self._request_id.as_deref()
34    }
35}
36impl GetDigestOutput {
37    /// Creates a new builder-style object to manufacture [`GetDigestOutput`](crate::operation::get_digest::GetDigestOutput).
38    pub fn builder() -> crate::operation::get_digest::builders::GetDigestOutputBuilder {
39        crate::operation::get_digest::builders::GetDigestOutputBuilder::default()
40    }
41}
42
43/// A builder for [`GetDigestOutput`](crate::operation::get_digest::GetDigestOutput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
45#[non_exhaustive]
46pub struct GetDigestOutputBuilder {
47    pub(crate) digest: ::std::option::Option<::aws_smithy_types::Blob>,
48    pub(crate) digest_tip_address: ::std::option::Option<crate::types::ValueHolder>,
49    _request_id: Option<String>,
50}
51impl GetDigestOutputBuilder {
52    /// <p>The 256-bit hash value representing the digest returned by a <code>GetDigest</code> request.</p>
53    /// This field is required.
54    pub fn digest(mut self, input: ::aws_smithy_types::Blob) -> Self {
55        self.digest = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The 256-bit hash value representing the digest returned by a <code>GetDigest</code> request.</p>
59    pub fn set_digest(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
60        self.digest = input;
61        self
62    }
63    /// <p>The 256-bit hash value representing the digest returned by a <code>GetDigest</code> request.</p>
64    pub fn get_digest(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
65        &self.digest
66    }
67    /// <p>The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
68    /// This field is required.
69    pub fn digest_tip_address(mut self, input: crate::types::ValueHolder) -> Self {
70        self.digest_tip_address = ::std::option::Option::Some(input);
71        self
72    }
73    /// <p>The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
74    pub fn set_digest_tip_address(mut self, input: ::std::option::Option<crate::types::ValueHolder>) -> Self {
75        self.digest_tip_address = input;
76        self
77    }
78    /// <p>The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
79    pub fn get_digest_tip_address(&self) -> &::std::option::Option<crate::types::ValueHolder> {
80        &self.digest_tip_address
81    }
82    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
83        self._request_id = Some(request_id.into());
84        self
85    }
86
87    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
88        self._request_id = request_id;
89        self
90    }
91    /// Consumes the builder and constructs a [`GetDigestOutput`](crate::operation::get_digest::GetDigestOutput).
92    /// This method will fail if any of the following fields are not set:
93    /// - [`digest`](crate::operation::get_digest::builders::GetDigestOutputBuilder::digest)
94    pub fn build(self) -> ::std::result::Result<crate::operation::get_digest::GetDigestOutput, ::aws_smithy_types::error::operation::BuildError> {
95        ::std::result::Result::Ok(crate::operation::get_digest::GetDigestOutput {
96            digest: self.digest.ok_or_else(|| {
97                ::aws_smithy_types::error::operation::BuildError::missing_field(
98                    "digest",
99                    "digest was not specified but it is required when building GetDigestOutput",
100                )
101            })?,
102            digest_tip_address: self.digest_tip_address,
103            _request_id: self._request_id,
104        })
105    }
106}
107impl ::std::fmt::Debug for GetDigestOutputBuilder {
108    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
109        let mut formatter = f.debug_struct("GetDigestOutputBuilder");
110        formatter.field("digest", &self.digest);
111        formatter.field("digest_tip_address", &"*** Sensitive Data Redacted ***");
112        formatter.field("_request_id", &self._request_id);
113        formatter.finish()
114    }
115}