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