lance_namespace_reqwest_client/models/
error_response.rs

1/*
2 * Lance Namespace Specification
3 *
4 * This OpenAPI specification is a part of the Lance namespace specification. It contains 2 parts:  The `components/schemas`, `components/responses`, `components/examples`, `tags` sections define the request and response shape for each operation in a Lance Namespace across all implementations. See https://lancedb.github.io/lance-namespace/spec/operations for more details.  The `servers`, `security`, `paths`, `components/parameters` sections are for the  Lance REST Namespace implementation, which defines a complete REST server that can work with Lance datasets. See https://lancedb.github.io/lance-namespace/spec/impls/rest for more details. 
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ErrorResponse : Common JSON error response model
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ErrorResponse {
17    /// a brief, human-readable message about the error
18    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
19    pub error: Option<String>,
20    /// HTTP style response code, where 4XX represents client side errors  and 5XX represents server side errors.  For implementations that uses HTTP (e.g. REST namespace), this field can be optional in favor of the HTTP response status code. In case both values exist and do not match, the HTTP response status code should be used. 
21    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
22    pub code: Option<i32>,
23    /// An optional type identifier string for the error. This allows the implementation to specify their internal error type, which could be more detailed than the HTTP standard status code. 
24    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
25    pub r#type: Option<String>,
26    /// an optional human-readable explanation of the error. This can be used to record information such as stack trace. 
27    #[serde(rename = "detail", skip_serializing_if = "Option::is_none")]
28    pub detail: Option<String>,
29    /// a string that identifies the specific occurrence of the error. This can be a URI, a request or response ID,  or anything that the implementation can recognize to trace specific occurrence of the error. 
30    #[serde(rename = "instance", skip_serializing_if = "Option::is_none")]
31    pub instance: Option<String>,
32}
33
34impl ErrorResponse {
35    /// Common JSON error response model
36    pub fn new() -> ErrorResponse {
37        ErrorResponse {
38            error: None,
39            code: None,
40            r#type: None,
41            detail: None,
42            instance: None,
43        }
44    }
45}
46