Skip to main content

opensearch_client/common/
error_cause_value.rs

1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use crate::common;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ErrorCauseValue {
16    #[serde(rename = "caused_by", default, skip_serializing_if = "Option::is_none")]
17    pub caused_by: Option<common::ErrorCause>,
18    #[serde(
19        rename = "suppressed",
20        default,
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub suppressed: Option<Vec<common::ErrorCause>>,
24    /// A human-readable explanation of the error, in English.
25    #[serde(rename = "reason", default, skip_serializing_if = "Option::is_none")]
26    pub reason: Option<String>,
27    #[serde(
28        rename = "root_cause",
29        default,
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub root_cause: Option<Vec<common::ErrorCause>>,
33    /// The server stack trace, present only if the `error_trace=true` parameter was sent with the request.
34    #[serde(
35        rename = "stack_trace",
36        default,
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub stack_trace: Option<String>,
40    /// The type of error.
41    #[serde(rename = "type")]
42    pub r#type: String,
43}
44
45impl ErrorCauseValue {
46    pub fn new(r#type: String) -> ErrorCauseValue {
47        ErrorCauseValue {
48            caused_by: None,
49            suppressed: None,
50            reason: None,
51            root_cause: None,
52            stack_trace: None,
53            r#type,
54        }
55    }
56}