figma_api/models/
base_blur_effect.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/// BaseBlurEffect : Base properties shared by all blur effects
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BaseBlurEffect {
17    /// A string literal representing the effect's type. Always check the type before reading other properties.
18    #[serde(rename = "type")]
19    pub r#type: Type,
20    /// Whether this blur is active.
21    #[serde(rename = "visible")]
22    pub visible: bool,
23    /// Radius of the blur effect
24    #[serde(rename = "radius")]
25    pub radius: f64,
26    #[serde(rename = "boundVariables", skip_serializing_if = "Option::is_none")]
27    pub bound_variables: Option<Box<models::BaseBlurEffectBoundVariables>>,
28}
29
30impl BaseBlurEffect {
31    /// Base properties shared by all blur effects
32    pub fn new(r#type: Type, visible: bool, radius: f64) -> BaseBlurEffect {
33        BaseBlurEffect {
34            r#type,
35            visible,
36            radius,
37            bound_variables: None,
38        }
39    }
40}
41/// A string literal representing the effect's type. Always check the type before reading other properties.
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Type {
44    #[serde(rename = "LAYER_BLUR")]
45    LayerBlur,
46    #[serde(rename = "BACKGROUND_BLUR")]
47    BackgroundBlur,
48}
49
50impl Default for Type {
51    fn default() -> Type {
52        Self::LayerBlur
53    }
54}
55