figma_api/models/
role.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/// Role : The role of the user making the API request in relation to the file.
15/// The role of the user making the API request in relation to the file.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum Role {
18    #[serde(rename = "owner")]
19    Owner,
20    #[serde(rename = "editor")]
21    Editor,
22    #[serde(rename = "viewer")]
23    Viewer,
24
25}
26
27impl std::fmt::Display for Role {
28    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29        match self {
30            Self::Owner => write!(f, "owner"),
31            Self::Editor => write!(f, "editor"),
32            Self::Viewer => write!(f, "viewer"),
33        }
34    }
35}
36
37impl Default for Role {
38    fn default() -> Role {
39        Self::Owner
40    }
41}
42