line_bot_sdk_messaging_api/models/flex_offset.rs
1/*
2 * LINE Messaging API
3 *
4 * This document describes LINE Messaging API.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// FlexOffset : You can specify the offset of a component with the `offset*` property, in pixels or with a keyword. You can also specify the percentage to the box width for `offsetStart` and `offsetEnd` and to the box height for `offsetTop` and `offsetBottom`. FlexOffset just provides only keywords.
15/// You can specify the offset of a component with the `offset*` property, in pixels or with a keyword. You can also specify the percentage to the box width for `offsetStart` and `offsetEnd` and to the box height for `offsetTop` and `offsetBottom`. FlexOffset just provides only keywords.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum FlexOffset {
18 #[serde(rename = "none")]
19 None,
20 #[serde(rename = "xs")]
21 Xs,
22 #[serde(rename = "sm")]
23 Sm,
24 #[serde(rename = "md")]
25 Md,
26 #[serde(rename = "lg")]
27 Lg,
28 #[serde(rename = "xl")]
29 Xl,
30 #[serde(rename = "xxl")]
31 Xxl,
32}
33
34impl std::fmt::Display for FlexOffset {
35 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
36 match self {
37 Self::None => write!(f, "none"),
38 Self::Xs => write!(f, "xs"),
39 Self::Sm => write!(f, "sm"),
40 Self::Md => write!(f, "md"),
41 Self::Lg => write!(f, "lg"),
42 Self::Xl => write!(f, "xl"),
43 Self::Xxl => write!(f, "xxl"),
44 }
45 }
46}
47
48impl Default for FlexOffset {
49 fn default() -> FlexOffset {
50 Self::None
51 }
52}