Skip to main content

zai_rs/tool/file_parser_create/
response.rs

1//! File parser creation response models.
2//!
3//! This module provides data structures for file parser task creation
4//! responses.
5
6use serde::{Deserialize, Serialize};
7
8/// Response from file parser task creation.
9#[derive(Debug, Clone, Serialize, Deserialize)]
10pub struct FileParserCreateResponse {
11    /// Message about the task creation
12    pub message: String,
13    /// Unique identifier for the parsing task
14    pub task_id: String,
15}
16
17impl FileParserCreateResponse {
18    /// Check if the task was created successfully.
19    pub fn is_success(&self) -> bool {
20        !self.task_id.is_empty()
21    }
22
23    /// Get the task ID.
24    pub fn task_id(&self) -> &str {
25        &self.task_id
26    }
27}