aws_sdk_managedblockchain/operation/create_accessor/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_accessor::_create_accessor_output::CreateAccessorOutputBuilder;
3
4pub use crate::operation::create_accessor::_create_accessor_input::CreateAccessorInputBuilder;
5
6impl crate::operation::create_accessor::builders::CreateAccessorInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_accessor::CreateAccessorOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_accessor::CreateAccessorError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_accessor();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAccessor`.
24///
25/// <p>Creates a new accessor for use with Amazon Managed Blockchain service that supports token based access. The accessor contains information required for token based access.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateAccessorFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_accessor::builders::CreateAccessorInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_accessor::CreateAccessorOutput,
35 crate::operation::create_accessor::CreateAccessorError,
36 > for CreateAccessorFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_accessor::CreateAccessorOutput,
44 crate::operation::create_accessor::CreateAccessorError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateAccessorFluentBuilder {
51 /// Creates a new `CreateAccessorFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateAccessor as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_accessor::builders::CreateAccessorInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_accessor::CreateAccessorOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_accessor::CreateAccessorError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_accessor::CreateAccessor::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_accessor::CreateAccessor::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_accessor::CreateAccessorOutput,
97 crate::operation::create_accessor::CreateAccessorError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>This is a unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than once. 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 Amazon Web Services CLI.</p>
112 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.client_request_token(input.into());
114 self
115 }
116 /// <p>This is a unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than once. 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 Amazon Web Services CLI.</p>
117 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_client_request_token(input);
119 self
120 }
121 /// <p>This is a unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than once. 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 Amazon Web Services CLI.</p>
122 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_client_request_token()
124 }
125 /// <p>The type of accessor.</p><note>
126 /// <p>Currently, accessor type is restricted to <code>BILLING_TOKEN</code>.</p>
127 /// </note>
128 pub fn accessor_type(mut self, input: crate::types::AccessorType) -> Self {
129 self.inner = self.inner.accessor_type(input);
130 self
131 }
132 /// <p>The type of accessor.</p><note>
133 /// <p>Currently, accessor type is restricted to <code>BILLING_TOKEN</code>.</p>
134 /// </note>
135 pub fn set_accessor_type(mut self, input: ::std::option::Option<crate::types::AccessorType>) -> Self {
136 self.inner = self.inner.set_accessor_type(input);
137 self
138 }
139 /// <p>The type of accessor.</p><note>
140 /// <p>Currently, accessor type is restricted to <code>BILLING_TOKEN</code>.</p>
141 /// </note>
142 pub fn get_accessor_type(&self) -> &::std::option::Option<crate::types::AccessorType> {
143 self.inner.get_accessor_type()
144 }
145 ///
146 /// Adds a key-value pair to `Tags`.
147 ///
148 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
149 ///
150 /// <p>Tags to assign to the Accessor.</p>
151 /// <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>
152 /// <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>
153 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.inner = self.inner.tags(k.into(), v.into());
155 self
156 }
157 /// <p>Tags to assign to the Accessor.</p>
158 /// <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>
159 /// <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>
160 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
161 self.inner = self.inner.set_tags(input);
162 self
163 }
164 /// <p>Tags to assign to the Accessor.</p>
165 /// <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>
166 /// <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>
167 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
168 self.inner.get_tags()
169 }
170 /// <p>The blockchain network that the <code>Accessor</code> token is created for.</p><note>
171 /// <ul>
172 /// <li>
173 /// <p>Use the actual <code>networkType</code> value for the blockchain network that you are creating the <code>Accessor</code> token for.</p></li>
174 /// <li>
175 /// <p>With the shut down of the <i>Ethereum Goerli</i> and <i>Polygon Mumbai Testnet</i> networks the following <code>networkType</code> values are no longer available for selection and use.</p>
176 /// <ul>
177 /// <li>
178 /// <p><code>ETHEREUM_MAINNET_AND_GOERLI</code></p></li>
179 /// <li>
180 /// <p><code>ETHEREUM_GOERLI</code></p></li>
181 /// <li>
182 /// <p><code>POLYGON_MUMBAI</code></p></li>
183 /// </ul>
184 /// <p>However, your existing <code>Accessor</code> tokens with these <code>networkType</code> values will remain unchanged.</p></li>
185 /// </ul>
186 /// </note>
187 pub fn network_type(mut self, input: crate::types::AccessorNetworkType) -> Self {
188 self.inner = self.inner.network_type(input);
189 self
190 }
191 /// <p>The blockchain network that the <code>Accessor</code> token is created for.</p><note>
192 /// <ul>
193 /// <li>
194 /// <p>Use the actual <code>networkType</code> value for the blockchain network that you are creating the <code>Accessor</code> token for.</p></li>
195 /// <li>
196 /// <p>With the shut down of the <i>Ethereum Goerli</i> and <i>Polygon Mumbai Testnet</i> networks the following <code>networkType</code> values are no longer available for selection and use.</p>
197 /// <ul>
198 /// <li>
199 /// <p><code>ETHEREUM_MAINNET_AND_GOERLI</code></p></li>
200 /// <li>
201 /// <p><code>ETHEREUM_GOERLI</code></p></li>
202 /// <li>
203 /// <p><code>POLYGON_MUMBAI</code></p></li>
204 /// </ul>
205 /// <p>However, your existing <code>Accessor</code> tokens with these <code>networkType</code> values will remain unchanged.</p></li>
206 /// </ul>
207 /// </note>
208 pub fn set_network_type(mut self, input: ::std::option::Option<crate::types::AccessorNetworkType>) -> Self {
209 self.inner = self.inner.set_network_type(input);
210 self
211 }
212 /// <p>The blockchain network that the <code>Accessor</code> token is created for.</p><note>
213 /// <ul>
214 /// <li>
215 /// <p>Use the actual <code>networkType</code> value for the blockchain network that you are creating the <code>Accessor</code> token for.</p></li>
216 /// <li>
217 /// <p>With the shut down of the <i>Ethereum Goerli</i> and <i>Polygon Mumbai Testnet</i> networks the following <code>networkType</code> values are no longer available for selection and use.</p>
218 /// <ul>
219 /// <li>
220 /// <p><code>ETHEREUM_MAINNET_AND_GOERLI</code></p></li>
221 /// <li>
222 /// <p><code>ETHEREUM_GOERLI</code></p></li>
223 /// <li>
224 /// <p><code>POLYGON_MUMBAI</code></p></li>
225 /// </ul>
226 /// <p>However, your existing <code>Accessor</code> tokens with these <code>networkType</code> values will remain unchanged.</p></li>
227 /// </ul>
228 /// </note>
229 pub fn get_network_type(&self) -> &::std::option::Option<crate::types::AccessorNetworkType> {
230 self.inner.get_network_type()
231 }
232}