figma_api/models/
progressive_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 ProgressiveBlurEffect {
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 'PROGRESSIVE' representing the blur type. Always check the blurType before reading other properties.
28    #[serde(rename = "blurType")]
29    pub blur_type: BlurType,
30    /// The starting radius of the progressive blur
31    #[serde(rename = "startRadius")]
32    pub start_radius: f64,
33    /// The starting offset of the progressive blur
34    #[serde(rename = "startOffset")]
35    pub start_offset: Box<models::Vector>,
36    /// The ending offset of the progressive blur
37    #[serde(rename = "endOffset")]
38    pub end_offset: Box<models::Vector>,
39}
40
41impl ProgressiveBlurEffect {
42    pub fn new(r#type: Type, visible: bool, radius: f64, blur_type: BlurType, start_radius: f64, start_offset: models::Vector, end_offset: models::Vector) -> ProgressiveBlurEffect {
43        ProgressiveBlurEffect {
44            r#type,
45            visible,
46            radius,
47            bound_variables: None,
48            blur_type,
49            start_radius,
50            start_offset: Box::new(start_offset),
51            end_offset: Box::new(end_offset),
52        }
53    }
54}
55/// A string literal representing the effect's type. Always check the type before reading other properties.
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum Type {
58    #[serde(rename = "LAYER_BLUR")]
59    LayerBlur,
60    #[serde(rename = "BACKGROUND_BLUR")]
61    BackgroundBlur,
62}
63
64impl Default for Type {
65    fn default() -> Type {
66        Self::LayerBlur
67    }
68}
69/// The string literal 'PROGRESSIVE' representing the blur type. Always check the blurType before reading other properties.
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum BlurType {
72    #[serde(rename = "PROGRESSIVE")]
73    Progressive,
74}
75
76impl Default for BlurType {
77    fn default() -> BlurType {
78        Self::Progressive
79    }
80}
81