use super::*;
#[derive(Debug, Args)]
pub struct ListChangedBlocks {
#[arg(long)]
first_snapshot_id: String,
#[arg(long)]
second_snapshot_id: String,
#[arg(long)]
next_token: Option<String>,
}
impl ListChangedBlocks {
pub(crate) async fn execute(self, config: &Config) -> EbsResult {
let changed_blocks = config
.ebs()
.list_changed_blocks()
.first_snapshot_id(self.first_snapshot_id)
.second_snapshot_id(self.second_snapshot_id)
.set_next_token(self.next_token)
.into_paginator()
.send()
.try_collect()
.await?
.into_iter()
.filter_map(|item| item.changed_blocks)
.flatten()
.collect::<Vec<_>>();
Ok(Box::new(changed_blocks))
}
}