1use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
10pub struct Data {
11 pub id: String,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
17#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
18pub struct BatchCancelledWebhookEvent {
19 pub id: String,
21 pub created_at: i64,
23 pub data: Data,
25 #[serde(rename = "type")]
27 pub type_: String,
28 #[serde(skip_serializing_if = "Option::is_none", default)]
30 pub object: Option<String>,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize)]
35#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
36pub struct BatchCompletedWebhookEvent {
37 pub id: String,
39 pub created_at: i64,
41 pub data: Data,
43 #[serde(rename = "type")]
45 pub type_: String,
46 #[serde(skip_serializing_if = "Option::is_none", default)]
48 pub object: Option<String>,
49}
50
51#[derive(Debug, Clone, Serialize, Deserialize)]
53#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
54pub struct BatchExpiredWebhookEvent {
55 pub id: String,
57 pub created_at: i64,
59 pub data: Data,
61 #[serde(rename = "type")]
63 pub type_: String,
64 #[serde(skip_serializing_if = "Option::is_none", default)]
66 pub object: Option<String>,
67}
68
69#[derive(Debug, Clone, Serialize, Deserialize)]
71#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
72pub struct BatchFailedWebhookEvent {
73 pub id: String,
75 pub created_at: i64,
77 pub data: Data,
79 #[serde(rename = "type")]
81 pub type_: String,
82 #[serde(skip_serializing_if = "Option::is_none", default)]
84 pub object: Option<String>,
85}
86
87#[derive(Debug, Clone, Serialize, Deserialize)]
89#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
90pub struct EvalRunCanceledWebhookEvent {
91 pub id: String,
93 pub created_at: i64,
95 pub data: Data,
97 #[serde(rename = "type")]
99 pub type_: String,
100 #[serde(skip_serializing_if = "Option::is_none", default)]
102 pub object: Option<String>,
103}
104
105#[derive(Debug, Clone, Serialize, Deserialize)]
107#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
108pub struct EvalRunFailedWebhookEvent {
109 pub id: String,
111 pub created_at: i64,
113 pub data: Data,
115 #[serde(rename = "type")]
117 pub type_: String,
118 #[serde(skip_serializing_if = "Option::is_none", default)]
120 pub object: Option<String>,
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
126pub struct EvalRunSucceededWebhookEvent {
127 pub id: String,
129 pub created_at: i64,
131 pub data: Data,
133 #[serde(rename = "type")]
135 pub type_: String,
136 #[serde(skip_serializing_if = "Option::is_none", default)]
138 pub object: Option<String>,
139}
140
141#[derive(Debug, Clone, Serialize, Deserialize)]
143#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
144pub struct FineTuningJobCancelledWebhookEvent {
145 pub id: String,
147 pub created_at: i64,
149 pub data: Data,
151 #[serde(rename = "type")]
153 pub type_: String,
154 #[serde(skip_serializing_if = "Option::is_none", default)]
156 pub object: Option<String>,
157}
158
159#[derive(Debug, Clone, Serialize, Deserialize)]
161#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
162pub struct FineTuningJobFailedWebhookEvent {
163 pub id: String,
165 pub created_at: i64,
167 pub data: Data,
169 #[serde(rename = "type")]
171 pub type_: String,
172 #[serde(skip_serializing_if = "Option::is_none", default)]
174 pub object: Option<String>,
175}
176
177#[derive(Debug, Clone, Serialize, Deserialize)]
179#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
180pub struct FineTuningJobSucceededWebhookEvent {
181 pub id: String,
183 pub created_at: i64,
185 pub data: Data,
187 #[serde(rename = "type")]
189 pub type_: String,
190 #[serde(skip_serializing_if = "Option::is_none", default)]
192 pub object: Option<String>,
193}
194
195#[derive(Debug, Clone, Serialize, Deserialize)]
197#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
198pub struct DataSipHeader {
199 pub name: String,
201 pub value: String,
203}
204
205#[derive(Debug, Clone, Serialize, Deserialize)]
207#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
208pub struct RealtimeCallIncomingWebhookEvent {
209 pub id: String,
211 pub created_at: i64,
213 pub data: Data,
215 #[serde(rename = "type")]
217 pub type_: String,
218 #[serde(skip_serializing_if = "Option::is_none", default)]
220 pub object: Option<String>,
221}
222
223#[derive(Debug, Clone, Serialize, Deserialize)]
225#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
226pub struct ResponseCancelledWebhookEvent {
227 pub id: String,
229 pub created_at: i64,
231 pub data: Data,
233 #[serde(rename = "type")]
235 pub type_: String,
236 #[serde(skip_serializing_if = "Option::is_none", default)]
238 pub object: Option<String>,
239}
240
241#[derive(Debug, Clone, Serialize, Deserialize)]
243#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
244pub struct ResponseCompletedWebhookEvent {
245 pub id: String,
247 pub created_at: i64,
249 pub data: Data,
251 #[serde(rename = "type")]
253 pub type_: String,
254 #[serde(skip_serializing_if = "Option::is_none", default)]
256 pub object: Option<String>,
257}
258
259#[derive(Debug, Clone, Serialize, Deserialize)]
261#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
262pub struct ResponseFailedWebhookEvent {
263 pub id: String,
265 pub created_at: i64,
267 pub data: Data,
269 #[serde(rename = "type")]
271 pub type_: String,
272 #[serde(skip_serializing_if = "Option::is_none", default)]
274 pub object: Option<String>,
275}
276
277#[derive(Debug, Clone, Serialize, Deserialize)]
279#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
280pub struct ResponseIncompleteWebhookEvent {
281 pub id: String,
283 pub created_at: i64,
285 pub data: Data,
287 #[serde(rename = "type")]
289 pub type_: String,
290 #[serde(skip_serializing_if = "Option::is_none", default)]
292 pub object: Option<String>,
293}
294
295pub type UnwrapWebhookEvent = serde_json::Value;