ruma_client_api/media/
create_mxc_uri.rs1pub mod v1 {
6    use ruma_common::{
11        api::{request, response, Metadata},
12        metadata, MilliSecondsSinceUnixEpoch, OwnedMxcUri,
13    };
14
15    const METADATA: Metadata = metadata! {
16        method: POST,
17        rate_limited: true,
18        authentication: AccessToken,
19        history: {
20            unstable => "/_matrix/media/unstable/fi.mau.msc2246/create",
21            1.7 => "/_matrix/media/v1/create",
22        }
23    };
24
25    #[request(error = crate::Error)]
27    #[derive(Default)]
28    pub struct Request {}
29
30    #[response(error = crate::Error)]
32    pub struct Response {
33        pub content_uri: OwnedMxcUri,
35
36        #[serde(skip_serializing_if = "Option::is_none")]
38        pub unused_expires_at: Option<MilliSecondsSinceUnixEpoch>,
39    }
40
41    impl Response {
42        pub fn new(content_uri: OwnedMxcUri) -> Self {
44            Self { content_uri, unused_expires_at: None }
45        }
46    }
47}