figma_api/models/
inline_object_22.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct InlineObject22 {
16    /// For erroneous requests, this value is always `true`.
17    #[serde(rename = "error")]
18    pub error: Error,
19    /// Status code
20    #[serde(rename = "status")]
21    pub status: Status,
22    /// A string describing the error
23    #[serde(rename = "message")]
24    pub message: String,
25}
26
27impl InlineObject22 {
28    pub fn new(error: Error, status: Status, message: String) -> InlineObject22 {
29        InlineObject22 {
30            error,
31            status,
32            message,
33        }
34    }
35}
36/// For erroneous requests, this value is always `true`.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum Error {
39    #[serde(rename = "true")]
40    True,
41}
42
43impl Default for Error {
44    fn default() -> Error {
45        Self::True
46    }
47}
48/// Status code
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Status {
51    #[serde(rename = "404")]
52    Variant404,
53}
54
55impl Default for Status {
56    fn default() -> Status {
57        Self::Variant404
58    }
59}
60