open_api_hydra/models/generic_error.rs
1/*
2 * ORY Hydra
3 *
4 * Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// GenericError : Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred.
12
13
14
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GenericError {
17 /// Debug contains debug information. This is usually not available and has to be enabled.
18 #[serde(rename = "debug", skip_serializing_if = "Option::is_none")]
19 pub debug: Option<String>,
20 /// Name is the error name.
21 #[serde(rename = "error")]
22 pub error: String,
23 /// Description contains further information on the nature of the error.
24 #[serde(rename = "error_description", skip_serializing_if = "Option::is_none")]
25 pub error_description: Option<String>,
26 /// Code represents the error status code (404, 403, 401, ...).
27 #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")]
28 pub status_code: Option<i64>,
29}
30
31impl GenericError {
32 /// Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred.
33 pub fn new(error: String) -> GenericError {
34 GenericError {
35 debug: None,
36 error,
37 error_description: None,
38 status_code: None,
39 }
40 }
41}
42
43