figma_api/models/
prototype_device.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/// PrototypeDevice : The device used to view a prototype.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PrototypeDevice {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
20    pub size: Option<Box<models::Size>>,
21    #[serde(rename = "presetIdentifier", skip_serializing_if = "Option::is_none")]
22    pub preset_identifier: Option<String>,
23    #[serde(rename = "rotation")]
24    pub rotation: Rotation,
25}
26
27impl PrototypeDevice {
28    /// The device used to view a prototype.
29    pub fn new(r#type: Type, rotation: Rotation) -> PrototypeDevice {
30        PrototypeDevice {
31            r#type,
32            size: None,
33            preset_identifier: None,
34            rotation,
35        }
36    }
37}
38/// 
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum Type {
41    #[serde(rename = "NONE")]
42    None,
43    #[serde(rename = "PRESET")]
44    Preset,
45    #[serde(rename = "CUSTOM")]
46    Custom,
47    #[serde(rename = "PRESENTATION")]
48    Presentation,
49}
50
51impl Default for Type {
52    fn default() -> Type {
53        Self::None
54    }
55}
56/// 
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Rotation {
59    #[serde(rename = "NONE")]
60    None,
61    #[serde(rename = "CCW_90")]
62    Ccw90,
63}
64
65impl Default for Rotation {
66    fn default() -> Rotation {
67        Self::None
68    }
69}
70