aws_sdk_qldb/operation/get_block/
_get_block_input.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 GetBlockInput {
6    /// <p>The name of the ledger.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
9    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}</code>.</p>
10    pub block_address: ::std::option::Option<crate::types::ValueHolder>,
11    /// <p>The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
12    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}</code>.</p>
13    pub digest_tip_address: ::std::option::Option<crate::types::ValueHolder>,
14}
15impl GetBlockInput {
16    /// <p>The name of the ledger.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
21    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}</code>.</p>
22    pub fn block_address(&self) -> ::std::option::Option<&crate::types::ValueHolder> {
23        self.block_address.as_ref()
24    }
25    /// <p>The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
26    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}</code>.</p>
27    pub fn digest_tip_address(&self) -> ::std::option::Option<&crate::types::ValueHolder> {
28        self.digest_tip_address.as_ref()
29    }
30}
31impl ::std::fmt::Debug for GetBlockInput {
32    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
33        let mut formatter = f.debug_struct("GetBlockInput");
34        formatter.field("name", &self.name);
35        formatter.field("block_address", &"*** Sensitive Data Redacted ***");
36        formatter.field("digest_tip_address", &"*** Sensitive Data Redacted ***");
37        formatter.finish()
38    }
39}
40impl GetBlockInput {
41    /// Creates a new builder-style object to manufacture [`GetBlockInput`](crate::operation::get_block::GetBlockInput).
42    pub fn builder() -> crate::operation::get_block::builders::GetBlockInputBuilder {
43        crate::operation::get_block::builders::GetBlockInputBuilder::default()
44    }
45}
46
47/// A builder for [`GetBlockInput`](crate::operation::get_block::GetBlockInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
49#[non_exhaustive]
50pub struct GetBlockInputBuilder {
51    pub(crate) name: ::std::option::Option<::std::string::String>,
52    pub(crate) block_address: ::std::option::Option<crate::types::ValueHolder>,
53    pub(crate) digest_tip_address: ::std::option::Option<crate::types::ValueHolder>,
54}
55impl GetBlockInputBuilder {
56    /// <p>The name of the ledger.</p>
57    /// This field is required.
58    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.name = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The name of the ledger.</p>
63    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.name = input;
65        self
66    }
67    /// <p>The name of the ledger.</p>
68    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
69        &self.name
70    }
71    /// <p>The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
72    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}</code>.</p>
73    /// This field is required.
74    pub fn block_address(mut self, input: crate::types::ValueHolder) -> Self {
75        self.block_address = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
79    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}</code>.</p>
80    pub fn set_block_address(mut self, input: ::std::option::Option<crate::types::ValueHolder>) -> Self {
81        self.block_address = input;
82        self
83    }
84    /// <p>The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
85    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}</code>.</p>
86    pub fn get_block_address(&self) -> &::std::option::Option<crate::types::ValueHolder> {
87        &self.block_address
88    }
89    /// <p>The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
90    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}</code>.</p>
91    pub fn digest_tip_address(mut self, input: crate::types::ValueHolder) -> Self {
92        self.digest_tip_address = ::std::option::Option::Some(input);
93        self
94    }
95    /// <p>The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
96    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}</code>.</p>
97    pub fn set_digest_tip_address(mut self, input: ::std::option::Option<crate::types::ValueHolder>) -> Self {
98        self.digest_tip_address = input;
99        self
100    }
101    /// <p>The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: <code>strandId</code> and <code>sequenceNo</code>.</p>
102    /// <p>For example: <code>{strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}</code>.</p>
103    pub fn get_digest_tip_address(&self) -> &::std::option::Option<crate::types::ValueHolder> {
104        &self.digest_tip_address
105    }
106    /// Consumes the builder and constructs a [`GetBlockInput`](crate::operation::get_block::GetBlockInput).
107    pub fn build(self) -> ::std::result::Result<crate::operation::get_block::GetBlockInput, ::aws_smithy_types::error::operation::BuildError> {
108        ::std::result::Result::Ok(crate::operation::get_block::GetBlockInput {
109            name: self.name,
110            block_address: self.block_address,
111            digest_tip_address: self.digest_tip_address,
112        })
113    }
114}
115impl ::std::fmt::Debug for GetBlockInputBuilder {
116    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
117        let mut formatter = f.debug_struct("GetBlockInputBuilder");
118        formatter.field("name", &self.name);
119        formatter.field("block_address", &"*** Sensitive Data Redacted ***");
120        formatter.field("digest_tip_address", &"*** Sensitive Data Redacted ***");
121        formatter.finish()
122    }
123}