edgequake_sdk/resources/
chunks.rs1use crate::client::EdgeQuakeClient;
4use crate::error::Result;
5use crate::types::operations::{ChunkDetail, ChunkLineageInfo};
6
7pub struct ChunksResource<'a> {
8 pub(crate) client: &'a EdgeQuakeClient,
9}
10
11impl<'a> ChunksResource<'a> {
12 pub async fn list(&self, document_id: &str) -> Result<Vec<ChunkDetail>> {
14 self.client
15 .get(&format!("/api/v1/documents/{document_id}/chunks"))
16 .await
17 }
18
19 pub async fn get(&self, id: &str) -> Result<ChunkDetail> {
21 self.client.get(&format!("/api/v1/chunks/{id}")).await
22 }
23
24 pub async fn get_lineage(&self, id: &str) -> Result<ChunkLineageInfo> {
30 self.client
31 .get(&format!("/api/v1/chunks/{id}/lineage"))
32 .await
33 }
34}