1use crate::api::endpoints::PathPart;
4use chrono::{DateTime, Utc};
5use macros::make_path_parts;
6use serde::{Deserialize, Serialize};
7use url::Url;
8use uuid::Uuid;
9
10use crate::media::MediaKind;
11
12make_path_parts!(MediaCreatePath => "/v1/media/image/url");
13
14#[derive(Serialize, Deserialize, Debug)]
16pub struct UrlCreatedResponse {
17 pub id: Uuid,
19
20 pub kind: MediaKind,
22}
23
24#[derive(Serialize, Deserialize, Debug)]
26pub struct WebMediaUrlCreateRequest {
27 pub url: Url,
29}
30
31make_path_parts!(MediaUrlGetPath => "/v1/media/url/{}" => Url);
32
33make_path_parts!(MediaIdGetPath => "/v1/media/id/{}" => Uuid);
34
35#[derive(Serialize, Deserialize, Debug)]
37pub struct WebMediaMetadataResponse {
38 pub id: Uuid,
40
41 pub kind: MediaKind,
43
44 pub urls: Vec<Url>,
46
47 pub created_at: DateTime<Utc>,
49
50 pub updated_at: Option<DateTime<Utc>>,
52}
53
54make_path_parts!(MediaUrlDeletePath => "/v1/media/url/{}" => Url);
55
56make_path_parts!(MediaIdDeletePath => "/v1/media/id/{}" => Uuid);