aws_sdk_lambda/operation/list_event_source_mappings/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_event_source_mappings::_list_event_source_mappings_output::ListEventSourceMappingsOutputBuilder;
3
4pub use crate::operation::list_event_source_mappings::_list_event_source_mappings_input::ListEventSourceMappingsInputBuilder;
5
6impl crate::operation::list_event_source_mappings::builders::ListEventSourceMappingsInputBuilder {
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_event_source_mappings::ListEventSourceMappingsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_event_source_mappings::ListEventSourceMappingsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_event_source_mappings();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListEventSourceMappings`.
24///
25/// <p>Lists event source mappings. Specify an <code>EventSourceArn</code> to show only event source mappings for a single event source.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListEventSourceMappingsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_event_source_mappings::builders::ListEventSourceMappingsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_event_source_mappings::ListEventSourceMappingsOutput,
35        crate::operation::list_event_source_mappings::ListEventSourceMappingsError,
36    > for ListEventSourceMappingsFluentBuilder
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::list_event_source_mappings::ListEventSourceMappingsOutput,
44            crate::operation::list_event_source_mappings::ListEventSourceMappingsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListEventSourceMappingsFluentBuilder {
51    /// Creates a new `ListEventSourceMappingsFluentBuilder`.
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 ListEventSourceMappings as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_event_source_mappings::builders::ListEventSourceMappingsInputBuilder {
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::list_event_source_mappings::ListEventSourceMappingsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_event_source_mappings::ListEventSourceMappingsError,
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::list_event_source_mappings::ListEventSourceMappings::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_event_source_mappings::ListEventSourceMappings::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::list_event_source_mappings::ListEventSourceMappingsOutput,
97        crate::operation::list_event_source_mappings::ListEventSourceMappingsError,
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    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::list_event_source_mappings::paginator::ListEventSourceMappingsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_event_source_mappings::paginator::ListEventSourceMappingsPaginator {
115        crate::operation::list_event_source_mappings::paginator::ListEventSourceMappingsPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The Amazon Resource Name (ARN) of the event source.</p>
118    /// <ul>
119    /// <li>
120    /// <p><b>Amazon Kinesis</b> – The ARN of the data stream or a stream consumer.</p></li>
121    /// <li>
122    /// <p><b>Amazon DynamoDB Streams</b> – The ARN of the stream.</p></li>
123    /// <li>
124    /// <p><b>Amazon Simple Queue Service</b> – The ARN of the queue.</p></li>
125    /// <li>
126    /// <p><b>Amazon Managed Streaming for Apache Kafka</b> – The ARN of the cluster or the ARN of the VPC connection (for <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc">cross-account event source mappings</a>).</p></li>
127    /// <li>
128    /// <p><b>Amazon MQ</b> – The ARN of the broker.</p></li>
129    /// <li>
130    /// <p><b>Amazon DocumentDB</b> – The ARN of the DocumentDB change stream.</p></li>
131    /// </ul>
132    pub fn event_source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.event_source_arn(input.into());
134        self
135    }
136    /// <p>The Amazon Resource Name (ARN) of the event source.</p>
137    /// <ul>
138    /// <li>
139    /// <p><b>Amazon Kinesis</b> – The ARN of the data stream or a stream consumer.</p></li>
140    /// <li>
141    /// <p><b>Amazon DynamoDB Streams</b> – The ARN of the stream.</p></li>
142    /// <li>
143    /// <p><b>Amazon Simple Queue Service</b> – The ARN of the queue.</p></li>
144    /// <li>
145    /// <p><b>Amazon Managed Streaming for Apache Kafka</b> – The ARN of the cluster or the ARN of the VPC connection (for <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc">cross-account event source mappings</a>).</p></li>
146    /// <li>
147    /// <p><b>Amazon MQ</b> – The ARN of the broker.</p></li>
148    /// <li>
149    /// <p><b>Amazon DocumentDB</b> – The ARN of the DocumentDB change stream.</p></li>
150    /// </ul>
151    pub fn set_event_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_event_source_arn(input);
153        self
154    }
155    /// <p>The Amazon Resource Name (ARN) of the event source.</p>
156    /// <ul>
157    /// <li>
158    /// <p><b>Amazon Kinesis</b> – The ARN of the data stream or a stream consumer.</p></li>
159    /// <li>
160    /// <p><b>Amazon DynamoDB Streams</b> – The ARN of the stream.</p></li>
161    /// <li>
162    /// <p><b>Amazon Simple Queue Service</b> – The ARN of the queue.</p></li>
163    /// <li>
164    /// <p><b>Amazon Managed Streaming for Apache Kafka</b> – The ARN of the cluster or the ARN of the VPC connection (for <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc">cross-account event source mappings</a>).</p></li>
165    /// <li>
166    /// <p><b>Amazon MQ</b> – The ARN of the broker.</p></li>
167    /// <li>
168    /// <p><b>Amazon DocumentDB</b> – The ARN of the DocumentDB change stream.</p></li>
169    /// </ul>
170    pub fn get_event_source_arn(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_event_source_arn()
172    }
173    /// <p>The name or ARN of the Lambda function.</p>
174    /// <p class="title"><b>Name formats</b></p>
175    /// <ul>
176    /// <li>
177    /// <p><b>Function name</b> – <code>MyFunction</code>.</p></li>
178    /// <li>
179    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
180    /// <li>
181    /// <p><b>Version or Alias ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD</code>.</p></li>
182    /// <li>
183    /// <p><b>Partial ARN</b> – <code>123456789012:function:MyFunction</code>.</p></li>
184    /// </ul>
185    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.</p>
186    pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.inner = self.inner.function_name(input.into());
188        self
189    }
190    /// <p>The name or ARN of the Lambda function.</p>
191    /// <p class="title"><b>Name formats</b></p>
192    /// <ul>
193    /// <li>
194    /// <p><b>Function name</b> – <code>MyFunction</code>.</p></li>
195    /// <li>
196    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
197    /// <li>
198    /// <p><b>Version or Alias ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD</code>.</p></li>
199    /// <li>
200    /// <p><b>Partial ARN</b> – <code>123456789012:function:MyFunction</code>.</p></li>
201    /// </ul>
202    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.</p>
203    pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_function_name(input);
205        self
206    }
207    /// <p>The name or ARN of the Lambda function.</p>
208    /// <p class="title"><b>Name formats</b></p>
209    /// <ul>
210    /// <li>
211    /// <p><b>Function name</b> – <code>MyFunction</code>.</p></li>
212    /// <li>
213    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p></li>
214    /// <li>
215    /// <p><b>Version or Alias ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD</code>.</p></li>
216    /// <li>
217    /// <p><b>Partial ARN</b> – <code>123456789012:function:MyFunction</code>.</p></li>
218    /// </ul>
219    /// <p>The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.</p>
220    pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_function_name()
222    }
223    /// <p>A pagination token returned by a previous call.</p>
224    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225        self.inner = self.inner.marker(input.into());
226        self
227    }
228    /// <p>A pagination token returned by a previous call.</p>
229    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230        self.inner = self.inner.set_marker(input);
231        self
232    }
233    /// <p>A pagination token returned by a previous call.</p>
234    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
235        self.inner.get_marker()
236    }
237    /// <p>The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.</p>
238    pub fn max_items(mut self, input: i32) -> Self {
239        self.inner = self.inner.max_items(input);
240        self
241    }
242    /// <p>The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.</p>
243    pub fn set_max_items(mut self, input: ::std::option::Option<i32>) -> Self {
244        self.inner = self.inner.set_max_items(input);
245        self
246    }
247    /// <p>The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.</p>
248    pub fn get_max_items(&self) -> &::std::option::Option<i32> {
249        self.inner.get_max_items()
250    }
251}