Skip to main content

naurt_api/models/
error_response.rs

1/*
2 * Naurt API
3 *
4 * OpenAPI specification for Naurt's APIs. 
5 *
6 * The version of the OpenAPI document: 0.1.2
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ErrorResponse : All Naurt errors come in this standard format.   `code` is a unique error code you can quote to support, should you need to  `reason` explains why this error has been received  `remediation` gives steps to help resolve this error 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ErrorResponse {
17    #[serde(rename = "code")]
18    pub code: String,
19    #[serde(rename = "reason")]
20    pub reason: String,
21    #[serde(rename = "remediation")]
22    pub remediation: String,
23}
24
25impl ErrorResponse {
26    /// All Naurt errors come in this standard format.   `code` is a unique error code you can quote to support, should you need to  `reason` explains why this error has been received  `remediation` gives steps to help resolve this error 
27    pub fn new(code: String, reason: String, remediation: String) -> ErrorResponse {
28        ErrorResponse {
29            code,
30            reason,
31            remediation,
32        }
33    }
34}
35