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