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::common;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IntervalsMatch {
    /// If `true`, matching terms must appear in their specified order.
    #[serde(rename = "ordered", default, skip_serializing_if = "Option::is_none")]
    pub ordered: Option<bool>,
    /// Maximum number of positions between the matching terms.
    /// Terms further apart than this are not considered matches.
    #[serde(rename = "max_gaps", default, skip_serializing_if = "Option::is_none")]
    pub max_gaps: Option<u32>,
    #[serde(rename = "filter", default, skip_serializing_if = "Option::is_none")]
    pub filter: Option<Box<common::query_dsl::IntervalsFilter>>,
    /// The path to a field or an array of paths. Some APIs support wildcards in the path, which allows you to select multiple fields.
    #[serde(rename = "use_field", default, skip_serializing_if = "Option::is_none")]
    pub use_field: Option<String>,
    /// Analyzer used to analyze terms in the query.
    #[serde(rename = "analyzer", default, skip_serializing_if = "Option::is_none")]
    pub analyzer: Option<String>,
    /// Text you wish to find in the provided field.
    #[serde(rename = "query")]
    pub query: String,
}

impl IntervalsMatch {
    pub fn new(query: String) -> IntervalsMatch {
        IntervalsMatch {
            ordered: None,
            max_gaps: None,
            filter: None,
            use_field: None,
            analyzer: None,
            query,
        }
    }
}