opensearch-client 0.3.1

Strongly typed OpenSearch Client
Documentation
/*
 * opensearch-client
 *
 * Rust Client for OpenSearch
 *
 * The version of the OpenAPI document: 3.1.0
 * Contact: alberto.paro@gmail.com
 * Generated by Paro OpenAPI Generator
 */

use crate::ml;
use serde::{Deserialize, Serialize};

/// BoolQuery
/// The Boolean query.

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BoolQuery {
    /// The filter element.
    #[serde(rename = "must_not", default, skip_serializing_if = "Option::is_none")]
    pub must_not: Option<Box<ml::Filter>>,
    /// Query that should appear in matching documents.
    #[serde(rename = "should", default, skip_serializing_if = "Option::is_none")]
    pub should: Option<Vec<ml::Filter>>,
    /// Query that must appears in matching documents
    #[serde(rename = "must", default, skip_serializing_if = "Option::is_none")]
    pub must: Option<Vec<ml::Filter>>,
    /// Filter query that appears in matching documents.
    #[serde(rename = "filter", default, skip_serializing_if = "Option::is_none")]
    pub filter: Option<Vec<ml::Filter>>,
}

impl BoolQuery {
    /// The Boolean query.
    pub fn new() -> BoolQuery {
        BoolQuery {
            must_not: None,
            should: None,
            must: None,
            filter: None,
        }
    }
}