mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-23 07:58:05 +01:00
26 lines
509 B
Rust
26 lines
509 B
Rust
|
use serde::Serialize;
|
||
|
use validator::Validate;
|
||
|
|
||
|
#[derive(Clone, Debug, Serialize)]
|
||
|
pub enum ImageSize {
|
||
|
Large,
|
||
|
Preview,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, Validate, Debug, Serialize)]
|
||
|
pub struct Image {
|
||
|
#[validate(length(min = 1, max = 512))]
|
||
|
pub url: String,
|
||
|
pub width: isize,
|
||
|
pub height: isize,
|
||
|
pub size: ImageSize,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, Validate, Debug, Serialize)]
|
||
|
pub struct Video {
|
||
|
#[validate(length(min = 1, max = 512))]
|
||
|
pub url: String,
|
||
|
pub width: isize,
|
||
|
pub height: isize,
|
||
|
}
|