figma_api/models/
expression_function.rs

1/*
2 * Figma API
3 *
4 * This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api).  Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
5 *
6 * The version of the OpenAPI document: 0.31.0
7 * Contact: support@figma.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ExpressionFunction : Defines the list of operators available to use in an Expression.
15/// Defines the list of operators available to use in an Expression.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum ExpressionFunction {
18    #[serde(rename = "ADDITION")]
19    Addition,
20    #[serde(rename = "SUBTRACTION")]
21    Subtraction,
22    #[serde(rename = "MULTIPLICATION")]
23    Multiplication,
24    #[serde(rename = "DIVISION")]
25    Division,
26    #[serde(rename = "EQUALS")]
27    Equals,
28    #[serde(rename = "NOT_EQUAL")]
29    NotEqual,
30    #[serde(rename = "LESS_THAN")]
31    LessThan,
32    #[serde(rename = "LESS_THAN_OR_EQUAL")]
33    LessThanOrEqual,
34    #[serde(rename = "GREATER_THAN")]
35    GreaterThan,
36    #[serde(rename = "GREATER_THAN_OR_EQUAL")]
37    GreaterThanOrEqual,
38    #[serde(rename = "AND")]
39    And,
40    #[serde(rename = "OR")]
41    Or,
42    #[serde(rename = "VAR_MODE_LOOKUP")]
43    VarModeLookup,
44    #[serde(rename = "NEGATE")]
45    Negate,
46    #[serde(rename = "NOT")]
47    Not,
48
49}
50
51impl std::fmt::Display for ExpressionFunction {
52    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
53        match self {
54            Self::Addition => write!(f, "ADDITION"),
55            Self::Subtraction => write!(f, "SUBTRACTION"),
56            Self::Multiplication => write!(f, "MULTIPLICATION"),
57            Self::Division => write!(f, "DIVISION"),
58            Self::Equals => write!(f, "EQUALS"),
59            Self::NotEqual => write!(f, "NOT_EQUAL"),
60            Self::LessThan => write!(f, "LESS_THAN"),
61            Self::LessThanOrEqual => write!(f, "LESS_THAN_OR_EQUAL"),
62            Self::GreaterThan => write!(f, "GREATER_THAN"),
63            Self::GreaterThanOrEqual => write!(f, "GREATER_THAN_OR_EQUAL"),
64            Self::And => write!(f, "AND"),
65            Self::Or => write!(f, "OR"),
66            Self::VarModeLookup => write!(f, "VAR_MODE_LOOKUP"),
67            Self::Negate => write!(f, "NEGATE"),
68            Self::Not => write!(f, "NOT"),
69        }
70    }
71}
72
73impl Default for ExpressionFunction {
74    fn default() -> ExpressionFunction {
75        Self::Addition
76    }
77}
78