// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Paginator for [`ListAliases`](crate::operation::ListAliases)
pub struct ListAliasesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_aliases_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListAliasesPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_aliases_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `aliases`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListAliasesPaginatorItems {
crate::paginator::ListAliasesPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListAliasesOutput,
aws_smithy_http::result::SdkError<crate::error::ListAliasesError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_aliases_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListCodeSigningConfigs`](crate::operation::ListCodeSigningConfigs)
pub struct ListCodeSigningConfigsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_code_signing_configs_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListCodeSigningConfigsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_code_signing_configs_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `code_signing_configs`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListCodeSigningConfigsPaginatorItems {
crate::paginator::ListCodeSigningConfigsPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListCodeSigningConfigsOutput,
aws_smithy_http::result::SdkError<crate::error::ListCodeSigningConfigsError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_code_signing_configs_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListEventSourceMappings`](crate::operation::ListEventSourceMappings)
pub struct ListEventSourceMappingsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_event_source_mappings_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListEventSourceMappingsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_event_source_mappings_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `event_source_mappings`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListEventSourceMappingsPaginatorItems {
crate::paginator::ListEventSourceMappingsPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListEventSourceMappingsOutput,
aws_smithy_http::result::SdkError<crate::error::ListEventSourceMappingsError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_event_source_mappings_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListFunctionEventInvokeConfigs`](crate::operation::ListFunctionEventInvokeConfigs)
pub struct ListFunctionEventInvokeConfigsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_function_event_invoke_configs_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListFunctionEventInvokeConfigsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_function_event_invoke_configs_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `function_event_invoke_configs`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListFunctionEventInvokeConfigsPaginatorItems {
crate::paginator::ListFunctionEventInvokeConfigsPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListFunctionEventInvokeConfigsOutput,
aws_smithy_http::result::SdkError<crate::error::ListFunctionEventInvokeConfigsError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_function_event_invoke_configs_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListFunctions`](crate::operation::ListFunctions)
pub struct ListFunctionsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_functions_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListFunctionsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_functions_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `functions`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListFunctionsPaginatorItems {
crate::paginator::ListFunctionsPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListFunctionsOutput,
aws_smithy_http::result::SdkError<crate::error::ListFunctionsError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_functions_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListFunctionsByCodeSigningConfig`](crate::operation::ListFunctionsByCodeSigningConfig)
pub struct ListFunctionsByCodeSigningConfigPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_functions_by_code_signing_config_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListFunctionsByCodeSigningConfigPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_functions_by_code_signing_config_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `function_arns`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListFunctionsByCodeSigningConfigPaginatorItems {
crate::paginator::ListFunctionsByCodeSigningConfigPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListFunctionsByCodeSigningConfigOutput,
aws_smithy_http::result::SdkError<crate::error::ListFunctionsByCodeSigningConfigError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_functions_by_code_signing_config_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListFunctionUrlConfigs`](crate::operation::ListFunctionUrlConfigs)
pub struct ListFunctionUrlConfigsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_function_url_configs_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListFunctionUrlConfigsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_function_url_configs_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `function_url_configs`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListFunctionUrlConfigsPaginatorItems {
crate::paginator::ListFunctionUrlConfigsPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListFunctionUrlConfigsOutput,
aws_smithy_http::result::SdkError<crate::error::ListFunctionUrlConfigsError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_function_url_configs_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListLayers`](crate::operation::ListLayers)
pub struct ListLayersPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_layers_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListLayersPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_layers_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `layers`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListLayersPaginatorItems {
crate::paginator::ListLayersPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListLayersOutput,
aws_smithy_http::result::SdkError<crate::error::ListLayersError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_layers_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListLayerVersions`](crate::operation::ListLayerVersions)
pub struct ListLayerVersionsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_layer_versions_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListLayerVersionsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_layer_versions_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `layer_versions`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListLayerVersionsPaginatorItems {
crate::paginator::ListLayerVersionsPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListLayerVersionsOutput,
aws_smithy_http::result::SdkError<crate::error::ListLayerVersionsError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_layer_versions_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListProvisionedConcurrencyConfigs`](crate::operation::ListProvisionedConcurrencyConfigs)
pub struct ListProvisionedConcurrencyConfigsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_provisioned_concurrency_configs_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListProvisionedConcurrencyConfigsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_provisioned_concurrency_configs_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `provisioned_concurrency_configs`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListProvisionedConcurrencyConfigsPaginatorItems {
crate::paginator::ListProvisionedConcurrencyConfigsPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListProvisionedConcurrencyConfigsOutput,
aws_smithy_http::result::SdkError<crate::error::ListProvisionedConcurrencyConfigsError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_provisioned_concurrency_configs_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`ListVersionsByFunction`](crate::operation::ListVersionsByFunction)
pub struct ListVersionsByFunctionPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_versions_by_function_input::Builder,
stop_on_duplicate_token: bool,
}
impl ListVersionsByFunctionPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_versions_by_function_input::Builder,
) -> Self {
Self {
handle,
builder,
stop_on_duplicate_token: true,
}
}
/// Set the page size
///
/// _Note: this method will override any previously set value for `max_items`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_items = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `versions`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::ListVersionsByFunctionPaginatorItems {
crate::paginator::ListVersionsByFunctionPaginatorItems(self)
}
/// Stop paginating when the service returns the same pagination token twice in a row.
///
/// Defaults to true.
///
/// For certain operations, it may be useful to continue on duplicate token. For example,
/// if an operation is for tailing a log file in real-time, then continuing may be desired.
/// This option can be set to `false` to accommodate these use cases.
pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
self.stop_on_duplicate_token = stop_on_duplicate_token;
self
}
/// Create the pagination stream
///
/// _Note:_ No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next)).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListVersionsByFunctionOutput,
aws_smithy_http::result::SdkError<crate::error::ListVersionsByFunctionError>,
>,
> + Unpin {
// Move individual fields out of self for the borrow checker
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
// Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
let mut input = match builder
.build()
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input
.make_operation(&handle.conf)
.await
.map_err(aws_smithy_http::result::SdkError::construction_failure)
{
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
// If the input member is None or it was an error
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_versions_by_function_output_next_marker(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.marker.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.marker = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Flattened paginator for `ListAliasesPaginator`
///
/// This is created with [`.items()`](ListAliasesPaginator::items)
pub struct ListAliasesPaginatorItems(ListAliasesPaginator);
impl ListAliasesPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::AliasConfiguration,
aws_smithy_http::result::SdkError<crate::error::ListAliasesError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_list_aliases_output_aliases(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `ListCodeSigningConfigsPaginator`
///
/// This is created with [`.items()`](ListCodeSigningConfigsPaginator::items)
pub struct ListCodeSigningConfigsPaginatorItems(ListCodeSigningConfigsPaginator);
impl ListCodeSigningConfigsPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::CodeSigningConfig,
aws_smithy_http::result::SdkError<crate::error::ListCodeSigningConfigsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| crate::lens::lens_structure_crate_output_list_code_signing_configs_output_code_signing_configs(page).unwrap_or_default().into_iter())
}
}
/// Flattened paginator for `ListEventSourceMappingsPaginator`
///
/// This is created with [`.items()`](ListEventSourceMappingsPaginator::items)
pub struct ListEventSourceMappingsPaginatorItems(ListEventSourceMappingsPaginator);
impl ListEventSourceMappingsPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::EventSourceMappingConfiguration,
aws_smithy_http::result::SdkError<crate::error::ListEventSourceMappingsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| crate::lens::lens_structure_crate_output_list_event_source_mappings_output_event_source_mappings(page).unwrap_or_default().into_iter())
}
}
/// Flattened paginator for `ListFunctionEventInvokeConfigsPaginator`
///
/// This is created with [`.items()`](ListFunctionEventInvokeConfigsPaginator::items)
pub struct ListFunctionEventInvokeConfigsPaginatorItems(ListFunctionEventInvokeConfigsPaginator);
impl ListFunctionEventInvokeConfigsPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::FunctionEventInvokeConfig,
aws_smithy_http::result::SdkError<crate::error::ListFunctionEventInvokeConfigsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| crate::lens::lens_structure_crate_output_list_function_event_invoke_configs_output_function_event_invoke_configs(page).unwrap_or_default().into_iter())
}
}
/// Flattened paginator for `ListFunctionsPaginator`
///
/// This is created with [`.items()`](ListFunctionsPaginator::items)
pub struct ListFunctionsPaginatorItems(ListFunctionsPaginator);
impl ListFunctionsPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::FunctionConfiguration,
aws_smithy_http::result::SdkError<crate::error::ListFunctionsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_list_functions_output_functions(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `ListFunctionsByCodeSigningConfigPaginator`
///
/// This is created with [`.items()`](ListFunctionsByCodeSigningConfigPaginator::items)
pub struct ListFunctionsByCodeSigningConfigPaginatorItems(
ListFunctionsByCodeSigningConfigPaginator,
);
impl ListFunctionsByCodeSigningConfigPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
std::string::String,
aws_smithy_http::result::SdkError<crate::error::ListFunctionsByCodeSigningConfigError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| crate::lens::lens_structure_crate_output_list_functions_by_code_signing_config_output_function_arns(page).unwrap_or_default().into_iter())
}
}
/// Flattened paginator for `ListFunctionUrlConfigsPaginator`
///
/// This is created with [`.items()`](ListFunctionUrlConfigsPaginator::items)
pub struct ListFunctionUrlConfigsPaginatorItems(ListFunctionUrlConfigsPaginator);
impl ListFunctionUrlConfigsPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::FunctionUrlConfig,
aws_smithy_http::result::SdkError<crate::error::ListFunctionUrlConfigsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| crate::lens::lens_structure_crate_output_list_function_url_configs_output_function_url_configs(page).unwrap_or_default().into_iter())
}
}
/// Flattened paginator for `ListLayersPaginator`
///
/// This is created with [`.items()`](ListLayersPaginator::items)
pub struct ListLayersPaginatorItems(ListLayersPaginator);
impl ListLayersPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::LayersListItem,
aws_smithy_http::result::SdkError<crate::error::ListLayersError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_list_layers_output_layers(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `ListLayerVersionsPaginator`
///
/// This is created with [`.items()`](ListLayerVersionsPaginator::items)
pub struct ListLayerVersionsPaginatorItems(ListLayerVersionsPaginator);
impl ListLayerVersionsPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::LayerVersionsListItem,
aws_smithy_http::result::SdkError<crate::error::ListLayerVersionsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_list_layer_versions_output_layer_versions(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `ListProvisionedConcurrencyConfigsPaginator`
///
/// This is created with [`.items()`](ListProvisionedConcurrencyConfigsPaginator::items)
pub struct ListProvisionedConcurrencyConfigsPaginatorItems(
ListProvisionedConcurrencyConfigsPaginator,
);
impl ListProvisionedConcurrencyConfigsPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::ProvisionedConcurrencyConfigListItem,
aws_smithy_http::result::SdkError<crate::error::ListProvisionedConcurrencyConfigsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| crate::lens::lens_structure_crate_output_list_provisioned_concurrency_configs_output_provisioned_concurrency_configs(page).unwrap_or_default().into_iter())
}
}
/// Flattened paginator for `ListVersionsByFunctionPaginator`
///
/// This is created with [`.items()`](ListVersionsByFunctionPaginator::items)
pub struct ListVersionsByFunctionPaginatorItems(ListVersionsByFunctionPaginator);
impl ListVersionsByFunctionPaginatorItems {
/// Create the pagination stream
///
/// _Note: No requests will be dispatched until the stream is used (eg. with [`.next().await`](tokio_stream::StreamExt::next))._
///
/// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](tokio_stream::StreamExt::collect).
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::model::FunctionConfiguration,
aws_smithy_http::result::SdkError<crate::error::ListVersionsByFunctionError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_list_versions_by_function_output_versions(page)
.unwrap_or_default()
.into_iter()
})
}
}