1use neptunium_model::time::duration::{Duration, representation::Seconds};
2use serde::Deserialize;
3
4use crate::error::{error_code::ApiErrorCode, validation_error_code::ApiValidationErrorCode};
5
6pub mod error_code;
7pub mod validation_error_code;
8
9#[derive(Deserialize, Clone, Debug)]
10pub struct ApiErrorEntry {
11 pub path: String,
12 pub message: String,
13 pub code: ApiValidationErrorCode,
14}
15
16#[derive(Deserialize, Clone, Debug)]
17pub struct ApiErrorResponse {
18 pub code: ApiErrorCode,
19 pub message: String,
23 #[serde(default = "Vec::new")]
24 pub errors: Vec<ApiErrorEntry>,
25}
26
27#[derive(Deserialize, Clone, Debug)]
28pub struct ApiRateLimitedResponse {
29 pub code: ApiErrorCode,
31 pub message: String,
32 pub retry_after: Duration<Seconds>,
33 pub global: bool,
34}