aws_sdk_qldb/operation/get_block/
_get_block_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 GetBlockOutput {
6    /// <p>The block data object in Amazon Ion format.</p>
7    pub block: ::std::option::Option<crate::types::ValueHolder>,
8    /// <p>The proof object in Amazon Ion format returned by a <code>GetBlock</code> request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.</p>
9    pub proof: ::std::option::Option<crate::types::ValueHolder>,
10    _request_id: Option<String>,
11}
12impl GetBlockOutput {
13    /// <p>The block data object in Amazon Ion format.</p>
14    pub fn block(&self) -> ::std::option::Option<&crate::types::ValueHolder> {
15        self.block.as_ref()
16    }
17    /// <p>The proof object in Amazon Ion format returned by a <code>GetBlock</code> request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.</p>
18    pub fn proof(&self) -> ::std::option::Option<&crate::types::ValueHolder> {
19        self.proof.as_ref()
20    }
21}
22impl ::std::fmt::Debug for GetBlockOutput {
23    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
24        let mut formatter = f.debug_struct("GetBlockOutput");
25        formatter.field("block", &"*** Sensitive Data Redacted ***");
26        formatter.field("proof", &"*** Sensitive Data Redacted ***");
27        formatter.field("_request_id", &self._request_id);
28        formatter.finish()
29    }
30}
31impl ::aws_types::request_id::RequestId for GetBlockOutput {
32    fn request_id(&self) -> Option<&str> {
33        self._request_id.as_deref()
34    }
35}
36impl GetBlockOutput {
37    /// Creates a new builder-style object to manufacture [`GetBlockOutput`](crate::operation::get_block::GetBlockOutput).
38    pub fn builder() -> crate::operation::get_block::builders::GetBlockOutputBuilder {
39        crate::operation::get_block::builders::GetBlockOutputBuilder::default()
40    }
41}
42
43/// A builder for [`GetBlockOutput`](crate::operation::get_block::GetBlockOutput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
45#[non_exhaustive]
46pub struct GetBlockOutputBuilder {
47    pub(crate) block: ::std::option::Option<crate::types::ValueHolder>,
48    pub(crate) proof: ::std::option::Option<crate::types::ValueHolder>,
49    _request_id: Option<String>,
50}
51impl GetBlockOutputBuilder {
52    /// <p>The block data object in Amazon Ion format.</p>
53    /// This field is required.
54    pub fn block(mut self, input: crate::types::ValueHolder) -> Self {
55        self.block = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The block data object in Amazon Ion format.</p>
59    pub fn set_block(mut self, input: ::std::option::Option<crate::types::ValueHolder>) -> Self {
60        self.block = input;
61        self
62    }
63    /// <p>The block data object in Amazon Ion format.</p>
64    pub fn get_block(&self) -> &::std::option::Option<crate::types::ValueHolder> {
65        &self.block
66    }
67    /// <p>The proof object in Amazon Ion format returned by a <code>GetBlock</code> request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.</p>
68    pub fn proof(mut self, input: crate::types::ValueHolder) -> Self {
69        self.proof = ::std::option::Option::Some(input);
70        self
71    }
72    /// <p>The proof object in Amazon Ion format returned by a <code>GetBlock</code> request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.</p>
73    pub fn set_proof(mut self, input: ::std::option::Option<crate::types::ValueHolder>) -> Self {
74        self.proof = input;
75        self
76    }
77    /// <p>The proof object in Amazon Ion format returned by a <code>GetBlock</code> request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.</p>
78    pub fn get_proof(&self) -> &::std::option::Option<crate::types::ValueHolder> {
79        &self.proof
80    }
81    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
82        self._request_id = Some(request_id.into());
83        self
84    }
85
86    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
87        self._request_id = request_id;
88        self
89    }
90    /// Consumes the builder and constructs a [`GetBlockOutput`](crate::operation::get_block::GetBlockOutput).
91    pub fn build(self) -> crate::operation::get_block::GetBlockOutput {
92        crate::operation::get_block::GetBlockOutput {
93            block: self.block,
94            proof: self.proof,
95            _request_id: self._request_id,
96        }
97    }
98}
99impl ::std::fmt::Debug for GetBlockOutputBuilder {
100    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
101        let mut formatter = f.debug_struct("GetBlockOutputBuilder");
102        formatter.field("block", &"*** Sensitive Data Redacted ***");
103        formatter.field("proof", &"*** Sensitive Data Redacted ***");
104        formatter.field("_request_id", &self._request_id);
105        formatter.finish()
106    }
107}