pub struct MessageBatch {
pub id: String,
pub object_type: String,
pub processing_status: BatchStatus,
pub request_counts: BatchRequestCounts,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub ended_at: Option<DateTime<Utc>>,
pub input_file_id: String,
pub output_file_id: Option<String>,
pub error_file_id: Option<String>,
pub metadata: HashMap<String, String>,
}
Expand description
A batch request for processing multiple messages efficiently
Fields§
§id: String
Unique identifier for the batch
object_type: String
The type of object (always “message_batch”)
processing_status: BatchStatus
Current processing status of the batch
request_counts: BatchRequestCounts
Total number of requests in the batch
created_at: DateTime<Utc>
When the batch was created
expires_at: DateTime<Utc>
When the batch processing will expire
ended_at: Option<DateTime<Utc>>
When the batch processing was completed (if applicable)
input_file_id: String
File ID containing the batch requests
output_file_id: Option<String>
File ID containing the batch results (if completed)
error_file_id: Option<String>
File ID containing any errors (if applicable)
metadata: HashMap<String, String>
Custom metadata for the batch
Implementations§
Source§impl MessageBatch
impl MessageBatch
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if the batch is complete
Sourcepub fn has_failed(&self) -> bool
pub fn has_failed(&self) -> bool
Check if the batch has failed
Sourcepub fn can_cancel(&self) -> bool
pub fn can_cancel(&self) -> bool
Check if the batch can be cancelled
Sourcepub fn completion_percentage(&self) -> f64
pub fn completion_percentage(&self) -> f64
Get completion percentage
Sourcepub fn pending_requests(&self) -> u32
pub fn pending_requests(&self) -> u32
Get the number of pending requests
Trait Implementations§
Source§impl Clone for MessageBatch
impl Clone for MessageBatch
Source§fn clone(&self) -> MessageBatch
fn clone(&self) -> MessageBatch
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MessageBatch
impl Debug for MessageBatch
Source§impl<'de> Deserialize<'de> for MessageBatch
impl<'de> Deserialize<'de> for MessageBatch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MessageBatch
impl RefUnwindSafe for MessageBatch
impl Send for MessageBatch
impl Sync for MessageBatch
impl Unpin for MessageBatch
impl UnwindSafe for MessageBatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more