pub struct ListAccountsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_accounts_input::Builder,
}
impl ListAccountsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_accounts_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListAccountsOutput,
aws_smithy_http::result::SdkError<crate::error::ListAccountsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_accounts_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListAppInstanceAdminsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_app_instance_admins_input::Builder,
}
impl ListAppInstanceAdminsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_app_instance_admins_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListAppInstanceAdminsOutput,
aws_smithy_http::result::SdkError<crate::error::ListAppInstanceAdminsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_app_instance_admins_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListAppInstancesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_app_instances_input::Builder,
}
impl ListAppInstancesPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_app_instances_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListAppInstancesOutput,
aws_smithy_http::result::SdkError<crate::error::ListAppInstancesError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_app_instances_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListAppInstanceUsersPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_app_instance_users_input::Builder,
}
impl ListAppInstanceUsersPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_app_instance_users_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListAppInstanceUsersOutput,
aws_smithy_http::result::SdkError<crate::error::ListAppInstanceUsersError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_app_instance_users_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListAttendeesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_attendees_input::Builder,
}
impl ListAttendeesPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_attendees_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListAttendeesOutput,
aws_smithy_http::result::SdkError<crate::error::ListAttendeesError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_attendees_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListBotsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_bots_input::Builder,
}
impl ListBotsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_bots_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListBotsOutput,
aws_smithy_http::result::SdkError<crate::error::ListBotsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_bots_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListChannelBansPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_bans_input::Builder,
}
impl ListChannelBansPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_bans_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListChannelBansOutput,
aws_smithy_http::result::SdkError<crate::error::ListChannelBansError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_channel_bans_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListChannelMembershipsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_memberships_input::Builder,
}
impl ListChannelMembershipsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_memberships_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListChannelMembershipsOutput,
aws_smithy_http::result::SdkError<crate::error::ListChannelMembershipsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_channel_memberships_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListChannelMembershipsForAppInstanceUserPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_memberships_for_app_instance_user_input::Builder,
}
impl ListChannelMembershipsForAppInstanceUserPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_memberships_for_app_instance_user_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListChannelMembershipsForAppInstanceUserOutput,
aws_smithy_http::result::SdkError<
crate::error::ListChannelMembershipsForAppInstanceUserError,
>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_channel_memberships_for_app_instance_user_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListChannelMessagesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_messages_input::Builder,
}
impl ListChannelMessagesPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_messages_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListChannelMessagesOutput,
aws_smithy_http::result::SdkError<crate::error::ListChannelMessagesError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_channel_messages_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListChannelModeratorsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_moderators_input::Builder,
}
impl ListChannelModeratorsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channel_moderators_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListChannelModeratorsOutput,
aws_smithy_http::result::SdkError<crate::error::ListChannelModeratorsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_channel_moderators_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListChannelsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channels_input::Builder,
}
impl ListChannelsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channels_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListChannelsOutput,
aws_smithy_http::result::SdkError<crate::error::ListChannelsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_channels_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListChannelsModeratedByAppInstanceUserPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channels_moderated_by_app_instance_user_input::Builder,
}
impl ListChannelsModeratedByAppInstanceUserPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_channels_moderated_by_app_instance_user_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListChannelsModeratedByAppInstanceUserOutput,
aws_smithy_http::result::SdkError<
crate::error::ListChannelsModeratedByAppInstanceUserError,
>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_channels_moderated_by_app_instance_user_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListMediaCapturePipelinesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_media_capture_pipelines_input::Builder,
}
impl ListMediaCapturePipelinesPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_media_capture_pipelines_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListMediaCapturePipelinesOutput,
aws_smithy_http::result::SdkError<crate::error::ListMediaCapturePipelinesError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_media_capture_pipelines_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListMeetingsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_meetings_input::Builder,
}
impl ListMeetingsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_meetings_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListMeetingsOutput,
aws_smithy_http::result::SdkError<crate::error::ListMeetingsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_meetings_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListPhoneNumberOrdersPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_phone_number_orders_input::Builder,
}
impl ListPhoneNumberOrdersPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_phone_number_orders_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListPhoneNumberOrdersOutput,
aws_smithy_http::result::SdkError<crate::error::ListPhoneNumberOrdersError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_phone_number_orders_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListPhoneNumbersPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_phone_numbers_input::Builder,
}
impl ListPhoneNumbersPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_phone_numbers_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListPhoneNumbersOutput,
aws_smithy_http::result::SdkError<crate::error::ListPhoneNumbersError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_phone_numbers_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListProxySessionsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_proxy_sessions_input::Builder,
}
impl ListProxySessionsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_proxy_sessions_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListProxySessionsOutput,
aws_smithy_http::result::SdkError<crate::error::ListProxySessionsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_proxy_sessions_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListRoomMembershipsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_room_memberships_input::Builder,
}
impl ListRoomMembershipsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_room_memberships_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListRoomMembershipsOutput,
aws_smithy_http::result::SdkError<crate::error::ListRoomMembershipsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_room_memberships_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListRoomsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_rooms_input::Builder,
}
impl ListRoomsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_rooms_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListRoomsOutput,
aws_smithy_http::result::SdkError<crate::error::ListRoomsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_rooms_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListSipMediaApplicationsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_sip_media_applications_input::Builder,
}
impl ListSipMediaApplicationsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_sip_media_applications_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListSipMediaApplicationsOutput,
aws_smithy_http::result::SdkError<crate::error::ListSipMediaApplicationsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_sip_media_applications_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListSipRulesPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_sip_rules_input::Builder,
}
impl ListSipRulesPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_sip_rules_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListSipRulesOutput,
aws_smithy_http::result::SdkError<crate::error::ListSipRulesError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_sip_rules_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListUsersPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_users_input::Builder,
}
impl ListUsersPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_users_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListUsersOutput,
aws_smithy_http::result::SdkError<crate::error::ListUsersError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_users_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListVoiceConnectorGroupsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_voice_connector_groups_input::Builder,
}
impl ListVoiceConnectorGroupsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_voice_connector_groups_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListVoiceConnectorGroupsOutput,
aws_smithy_http::result::SdkError<crate::error::ListVoiceConnectorGroupsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_voice_connector_groups_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct ListVoiceConnectorsPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_voice_connectors_input::Builder,
}
impl ListVoiceConnectorsPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::list_voice_connectors_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::ListVoiceConnectorsOutput,
aws_smithy_http::result::SdkError<crate::error::ListVoiceConnectorsError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_list_voice_connectors_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}
pub struct SearchAvailablePhoneNumbersPaginator {
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::search_available_phone_numbers_input::Builder,
}
impl SearchAvailablePhoneNumbersPaginator {
pub(crate) fn new(
handle: std::sync::Arc<crate::client::Handle>,
builder: crate::input::search_available_phone_numbers_input::Builder,
) -> Self {
Self { handle, builder }
}
pub fn page_size(mut self, limit: i32) -> Self {
self.builder.max_results = Some(limit);
self
}
pub fn send(
self,
) -> impl tokio_stream::Stream<
Item = std::result::Result<
crate::output::SearchAvailablePhoneNumbersOutput,
aws_smithy_http::result::SdkError<crate::error::SearchAvailablePhoneNumbersError>,
>,
> + Unpin {
let builder = self.builder;
let handle = self.handle;
aws_smithy_async::future::fn_stream::FnStream::new(move |tx| {
Box::pin(async move {
let mut input = match builder.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(input) => input,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
loop {
let op = match input.make_operation(&handle.conf).await.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
}) {
Ok(op) => op,
Err(e) => {
let _ = tx.send(Err(e)).await;
return;
}
};
let resp = handle.client.call(op).await;
let done = match resp {
Ok(ref resp) => {
let new_token = crate::lens::reflens_structure_crate_output_search_available_phone_numbers_output_next_token(resp);
let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
if !is_empty && new_token == input.next_token.as_ref() {
let _ = tx.send(Err(aws_smithy_http::result::SdkError::ConstructionFailure("next token did not change, aborting paginator. This indicates an SDK or AWS service bug.".into()))).await;
return;
}
input.next_token = new_token.cloned();
is_empty
}
Err(_) => true,
};
if tx.send(resp).await.is_err() {
return;
}
if done {
return;
}
}
})
})
}
}