Skip to main content

opensearch_client/indices/
validate_query_response.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 crate::indices;
13use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ValidateQueryResponse {
17    #[serde(rename = "error", default, skip_serializing_if = "Option::is_none")]
18    pub error: Option<String>,
19    #[serde(
20        rename = "explanations",
21        default,
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub explanations: Option<Vec<indices::validate_query::IndicesValidationExplanation>>,
25    #[serde(rename = "valid")]
26    pub valid: bool,
27    #[serde(rename = "_shards", default, skip_serializing_if = "Option::is_none")]
28    pub shards: Option<common::ShardStatistics>,
29}
30
31impl ValidateQueryResponse {
32    pub fn new(valid: bool) -> ValidateQueryResponse {
33        ValidateQueryResponse {
34            error: None,
35            explanations: None,
36            valid,
37            shards: None,
38        }
39    }
40}