use serde::{Deserialize, Serialize};
use serde_json::Value;
use super::ContractModel;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct RawTurnHeaderItem {
pub agent_name: String,
pub id: i64,
pub meta: Value,
pub provider: String,
pub received_at: String,
pub request_bytes: i64,
pub request_id: String,
pub response_bytes: i64,
pub source: String,
}
impl ContractModel for RawTurnHeaderItem {
const SCHEMA: &'static str = "RawTurnHeaderItem";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct RawTurnListResponse {
#[serde(deserialize_with = "super::null_default")]
pub items: Vec<RawTurnHeaderItem>,
}
impl ContractModel for RawTurnListResponse {
const SCHEMA: &'static str = "RawTurnListResponse";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct RawTurnAttribution {
pub harness_id: String,
pub harness_session_id: String,
pub parent_harness_session_id: String,
pub raw_turn_id: i64,
pub thread_id: String,
}
impl ContractModel for RawTurnAttribution {
const SCHEMA: &'static str = "RawTurnAttribution";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct RawTurnAttributionRepairRequest {
pub harness_id: String,
pub harness_session_id: String,
pub paper_proxy_request_id: String,
pub parent_harness_session_id: String,
pub raw_turn_id: i64,
pub reason: String,
pub thread_id: String,
}
impl ContractModel for RawTurnAttributionRepairRequest {
const SCHEMA: &'static str = "RawTurnAttributionRepairRequest";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct RawTurnAttributionRepairResult {
#[serde(deserialize_with = "super::null_default")]
pub effective: RawTurnAttribution,
#[serde(deserialize_with = "super::null_default")]
pub previous: RawTurnAttribution,
#[serde(deserialize_with = "super::null_default")]
pub projections_pending: Vec<RepairPendingSession>,
pub recorded: bool,
pub source_cleanup_pending: bool,
}
impl ContractModel for RawTurnAttributionRepairResult {
const SCHEMA: &'static str = "RawTurnAttributionRepairResult";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct RepairPendingSession {
pub harness_id: String,
pub harness_session_id: String,
}
impl ContractModel for RepairPendingSession {
const SCHEMA: &'static str = "RepairPendingSession";
}