aws_sdk_paymentcryptography/operation/list_keys/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_keys::_list_keys_output::ListKeysOutputBuilder;
3
4pub use crate::operation::list_keys::_list_keys_input::ListKeysInputBuilder;
5
6impl crate::operation::list_keys::builders::ListKeysInputBuilder {
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::list_keys::ListKeysOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_keys::ListKeysError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_keys();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListKeys`.
24///
25/// <p>Lists the keys in the caller's Amazon Web Services account and Amazon Web Services Region. You can filter the list of keys.</p>
26/// <p>This is a paginated operation, which means that each response might contain only a subset of all the keys. When the response contains only a subset of keys, it includes a <code>NextToken</code> value. Use this value in a subsequent <code>ListKeys</code> request to get more keys. When you receive a response with no NextToken (or an empty or null value), that means there are no more keys to get.</p>
27/// <p><b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p>
28/// <p><b>Related operations:</b></p>
29/// <ul>
30/// <li>
31/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html">CreateKey</a></p></li>
32/// <li>
33/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_DeleteKey.html">DeleteKey</a></p></li>
34/// <li>
35/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetKey.html">GetKey</a></p></li>
36/// </ul>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct ListKeysFluentBuilder {
39    handle: ::std::sync::Arc<crate::client::Handle>,
40    inner: crate::operation::list_keys::builders::ListKeysInputBuilder,
41    config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl crate::client::customize::internal::CustomizableSend<crate::operation::list_keys::ListKeysOutput, crate::operation::list_keys::ListKeysError>
44    for ListKeysFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<crate::operation::list_keys::ListKeysOutput, crate::operation::list_keys::ListKeysError>,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl ListKeysFluentBuilder {
56    /// Creates a new `ListKeysFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the ListKeys as a reference.
65    pub fn as_input(&self) -> &crate::operation::list_keys::builders::ListKeysInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::list_keys::ListKeysOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::list_keys::ListKeysError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::list_keys::ListKeys::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::list_keys::ListKeys::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<crate::operation::list_keys::ListKeysOutput, crate::operation::list_keys::ListKeysError, Self>
101    {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// Create a paginator for this request
114    ///
115    /// Paginators are used by calling [`send().await`](crate::operation::list_keys::paginator::ListKeysPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
116    pub fn into_paginator(self) -> crate::operation::list_keys::paginator::ListKeysPaginator {
117        crate::operation::list_keys::paginator::ListKeysPaginator::new(self.handle, self.inner)
118    }
119    /// <p>The key state of the keys you want to list.</p>
120    pub fn key_state(mut self, input: crate::types::KeyState) -> Self {
121        self.inner = self.inner.key_state(input);
122        self
123    }
124    /// <p>The key state of the keys you want to list.</p>
125    pub fn set_key_state(mut self, input: ::std::option::Option<crate::types::KeyState>) -> Self {
126        self.inner = self.inner.set_key_state(input);
127        self
128    }
129    /// <p>The key state of the keys you want to list.</p>
130    pub fn get_key_state(&self) -> &::std::option::Option<crate::types::KeyState> {
131        self.inner.get_key_state()
132    }
133    /// <p>Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextToken</code> from the truncated response you just received.</p>
134    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.next_token(input.into());
136        self
137    }
138    /// <p>Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextToken</code> from the truncated response you just received.</p>
139    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_next_token(input);
141        self
142    }
143    /// <p>Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextToken</code> from the truncated response you just received.</p>
144    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_next_token()
146    }
147    /// <p>Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.</p>
148    /// <p>This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.</p>
149    pub fn max_results(mut self, input: i32) -> Self {
150        self.inner = self.inner.max_results(input);
151        self
152    }
153    /// <p>Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.</p>
154    /// <p>This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.</p>
155    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
156        self.inner = self.inner.set_max_results(input);
157        self
158    }
159    /// <p>Use this parameter to specify the maximum number of items to return. When this value is present, Amazon Web Services Payment Cryptography does not return more than the specified number of items, but it might return fewer.</p>
160    /// <p>This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.</p>
161    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
162        self.inner.get_max_results()
163    }
164}