figma_api/models/
connector_text_background.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 ConnectorTextBackground {
16    /// Radius of each corner if a single radius is set for all corners
17    #[serde(rename = "cornerRadius", skip_serializing_if = "Option::is_none")]
18    pub corner_radius: Option<f64>,
19    /// A value that lets you control how \"smooth\" the corners are. Ranges from 0 to 1. 0 is the default and means that the corner is perfectly circular. A value of 0.6 means the corner matches the iOS 7 \"squircle\" icon shape. Other values produce various other curves.
20    #[serde(rename = "cornerSmoothing", skip_serializing_if = "Option::is_none")]
21    pub corner_smoothing: Option<f64>,
22    /// Array of length 4 of the radius of each corner of the frame, starting in the top left and proceeding clockwise.  Values are given in the order top-left, top-right, bottom-right, bottom-left.
23    #[serde(rename = "rectangleCornerRadii", skip_serializing_if = "Option::is_none")]
24    pub rectangle_corner_radii: Option<Vec<f64>>,
25    /// An array of fill paints applied to the node.
26    #[serde(rename = "fills")]
27    pub fills: Vec<models::Paint>,
28    /// A mapping of a StyleType to style ID (see Style) of styles present on this node. The style ID can be used to look up more information about the style in the top-level styles field.
29    #[serde(rename = "styles", skip_serializing_if = "Option::is_none")]
30    pub styles: Option<std::collections::HashMap<String, String>>,
31}
32
33impl ConnectorTextBackground {
34    pub fn new(fills: Vec<models::Paint>) -> ConnectorTextBackground {
35        ConnectorTextBackground {
36            corner_radius: None,
37            corner_smoothing: None,
38            rectangle_corner_radii: None,
39            fills,
40            styles: None,
41        }
42    }
43}
44