// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Paginator for [`GetApiKeys`](crate::operation::GetApiKeys)
pub struct GetApiKeysPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_api_keys_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetApiKeysPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_api_keys_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetApiKeysPaginatorItems {
crate::paginator::GetApiKeysPaginatorItems(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::GetApiKeysOutput,
aws_smithy_http::result::SdkError<crate::error::GetApiKeysError>,
>,
> + 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_get_api_keys_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetBasePathMappings`](crate::operation::GetBasePathMappings)
pub struct GetBasePathMappingsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_base_path_mappings_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetBasePathMappingsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_base_path_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetBasePathMappingsPaginatorItems {
crate::paginator::GetBasePathMappingsPaginatorItems(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::GetBasePathMappingsOutput,
aws_smithy_http::result::SdkError<crate::error::GetBasePathMappingsError>,
>,
> + 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_get_base_path_mappings_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetClientCertificates`](crate::operation::GetClientCertificates)
pub struct GetClientCertificatesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_client_certificates_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetClientCertificatesPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_client_certificates_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetClientCertificatesPaginatorItems {
crate::paginator::GetClientCertificatesPaginatorItems(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::GetClientCertificatesOutput,
aws_smithy_http::result::SdkError<crate::error::GetClientCertificatesError>,
>,
> + 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_get_client_certificates_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetDeployments`](crate::operation::GetDeployments)
pub struct GetDeploymentsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_deployments_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetDeploymentsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_deployments_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetDeploymentsPaginatorItems {
crate::paginator::GetDeploymentsPaginatorItems(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::GetDeploymentsOutput,
aws_smithy_http::result::SdkError<crate::error::GetDeploymentsError>,
>,
> + 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_get_deployments_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetDomainNames`](crate::operation::GetDomainNames)
pub struct GetDomainNamesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_domain_names_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetDomainNamesPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_domain_names_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetDomainNamesPaginatorItems {
crate::paginator::GetDomainNamesPaginatorItems(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::GetDomainNamesOutput,
aws_smithy_http::result::SdkError<crate::error::GetDomainNamesError>,
>,
> + 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_get_domain_names_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetModels`](crate::operation::GetModels)
pub struct GetModelsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_models_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetModelsPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_models_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetModelsPaginatorItems {
crate::paginator::GetModelsPaginatorItems(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::GetModelsOutput,
aws_smithy_http::result::SdkError<crate::error::GetModelsError>,
>,
> + 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_get_models_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetResources`](crate::operation::GetResources)
pub struct GetResourcesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_resources_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetResourcesPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_resources_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetResourcesPaginatorItems {
crate::paginator::GetResourcesPaginatorItems(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::GetResourcesOutput,
aws_smithy_http::result::SdkError<crate::error::GetResourcesError>,
>,
> + 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_get_resources_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetRestApis`](crate::operation::GetRestApis)
pub struct GetRestApisPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_rest_apis_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetRestApisPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_rest_apis_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetRestApisPaginatorItems {
crate::paginator::GetRestApisPaginatorItems(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::GetRestApisOutput,
aws_smithy_http::result::SdkError<crate::error::GetRestApisError>,
>,
> + 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_get_rest_apis_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetUsage`](crate::operation::GetUsage)
pub struct GetUsagePaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_usage_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetUsagePaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_usage_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetUsagePaginatorItems {
crate::paginator::GetUsagePaginatorItems(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::GetUsageOutput,
aws_smithy_http::result::SdkError<crate::error::GetUsageError>,
>,
> + 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_get_usage_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetUsagePlanKeys`](crate::operation::GetUsagePlanKeys)
pub struct GetUsagePlanKeysPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_usage_plan_keys_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetUsagePlanKeysPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_usage_plan_keys_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetUsagePlanKeysPaginatorItems {
crate::paginator::GetUsagePlanKeysPaginatorItems(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::GetUsagePlanKeysOutput,
aws_smithy_http::result::SdkError<crate::error::GetUsagePlanKeysError>,
>,
> + 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_get_usage_plan_keys_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetUsagePlans`](crate::operation::GetUsagePlans)
pub struct GetUsagePlansPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_usage_plans_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetUsagePlansPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_usage_plans_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetUsagePlansPaginatorItems {
crate::paginator::GetUsagePlansPaginatorItems(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::GetUsagePlansOutput,
aws_smithy_http::result::SdkError<crate::error::GetUsagePlansError>,
>,
> + 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_get_usage_plans_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = new_token.cloned();
is_empty
}
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
// receiving end was dropped
return;
}
if done {
return;
}
}
})
})
}
}
/// Paginator for [`GetVpcLinks`](crate::operation::GetVpcLinks)
pub struct GetVpcLinksPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_vpc_links_input::Builder,
stop_on_duplicate_token: bool,
}
impl GetVpcLinksPaginator {
/// Create a new paginator-wrapper
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::get_vpc_links_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 `limit`_
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.limit = Some(limit);
self
}
/// Create a flattened paginator
///
/// This paginator automatically flattens results using `items`. Queries to the underlying service
/// are dispatched lazily.
pub fn items(self) -> crate::paginator::GetVpcLinksPaginatorItems {
crate::paginator::GetVpcLinksPaginatorItems(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::GetVpcLinksOutput,
aws_smithy_http::result::SdkError<crate::error::GetVpcLinksError>,
>,
> + 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_get_vpc_links_output_position(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty
&& new_token == input.position.as_ref()
&& self.stop_on_duplicate_token
{
true
} else {
input.position = 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 `GetApiKeysPaginator`
///
/// This is created with [`.items()`](GetApiKeysPaginator::items)
pub struct GetApiKeysPaginatorItems(GetApiKeysPaginator);
impl GetApiKeysPaginatorItems {
/// 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::ApiKey,
aws_smithy_http::result::SdkError<crate::error::GetApiKeysError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_api_keys_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetBasePathMappingsPaginator`
///
/// This is created with [`.items()`](GetBasePathMappingsPaginator::items)
pub struct GetBasePathMappingsPaginatorItems(GetBasePathMappingsPaginator);
impl GetBasePathMappingsPaginatorItems {
/// 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::BasePathMapping,
aws_smithy_http::result::SdkError<crate::error::GetBasePathMappingsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_base_path_mappings_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetClientCertificatesPaginator`
///
/// This is created with [`.items()`](GetClientCertificatesPaginator::items)
pub struct GetClientCertificatesPaginatorItems(GetClientCertificatesPaginator);
impl GetClientCertificatesPaginatorItems {
/// 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::ClientCertificate,
aws_smithy_http::result::SdkError<crate::error::GetClientCertificatesError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_client_certificates_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetDeploymentsPaginator`
///
/// This is created with [`.items()`](GetDeploymentsPaginator::items)
pub struct GetDeploymentsPaginatorItems(GetDeploymentsPaginator);
impl GetDeploymentsPaginatorItems {
/// 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::Deployment,
aws_smithy_http::result::SdkError<crate::error::GetDeploymentsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_deployments_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetDomainNamesPaginator`
///
/// This is created with [`.items()`](GetDomainNamesPaginator::items)
pub struct GetDomainNamesPaginatorItems(GetDomainNamesPaginator);
impl GetDomainNamesPaginatorItems {
/// 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::DomainName,
aws_smithy_http::result::SdkError<crate::error::GetDomainNamesError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_domain_names_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetModelsPaginator`
///
/// This is created with [`.items()`](GetModelsPaginator::items)
pub struct GetModelsPaginatorItems(GetModelsPaginator);
impl GetModelsPaginatorItems {
/// 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::Model,
aws_smithy_http::result::SdkError<crate::error::GetModelsError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_models_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetResourcesPaginator`
///
/// This is created with [`.items()`](GetResourcesPaginator::items)
pub struct GetResourcesPaginatorItems(GetResourcesPaginator);
impl GetResourcesPaginatorItems {
/// 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::Resource,
aws_smithy_http::result::SdkError<crate::error::GetResourcesError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_resources_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetRestApisPaginator`
///
/// This is created with [`.items()`](GetRestApisPaginator::items)
pub struct GetRestApisPaginatorItems(GetRestApisPaginator);
impl GetRestApisPaginatorItems {
/// 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::RestApi,
aws_smithy_http::result::SdkError<crate::error::GetRestApisError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_rest_apis_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetUsagePaginator`
///
/// This is created with [`.items()`](GetUsagePaginator::items)
pub struct GetUsagePaginatorItems(GetUsagePaginator);
impl GetUsagePaginatorItems {
/// 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, std::vec::Vec<std::vec::Vec<i64>>),
aws_smithy_http::result::SdkError<crate::error::GetUsageError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_usage_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetUsagePlanKeysPaginator`
///
/// This is created with [`.items()`](GetUsagePlanKeysPaginator::items)
pub struct GetUsagePlanKeysPaginatorItems(GetUsagePlanKeysPaginator);
impl GetUsagePlanKeysPaginatorItems {
/// 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::UsagePlanKey,
aws_smithy_http::result::SdkError<crate::error::GetUsagePlanKeysError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_usage_plan_keys_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetUsagePlansPaginator`
///
/// This is created with [`.items()`](GetUsagePlansPaginator::items)
pub struct GetUsagePlansPaginatorItems(GetUsagePlansPaginator);
impl GetUsagePlansPaginatorItems {
/// 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::UsagePlan,
aws_smithy_http::result::SdkError<crate::error::GetUsagePlansError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_usage_plans_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}
/// Flattened paginator for `GetVpcLinksPaginator`
///
/// This is created with [`.items()`](GetVpcLinksPaginator::items)
pub struct GetVpcLinksPaginatorItems(GetVpcLinksPaginator);
impl GetVpcLinksPaginatorItems {
/// 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::VpcLink,
aws_smithy_http::result::SdkError<crate::error::GetVpcLinksError>,
>,
> + Unpin {
aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
crate::lens::lens_structure_crate_output_get_vpc_links_output_items(page)
.unwrap_or_default()
.into_iter()
})
}
}