figma_api/models/
comment_client_meta.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/// CommentClientMeta : Positioning information of the comment. Includes information on the location of the comment pin, which is either the absolute coordinates on the canvas or a relative offset within a frame. If the comment is a region, it will also contain the region height, width, and position of the anchor in regards to the region.
15/// Positioning information of the comment. Includes information on the location of the comment pin, which is either the absolute coordinates on the canvas or a relative offset within a frame. If the comment is a region, it will also contain the region height, width, and position of the anchor in regards to the region.
16#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
17#[serde(untagged)]
18pub enum CommentClientMeta {
19    Vector(Box<models::Vector>),
20    FrameOffset(Box<models::FrameOffset>),
21    Region(Box<models::Region>),
22    FrameOffsetRegion(Box<models::FrameOffsetRegion>),
23}
24
25impl Default for CommentClientMeta {
26    fn default() -> Self {
27        Self::Vector(Default::default())
28    }
29}
30/// The corner of the comment region to pin to the node's corner as a string enum.
31#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
32pub enum CommentPinCorner {
33    #[serde(rename = "top-left")]
34    TopLeft,
35    #[serde(rename = "top-right")]
36    TopRight,
37    #[serde(rename = "bottom-left")]
38    BottomLeft,
39    #[serde(rename = "bottom-right")]
40    BottomRight,
41}
42
43impl Default for CommentPinCorner {
44    fn default() -> CommentPinCorner {
45        Self::TopLeft
46    }
47}
48