use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ResponseShellCallCommandDoneStreamingEvent {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "sequence_number")]
pub sequence_number: i32,
#[serde(rename = "output_index")]
pub output_index: i32,
#[serde(rename = "command_index")]
pub command_index: i32,
#[serde(rename = "command")]
pub command: String,
}
impl ResponseShellCallCommandDoneStreamingEvent {
pub fn new(
r#type: Type,
sequence_number: i32,
output_index: i32,
command_index: i32,
command: String,
) -> ResponseShellCallCommandDoneStreamingEvent {
ResponseShellCallCommandDoneStreamingEvent {
r#type,
sequence_number,
output_index,
command_index,
command,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "response.shell_call_command.done")]
ResponseShellCallCommandDone,
}
impl Default for Type {
fn default() -> Type {
Self::ResponseShellCallCommandDone
}
}
impl std::fmt::Display for ResponseShellCallCommandDoneStreamingEvent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}