aws_sdk_managedblockchain/operation/create_node/
_create_node_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 CreateNodeInput {
6    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
7    pub client_request_token: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the network for the node.</p>
9    /// <p>Ethereum public networks have the following <code>NetworkId</code>s:</p>
10    /// <ul>
11    /// <li>
12    /// <p><code>n-ethereum-mainnet</code></p></li>
13    /// </ul>
14    pub network_id: ::std::option::Option<::std::string::String>,
15    /// <p>The unique identifier of the member that owns this node.</p>
16    /// <p>Applies only to Hyperledger Fabric.</p>
17    pub member_id: ::std::option::Option<::std::string::String>,
18    /// <p>The properties of a node configuration.</p>
19    pub node_configuration: ::std::option::Option<crate::types::NodeConfiguration>,
20    /// <p>Tags to assign to the node.</p>
21    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
22    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
23    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
24}
25impl CreateNodeInput {
26    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
27    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
28        self.client_request_token.as_deref()
29    }
30    /// <p>The unique identifier of the network for the node.</p>
31    /// <p>Ethereum public networks have the following <code>NetworkId</code>s:</p>
32    /// <ul>
33    /// <li>
34    /// <p><code>n-ethereum-mainnet</code></p></li>
35    /// </ul>
36    pub fn network_id(&self) -> ::std::option::Option<&str> {
37        self.network_id.as_deref()
38    }
39    /// <p>The unique identifier of the member that owns this node.</p>
40    /// <p>Applies only to Hyperledger Fabric.</p>
41    pub fn member_id(&self) -> ::std::option::Option<&str> {
42        self.member_id.as_deref()
43    }
44    /// <p>The properties of a node configuration.</p>
45    pub fn node_configuration(&self) -> ::std::option::Option<&crate::types::NodeConfiguration> {
46        self.node_configuration.as_ref()
47    }
48    /// <p>Tags to assign to the node.</p>
49    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
50    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
51    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
52        self.tags.as_ref()
53    }
54}
55impl CreateNodeInput {
56    /// Creates a new builder-style object to manufacture [`CreateNodeInput`](crate::operation::create_node::CreateNodeInput).
57    pub fn builder() -> crate::operation::create_node::builders::CreateNodeInputBuilder {
58        crate::operation::create_node::builders::CreateNodeInputBuilder::default()
59    }
60}
61
62/// A builder for [`CreateNodeInput`](crate::operation::create_node::CreateNodeInput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct CreateNodeInputBuilder {
66    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
67    pub(crate) network_id: ::std::option::Option<::std::string::String>,
68    pub(crate) member_id: ::std::option::Option<::std::string::String>,
69    pub(crate) node_configuration: ::std::option::Option<crate::types::NodeConfiguration>,
70    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
71}
72impl CreateNodeInputBuilder {
73    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
74    /// This field is required.
75    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.client_request_token = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
80    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.client_request_token = input;
82        self
83    }
84    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the CLI.</p>
85    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
86        &self.client_request_token
87    }
88    /// <p>The unique identifier of the network for the node.</p>
89    /// <p>Ethereum public networks have the following <code>NetworkId</code>s:</p>
90    /// <ul>
91    /// <li>
92    /// <p><code>n-ethereum-mainnet</code></p></li>
93    /// </ul>
94    /// This field is required.
95    pub fn network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.network_id = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The unique identifier of the network for the node.</p>
100    /// <p>Ethereum public networks have the following <code>NetworkId</code>s:</p>
101    /// <ul>
102    /// <li>
103    /// <p><code>n-ethereum-mainnet</code></p></li>
104    /// </ul>
105    pub fn set_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.network_id = input;
107        self
108    }
109    /// <p>The unique identifier of the network for the node.</p>
110    /// <p>Ethereum public networks have the following <code>NetworkId</code>s:</p>
111    /// <ul>
112    /// <li>
113    /// <p><code>n-ethereum-mainnet</code></p></li>
114    /// </ul>
115    pub fn get_network_id(&self) -> &::std::option::Option<::std::string::String> {
116        &self.network_id
117    }
118    /// <p>The unique identifier of the member that owns this node.</p>
119    /// <p>Applies only to Hyperledger Fabric.</p>
120    pub fn member_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.member_id = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The unique identifier of the member that owns this node.</p>
125    /// <p>Applies only to Hyperledger Fabric.</p>
126    pub fn set_member_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.member_id = input;
128        self
129    }
130    /// <p>The unique identifier of the member that owns this node.</p>
131    /// <p>Applies only to Hyperledger Fabric.</p>
132    pub fn get_member_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.member_id
134    }
135    /// <p>The properties of a node configuration.</p>
136    /// This field is required.
137    pub fn node_configuration(mut self, input: crate::types::NodeConfiguration) -> Self {
138        self.node_configuration = ::std::option::Option::Some(input);
139        self
140    }
141    /// <p>The properties of a node configuration.</p>
142    pub fn set_node_configuration(mut self, input: ::std::option::Option<crate::types::NodeConfiguration>) -> Self {
143        self.node_configuration = input;
144        self
145    }
146    /// <p>The properties of a node configuration.</p>
147    pub fn get_node_configuration(&self) -> &::std::option::Option<crate::types::NodeConfiguration> {
148        &self.node_configuration
149    }
150    /// Adds a key-value pair to `tags`.
151    ///
152    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
153    ///
154    /// <p>Tags to assign to the node.</p>
155    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
156    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
157    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
158        let mut hash_map = self.tags.unwrap_or_default();
159        hash_map.insert(k.into(), v.into());
160        self.tags = ::std::option::Option::Some(hash_map);
161        self
162    }
163    /// <p>Tags to assign to the node.</p>
164    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
165    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
166    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
167        self.tags = input;
168        self
169    }
170    /// <p>Tags to assign to the node.</p>
171    /// <p>Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p>
172    /// <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
173    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
174        &self.tags
175    }
176    /// Consumes the builder and constructs a [`CreateNodeInput`](crate::operation::create_node::CreateNodeInput).
177    pub fn build(self) -> ::std::result::Result<crate::operation::create_node::CreateNodeInput, ::aws_smithy_types::error::operation::BuildError> {
178        ::std::result::Result::Ok(crate::operation::create_node::CreateNodeInput {
179            client_request_token: self.client_request_token,
180            network_id: self.network_id,
181            member_id: self.member_id,
182            node_configuration: self.node_configuration,
183            tags: self.tags,
184        })
185    }
186}