parent
ed508c043e
commit
052b3a199d
34
src/r0/media/get_media_preview.rs
Normal file
34
src/r0/media/get_media_preview.rs
Normal file
@ -0,0 +1,34 @@
|
||||
//! [GET /_matrix/media/r0/preview_url](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-media-r0-preview-url)
|
||||
|
||||
use js_int::UInt;
|
||||
use ruma_api::ruma_api;
|
||||
use serde_json::Value;
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
description: "Get a preview for a URL.",
|
||||
name: "get_media_preview",
|
||||
method: GET,
|
||||
path: "/_matrix/media/r0/preview_url",
|
||||
rate_limited: true,
|
||||
requires_authentication: true,
|
||||
}
|
||||
|
||||
request {
|
||||
/// URL to get a preview of.
|
||||
#[ruma_api(query)]
|
||||
url: String,
|
||||
/// Preferred point in time (in milliseconds) to return a preview for.
|
||||
#[ruma_api(query)]
|
||||
ts: UInt,
|
||||
}
|
||||
|
||||
response {
|
||||
/// OpenGraph-like data for the URL.
|
||||
///
|
||||
/// Differences from OpenGraph: the image size in bytes is added to the `matrix:image:size`
|
||||
/// field, and `og:image` returns the MXC URI to the image, if any.
|
||||
#[ruma_api(body)]
|
||||
data: Option<Value>,
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user