aws_sdk_managedblockchainquery/operation/get_transaction/
_get_transaction_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, ::std::fmt::Debug)]
5pub struct GetTransactionInput {
6    /// <p>The hash of a transaction. It is generated when a transaction is created.</p>
7    pub transaction_hash: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of a Bitcoin transaction. It is generated when a transaction is created.</p><note>
9    /// <p><code>transactionId</code> is only supported on the Bitcoin networks.</p>
10    /// </note>
11    pub transaction_id: ::std::option::Option<::std::string::String>,
12    /// <p>The blockchain network where the transaction occurred.</p>
13    pub network: ::std::option::Option<crate::types::QueryNetwork>,
14}
15impl GetTransactionInput {
16    /// <p>The hash of a transaction. It is generated when a transaction is created.</p>
17    pub fn transaction_hash(&self) -> ::std::option::Option<&str> {
18        self.transaction_hash.as_deref()
19    }
20    /// <p>The identifier of a Bitcoin transaction. It is generated when a transaction is created.</p><note>
21    /// <p><code>transactionId</code> is only supported on the Bitcoin networks.</p>
22    /// </note>
23    pub fn transaction_id(&self) -> ::std::option::Option<&str> {
24        self.transaction_id.as_deref()
25    }
26    /// <p>The blockchain network where the transaction occurred.</p>
27    pub fn network(&self) -> ::std::option::Option<&crate::types::QueryNetwork> {
28        self.network.as_ref()
29    }
30}
31impl GetTransactionInput {
32    /// Creates a new builder-style object to manufacture [`GetTransactionInput`](crate::operation::get_transaction::GetTransactionInput).
33    pub fn builder() -> crate::operation::get_transaction::builders::GetTransactionInputBuilder {
34        crate::operation::get_transaction::builders::GetTransactionInputBuilder::default()
35    }
36}
37
38/// A builder for [`GetTransactionInput`](crate::operation::get_transaction::GetTransactionInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct GetTransactionInputBuilder {
42    pub(crate) transaction_hash: ::std::option::Option<::std::string::String>,
43    pub(crate) transaction_id: ::std::option::Option<::std::string::String>,
44    pub(crate) network: ::std::option::Option<crate::types::QueryNetwork>,
45}
46impl GetTransactionInputBuilder {
47    /// <p>The hash of a transaction. It is generated when a transaction is created.</p>
48    pub fn transaction_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.transaction_hash = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>The hash of a transaction. It is generated when a transaction is created.</p>
53    pub fn set_transaction_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.transaction_hash = input;
55        self
56    }
57    /// <p>The hash of a transaction. It is generated when a transaction is created.</p>
58    pub fn get_transaction_hash(&self) -> &::std::option::Option<::std::string::String> {
59        &self.transaction_hash
60    }
61    /// <p>The identifier of a Bitcoin transaction. It is generated when a transaction is created.</p><note>
62    /// <p><code>transactionId</code> is only supported on the Bitcoin networks.</p>
63    /// </note>
64    pub fn transaction_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        self.transaction_id = ::std::option::Option::Some(input.into());
66        self
67    }
68    /// <p>The identifier of a Bitcoin transaction. It is generated when a transaction is created.</p><note>
69    /// <p><code>transactionId</code> is only supported on the Bitcoin networks.</p>
70    /// </note>
71    pub fn set_transaction_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.transaction_id = input;
73        self
74    }
75    /// <p>The identifier of a Bitcoin transaction. It is generated when a transaction is created.</p><note>
76    /// <p><code>transactionId</code> is only supported on the Bitcoin networks.</p>
77    /// </note>
78    pub fn get_transaction_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.transaction_id
80    }
81    /// <p>The blockchain network where the transaction occurred.</p>
82    /// This field is required.
83    pub fn network(mut self, input: crate::types::QueryNetwork) -> Self {
84        self.network = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>The blockchain network where the transaction occurred.</p>
88    pub fn set_network(mut self, input: ::std::option::Option<crate::types::QueryNetwork>) -> Self {
89        self.network = input;
90        self
91    }
92    /// <p>The blockchain network where the transaction occurred.</p>
93    pub fn get_network(&self) -> &::std::option::Option<crate::types::QueryNetwork> {
94        &self.network
95    }
96    /// Consumes the builder and constructs a [`GetTransactionInput`](crate::operation::get_transaction::GetTransactionInput).
97    pub fn build(
98        self,
99    ) -> ::std::result::Result<crate::operation::get_transaction::GetTransactionInput, ::aws_smithy_types::error::operation::BuildError> {
100        ::std::result::Result::Ok(crate::operation::get_transaction::GetTransactionInput {
101            transaction_hash: self.transaction_hash,
102            transaction_id: self.transaction_id,
103            network: self.network,
104        })
105    }
106}