figma_api/models/
frame_info.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/// FrameInfo : Data on the frame a component resides in.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FrameInfo {
17    /// The ID of the frame node within the file.
18    #[serde(rename = "nodeId", skip_serializing_if = "Option::is_none")]
19    pub node_id: Option<String>,
20    /// The name of the frame node.
21    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
22    pub name: Option<String>,
23    /// The background color of the frame node.
24    #[serde(rename = "backgroundColor", skip_serializing_if = "Option::is_none")]
25    pub background_color: Option<String>,
26    /// The ID of the page containing the frame node.
27    #[serde(rename = "pageId")]
28    pub page_id: String,
29    /// The name of the page containing the frame node.
30    #[serde(rename = "pageName")]
31    pub page_name: String,
32    #[serde(rename = "containingStateGroup", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub containing_state_group: Option<Option<Box<models::FrameInfoContainingStateGroup>>>,
34    #[serde(rename = "containingComponentSet", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub containing_component_set: Option<Option<Box<models::FrameInfoContainingComponentSet>>>,
36}
37
38impl FrameInfo {
39    /// Data on the frame a component resides in.
40    pub fn new(page_id: String, page_name: String) -> FrameInfo {
41        FrameInfo {
42            node_id: None,
43            name: None,
44            background_color: None,
45            page_id,
46            page_name,
47            containing_state_group: None,
48            containing_component_set: None,
49        }
50    }
51}
52