aws_sdk_kms/operation/describe_custom_key_stores/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_custom_key_stores::_describe_custom_key_stores_output::DescribeCustomKeyStoresOutputBuilder;
3
4pub use crate::operation::describe_custom_key_stores::_describe_custom_key_stores_input::DescribeCustomKeyStoresInputBuilder;
5
6impl crate::operation::describe_custom_key_stores::builders::DescribeCustomKeyStoresInputBuilder {
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::describe_custom_key_stores::DescribeCustomKeyStoresOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_custom_key_stores();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeCustomKeyStores`.
24///
25/// <p>Gets information about <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key stores</a> in the account and Region.</p>
26/// <p>This operation is part of the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html">custom key stores</a> feature in KMS, which combines the convenience and extensive integration of KMS with the isolation and control of a key store that you own and manage.</p>
27/// <p>By default, this operation returns information about all custom key stores in the account and Region. To get only information about a particular custom key store, use either the <code>CustomKeyStoreName</code> or <code>CustomKeyStoreId</code> parameter (but not both).</p>
28/// <p>To determine whether the custom key store is connected to its CloudHSM cluster or external key store proxy, use the <code>ConnectionState</code> element in the response. If an attempt to connect the custom key store failed, the <code>ConnectionState</code> value is <code>FAILED</code> and the <code>ConnectionErrorCode</code> element in the response indicates the cause of the failure. For help interpreting the <code>ConnectionErrorCode</code>, see <code>CustomKeyStoresListEntry</code>.</p>
29/// <p>Custom key stores have a <code>DISCONNECTED</code> connection state if the key store has never been connected or you used the <code>DisconnectCustomKeyStore</code> operation to disconnect it. Otherwise, the connection state is CONNECTED. If your custom key store connection state is <code>CONNECTED</code> but you are having trouble using it, verify that the backing store is active and available. For an CloudHSM key store, verify that the associated CloudHSM cluster is active and contains the minimum number of HSMs required for the operation, if any. For an external key store, verify that the external key store proxy and its associated external key manager are reachable and enabled.</p>
30/// <p>For help repairing your CloudHSM key store, see the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html">Troubleshooting CloudHSM key stores</a>. For help repairing your external key store, see the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html">Troubleshooting external key stores</a>. Both topics are in the <i>Key Management Service Developer Guide</i>.</p>
31/// <p><b>Cross-account use</b>: No. You cannot perform this operation on a custom key store in a different Amazon Web Services account.</p>
32/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:DescribeCustomKeyStores</a> (IAM policy)</p>
33/// <p><b>Related operations:</b></p>
34/// <ul>
35/// <li>
36/// <p><code>ConnectCustomKeyStore</code></p></li>
37/// <li>
38/// <p><code>CreateCustomKeyStore</code></p></li>
39/// <li>
40/// <p><code>DeleteCustomKeyStore</code></p></li>
41/// <li>
42/// <p><code>DisconnectCustomKeyStore</code></p></li>
43/// <li>
44/// <p><code>UpdateCustomKeyStore</code></p></li>
45/// </ul>
46/// <p><b>Eventual consistency</b>: The KMS API follows an eventual consistency model. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html">KMS eventual consistency</a>.</p>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct DescribeCustomKeyStoresFluentBuilder {
49    handle: ::std::sync::Arc<crate::client::Handle>,
50    inner: crate::operation::describe_custom_key_stores::builders::DescribeCustomKeyStoresInputBuilder,
51    config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54    crate::client::customize::internal::CustomizableSend<
55        crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresOutput,
56        crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresError,
57    > for DescribeCustomKeyStoresFluentBuilder
58{
59    fn send(
60        self,
61        config_override: crate::config::Builder,
62    ) -> crate::client::customize::internal::BoxFuture<
63        crate::client::customize::internal::SendResult<
64            crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresOutput,
65            crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresError,
66        >,
67    > {
68        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69    }
70}
71impl DescribeCustomKeyStoresFluentBuilder {
72    /// Creates a new `DescribeCustomKeyStoresFluentBuilder`.
73    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74        Self {
75            handle,
76            inner: ::std::default::Default::default(),
77            config_override: ::std::option::Option::None,
78        }
79    }
80    /// Access the DescribeCustomKeyStores as a reference.
81    pub fn as_input(&self) -> &crate::operation::describe_custom_key_stores::builders::DescribeCustomKeyStoresInputBuilder {
82        &self.inner
83    }
84    /// Sends the request and returns the response.
85    ///
86    /// If an error occurs, an `SdkError` will be returned with additional details that
87    /// can be matched against.
88    ///
89    /// By default, any retryable failures will be retried twice. Retry behavior
90    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91    /// set when configuring the client.
92    pub async fn send(
93        self,
94    ) -> ::std::result::Result<
95        crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresOutput,
96        ::aws_smithy_runtime_api::client::result::SdkError<
97            crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresError,
98            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99        >,
100    > {
101        let input = self
102            .inner
103            .build()
104            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105        let runtime_plugins = crate::operation::describe_custom_key_stores::DescribeCustomKeyStores::operation_runtime_plugins(
106            self.handle.runtime_plugins.clone(),
107            &self.handle.conf,
108            self.config_override,
109        );
110        crate::operation::describe_custom_key_stores::DescribeCustomKeyStores::orchestrate(&runtime_plugins, input).await
111    }
112
113    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114    pub fn customize(
115        self,
116    ) -> crate::client::customize::CustomizableOperation<
117        crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresOutput,
118        crate::operation::describe_custom_key_stores::DescribeCustomKeyStoresError,
119        Self,
120    > {
121        crate::client::customize::CustomizableOperation::new(self)
122    }
123    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124        self.set_config_override(::std::option::Option::Some(config_override.into()));
125        self
126    }
127
128    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129        self.config_override = config_override;
130        self
131    }
132    /// Create a paginator for this request
133    ///
134    /// Paginators are used by calling [`send().await`](crate::operation::describe_custom_key_stores::paginator::DescribeCustomKeyStoresPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
135    pub fn into_paginator(self) -> crate::operation::describe_custom_key_stores::paginator::DescribeCustomKeyStoresPaginator {
136        crate::operation::describe_custom_key_stores::paginator::DescribeCustomKeyStoresPaginator::new(self.handle, self.inner)
137    }
138    /// <p>Gets only information about the specified custom key store. Enter the key store ID.</p>
139    /// <p>By default, this operation gets information about all custom key stores in the account and Region. To limit the output to a particular custom key store, provide either the <code>CustomKeyStoreId</code> or <code>CustomKeyStoreName</code> parameter, but not both.</p>
140    pub fn custom_key_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.custom_key_store_id(input.into());
142        self
143    }
144    /// <p>Gets only information about the specified custom key store. Enter the key store ID.</p>
145    /// <p>By default, this operation gets information about all custom key stores in the account and Region. To limit the output to a particular custom key store, provide either the <code>CustomKeyStoreId</code> or <code>CustomKeyStoreName</code> parameter, but not both.</p>
146    pub fn set_custom_key_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_custom_key_store_id(input);
148        self
149    }
150    /// <p>Gets only information about the specified custom key store. Enter the key store ID.</p>
151    /// <p>By default, this operation gets information about all custom key stores in the account and Region. To limit the output to a particular custom key store, provide either the <code>CustomKeyStoreId</code> or <code>CustomKeyStoreName</code> parameter, but not both.</p>
152    pub fn get_custom_key_store_id(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_custom_key_store_id()
154    }
155    /// <p>Gets only information about the specified custom key store. Enter the friendly name of the custom key store.</p>
156    /// <p>By default, this operation gets information about all custom key stores in the account and Region. To limit the output to a particular custom key store, provide either the <code>CustomKeyStoreId</code> or <code>CustomKeyStoreName</code> parameter, but not both.</p>
157    pub fn custom_key_store_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.custom_key_store_name(input.into());
159        self
160    }
161    /// <p>Gets only information about the specified custom key store. Enter the friendly name of the custom key store.</p>
162    /// <p>By default, this operation gets information about all custom key stores in the account and Region. To limit the output to a particular custom key store, provide either the <code>CustomKeyStoreId</code> or <code>CustomKeyStoreName</code> parameter, but not both.</p>
163    pub fn set_custom_key_store_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_custom_key_store_name(input);
165        self
166    }
167    /// <p>Gets only information about the specified custom key store. Enter the friendly name of the custom key store.</p>
168    /// <p>By default, this operation gets information about all custom key stores in the account and Region. To limit the output to a particular custom key store, provide either the <code>CustomKeyStoreId</code> or <code>CustomKeyStoreName</code> parameter, but not both.</p>
169    pub fn get_custom_key_store_name(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_custom_key_store_name()
171    }
172    /// <p>Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.</p>
173    pub fn limit(mut self, input: i32) -> Self {
174        self.inner = self.inner.limit(input);
175        self
176    }
177    /// <p>Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.</p>
178    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
179        self.inner = self.inner.set_limit(input);
180        self
181    }
182    /// <p>Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.</p>
183    pub fn get_limit(&self) -> &::std::option::Option<i32> {
184        self.inner.get_limit()
185    }
186    /// <p>Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextMarker</code> from the truncated response you just received.</p>
187    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.marker(input.into());
189        self
190    }
191    /// <p>Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextMarker</code> from the truncated response you just received.</p>
192    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.inner = self.inner.set_marker(input);
194        self
195    }
196    /// <p>Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextMarker</code> from the truncated response you just received.</p>
197    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
198        self.inner.get_marker()
199    }
200}