diff --git a/crates/ruma-client-api/src/media/create_mxc_uri.rs b/crates/ruma-client-api/src/media/create_mxc_uri.rs index a350a806..a470f344 100644 --- a/crates/ruma-client-api/src/media/create_mxc_uri.rs +++ b/crates/ruma-client-api/src/media/create_mxc_uri.rs @@ -7,10 +7,9 @@ pub mod unstable { //! //! [spec]: https://github.com/tulir/matrix-doc/blob/asynchronous_uploads/proposals/2246-asynchronous-uploads.md - use js_int::UInt; use ruma_common::{ api::{request, response, Metadata}, - metadata, OwnedMxcUri, + metadata, MilliSecondsSinceUnixEpoch, OwnedMxcUri, }; const METADATA: Metadata = metadata! { @@ -34,13 +33,14 @@ pub mod unstable { pub content_uri: OwnedMxcUri, /// The time at which the URI will expire if an upload has not been started. - pub unused_expires_at: UInt, + #[serde(skip_serializing_if = "Option::is_none")] + pub unused_expires_at: Option, } impl Response { - /// Creates a new `Response` with the given MXC URI which expires at a given point in time. - pub fn new(content_uri: OwnedMxcUri, unused_expires_at: UInt) -> Self { - Self { content_uri, unused_expires_at } + /// Creates a new `Response` with the given MXC URI. + pub fn new(content_uri: OwnedMxcUri) -> Self { + Self { content_uri, unused_expires_at: None } } } }