From 65c49a6fdfd2a73a4afc04ed5fcbb9a9ae60cfc6 Mon Sep 17 00:00:00 2001 From: Dongri Jin Date: Thu, 10 Jul 2025 15:47:30 +0900 Subject: [PATCH] Fix batch object --- src/v1/batch.rs | 50 +++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/src/v1/batch.rs b/src/v1/batch.rs index 05e889d..f6badb8 100644 --- a/src/v1/batch.rs +++ b/src/v1/batch.rs @@ -23,27 +23,41 @@ pub struct RequestCounts { } #[derive(Debug, Serialize, Deserialize)] -pub struct BatchResponse { - pub id: String, +pub struct BatchError { + pub code: String, + pub line: Option, + pub message: String, + pub param: Option, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BatchErrors { pub object: String, - pub endpoint: String, - pub errors: Option>, - pub input_file_id: String, - pub completion_window: String, - pub status: String, - pub output_file_id: Option, - pub error_file_id: Option, - pub created_at: u64, - pub in_progress_at: Option, - pub expires_at: Option, - pub finalizing_at: Option, - pub completed_at: Option, - pub failed_at: Option, - pub expired_at: Option, - pub cancelling_at: Option, + pub data: Vec, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct BatchResponse { pub cancelled_at: Option, - pub request_counts: RequestCounts, + pub cancelling_at: Option, + pub completed_at: Option, + pub completion_window: String, + pub created_at: u64, + pub endpoint: String, + pub error_file_id: Option, + pub errors: Option, + pub expired_at: Option, + pub expires_at: Option, + pub failed_at: Option, + pub finalizing_at: Option, + pub id: String, + pub in_progress_at: Option, + pub input_file_id: String, pub metadata: Option, + pub object: String, + pub output_file_id: Option, + pub request_counts: RequestCounts, + pub status: String, } #[derive(Debug, Serialize, Deserialize)]