figma-api 0.31.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).
Documentation
/*
 * Figma API
 *
 * 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).
 *
 * The version of the OpenAPI document: 0.31.0
 * Contact: support@figma.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum Paint {
    SolidPaint(Box<models::SolidPaint>),
    GradientPaint(Box<models::GradientPaint>),
    ImagePaint(Box<models::ImagePaint>),
    PatternPaint(Box<models::PatternPaint>),
}

impl Default for Paint {
    fn default() -> Self {
        Self::SolidPaint(Default::default())
    }
}
/// The string literal \"SOLID\" representing the paint's type. Always check the `type` before reading other properties.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "SOLID")]
    Solid,
    #[serde(rename = "GRADIENT_LINEAR")]
    GradientLinear,
    #[serde(rename = "GRADIENT_RADIAL")]
    GradientRadial,
    #[serde(rename = "GRADIENT_ANGULAR")]
    GradientAngular,
    #[serde(rename = "GRADIENT_DIAMOND")]
    GradientDiamond,
    #[serde(rename = "IMAGE")]
    Image,
    #[serde(rename = "PATTERN")]
    Pattern,
}

impl Default for Type {
    fn default() -> Type {
        Self::Solid
    }
}
/// Image scaling mode.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ScaleMode {
    #[serde(rename = "FILL")]
    Fill,
    #[serde(rename = "FIT")]
    Fit,
    #[serde(rename = "TILE")]
    Tile,
    #[serde(rename = "STRETCH")]
    Stretch,
}

impl Default for ScaleMode {
    fn default() -> ScaleMode {
        Self::Fill
    }
}
/// The tile type for the pattern
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TileType {
    #[serde(rename = "RECTANGULAR")]
    Rectangular,
    #[serde(rename = "HORIZONTAL_HEXAGONAL")]
    HorizontalHexagonal,
    #[serde(rename = "VERTICAL_HEXAGONAL")]
    VerticalHexagonal,
}

impl Default for TileType {
    fn default() -> TileType {
        Self::Rectangular
    }
}
/// The horizontal alignment for the pattern
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum HorizontalAlignment {
    #[serde(rename = "START")]
    Start,
    #[serde(rename = "CENTER")]
    Center,
    #[serde(rename = "END")]
    End,
}

impl Default for HorizontalAlignment {
    fn default() -> HorizontalAlignment {
        Self::Start
    }
}
/// The vertical alignment for the pattern
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VerticalAlignment {
    #[serde(rename = "START")]
    Start,
    #[serde(rename = "CENTER")]
    Center,
    #[serde(rename = "END")]
    End,
}

impl Default for VerticalAlignment {
    fn default() -> VerticalAlignment {
        Self::Start
    }
}