aws_sdk_kms/operation/list_resource_tags/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_resource_tags::_list_resource_tags_output::ListResourceTagsOutputBuilder;
3
4pub use crate::operation::list_resource_tags::_list_resource_tags_input::ListResourceTagsInputBuilder;
5
6impl crate::operation::list_resource_tags::builders::ListResourceTagsInputBuilder {
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_resource_tags::ListResourceTagsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_resource_tags::ListResourceTagsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_resource_tags();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListResourceTags`.
24///
25/// <p>Returns all tags on the specified KMS key.</p>
26/// <p>For general information about tags, including the format and syntax, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference</i>. For information about using tags in KMS, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html">Tags in KMS</a>.</p>
27/// <p><b>Cross-account use</b>: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.</p>
28/// <p><b>Required permissions</b>: <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">kms:ListResourceTags</a> (key policy)</p>
29/// <p><b>Related operations:</b></p>
30/// <ul>
31/// <li>
32/// <p><code>CreateKey</code></p></li>
33/// <li>
34/// <p><code>ReplicateKey</code></p></li>
35/// <li>
36/// <p><code>TagResource</code></p></li>
37/// <li>
38/// <p><code>UntagResource</code></p></li>
39/// </ul>
40/// <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/accessing-kms.html#programming-eventual-consistency">KMS eventual consistency</a>.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct ListResourceTagsFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::list_resource_tags::builders::ListResourceTagsInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::list_resource_tags::ListResourceTagsOutput,
50        crate::operation::list_resource_tags::ListResourceTagsError,
51    > for ListResourceTagsFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::list_resource_tags::ListResourceTagsOutput,
59            crate::operation::list_resource_tags::ListResourceTagsError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl ListResourceTagsFluentBuilder {
66    /// Creates a new `ListResourceTagsFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the ListResourceTags as a reference.
75    pub fn as_input(&self) -> &crate::operation::list_resource_tags::builders::ListResourceTagsInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::list_resource_tags::ListResourceTagsOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::list_resource_tags::ListResourceTagsError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::list_resource_tags::ListResourceTags::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::list_resource_tags::ListResourceTags::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::list_resource_tags::ListResourceTagsOutput,
112        crate::operation::list_resource_tags::ListResourceTagsError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// Create a paginator for this request
127    ///
128    /// Paginators are used by calling [`send().await`](crate::operation::list_resource_tags::paginator::ListResourceTagsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
129    pub fn into_paginator(self) -> crate::operation::list_resource_tags::paginator::ListResourceTagsPaginator {
130        crate::operation::list_resource_tags::paginator::ListResourceTagsPaginator::new(self.handle, self.inner)
131    }
132    /// <p>Gets tags on the specified KMS key.</p>
133    /// <p>Specify the key ID or key ARN of the KMS key.</p>
134    /// <p>For example:</p>
135    /// <ul>
136    /// <li>
137    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
138    /// <li>
139    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
140    /// </ul>
141    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
142    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.key_id(input.into());
144        self
145    }
146    /// <p>Gets tags on the specified KMS key.</p>
147    /// <p>Specify the key ID or key ARN of the KMS key.</p>
148    /// <p>For example:</p>
149    /// <ul>
150    /// <li>
151    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
152    /// <li>
153    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
154    /// </ul>
155    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
156    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.inner = self.inner.set_key_id(input);
158        self
159    }
160    /// <p>Gets tags on the specified KMS key.</p>
161    /// <p>Specify the key ID or key ARN of the KMS key.</p>
162    /// <p>For example:</p>
163    /// <ul>
164    /// <li>
165    /// <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
166    /// <li>
167    /// <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code></p></li>
168    /// </ul>
169    /// <p>To get the key ID and key ARN for a KMS key, use <code>ListKeys</code> or <code>DescribeKey</code>.</p>
170    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_key_id()
172    }
173    /// <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>
174    /// <p>This value is optional. If you include a value, it must be between 1 and 50, inclusive. If you do not include a value, it defaults to 50.</p>
175    pub fn limit(mut self, input: i32) -> Self {
176        self.inner = self.inner.limit(input);
177        self
178    }
179    /// <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>
180    /// <p>This value is optional. If you include a value, it must be between 1 and 50, inclusive. If you do not include a value, it defaults to 50.</p>
181    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
182        self.inner = self.inner.set_limit(input);
183        self
184    }
185    /// <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>
186    /// <p>This value is optional. If you include a value, it must be between 1 and 50, inclusive. If you do not include a value, it defaults to 50.</p>
187    pub fn get_limit(&self) -> &::std::option::Option<i32> {
188        self.inner.get_limit()
189    }
190    /// <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>
191    /// <p>Do not attempt to construct this value. Use only the value of <code>NextMarker</code> from the truncated response you just received.</p>
192    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.marker(input.into());
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    /// <p>Do not attempt to construct this value. Use only the value of <code>NextMarker</code> from the truncated response you just received.</p>
198    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.inner = self.inner.set_marker(input);
200        self
201    }
202    /// <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>
203    /// <p>Do not attempt to construct this value. Use only the value of <code>NextMarker</code> from the truncated response you just received.</p>
204    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
205        self.inner.get_marker()
206    }
207}