figma_api/models/navigation.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/// Navigation : The method of navigation. The possible values are: - `\"NAVIGATE\"`: Replaces the current screen with the destination, also closing all overlays. - `\"OVERLAY\"`: Opens the destination as an overlay on the current screen. - `\"SWAP\"`: On an overlay, replaces the current (topmost) overlay with the destination. On a top-level frame, behaves the same as `\"NAVIGATE\"` except that no entry is added to the navigation history. - `\"SCROLL_TO\"`: Scrolls to the destination on the current screen. - `\"CHANGE_TO\"`: Changes the closest ancestor instance of source node to the specified variant.
15/// The method of navigation. The possible values are: - `\"NAVIGATE\"`: Replaces the current screen with the destination, also closing all overlays. - `\"OVERLAY\"`: Opens the destination as an overlay on the current screen. - `\"SWAP\"`: On an overlay, replaces the current (topmost) overlay with the destination. On a top-level frame, behaves the same as `\"NAVIGATE\"` except that no entry is added to the navigation history. - `\"SCROLL_TO\"`: Scrolls to the destination on the current screen. - `\"CHANGE_TO\"`: Changes the closest ancestor instance of source node to the specified variant.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum Navigation {
18 #[serde(rename = "NAVIGATE")]
19 Navigate,
20 #[serde(rename = "SWAP")]
21 Swap,
22 #[serde(rename = "OVERLAY")]
23 Overlay,
24 #[serde(rename = "SCROLL_TO")]
25 ScrollTo,
26 #[serde(rename = "CHANGE_TO")]
27 ChangeTo,
28
29}
30
31impl std::fmt::Display for Navigation {
32 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33 match self {
34 Self::Navigate => write!(f, "NAVIGATE"),
35 Self::Swap => write!(f, "SWAP"),
36 Self::Overlay => write!(f, "OVERLAY"),
37 Self::ScrollTo => write!(f, "SCROLL_TO"),
38 Self::ChangeTo => write!(f, "CHANGE_TO"),
39 }
40 }
41}
42
43impl Default for Navigation {
44 fn default() -> Navigation {
45 Self::Navigate
46 }
47}
48