client-api: Allow custom values for get_content_thumbnail::Method

This commit is contained in:
Jonas Platte 2020-12-24 02:29:38 +01:00
parent 48348edc7e
commit 132a7b86ec
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

View File

@ -3,17 +3,20 @@
use js_int::UInt; use js_int::UInt;
use ruma_api::ruma_api; use ruma_api::ruma_api;
use ruma_identifiers::ServerName; use ruma_identifiers::ServerName;
use serde::{Deserialize, Serialize}; use ruma_serde::StringEnum;
/// The desired resizing method. /// The desired resizing method.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, StringEnum)]
#[serde(rename_all = "snake_case")] #[ruma_enum(rename_all = "snake_case")]
pub enum Method { pub enum Method {
/// Crop the original to produce the requested image dimensions. /// Crop the original to produce the requested image dimensions.
Crop, Crop,
/// Maintain the original aspect ratio of the source image. /// Maintain the original aspect ratio of the source image.
Scale, Scale,
#[doc(hidden)]
_Custom(String),
} }
ruma_api! { ruma_api! {