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