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};

/// SearchTemplate
/// The search definition template and its parameters.


#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SearchTemplate {  /// Key-value pairs used to replace Mustache variables in the template.
  /// The key is the variable name.
  /// The value is the variable value.
    #[serde(rename = "params", default, skip_serializing_if = "Option::is_none")]
    pub params: Option<serde_json::Value>,  /// If `true`, returns detailed information about score calculation as part of each hit.
    #[serde(rename = "explain", default, skip_serializing_if = "Option::is_none")]
    pub explain: Option<bool>,
    #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,  /// If `true`, the query execution is profiled.
    #[serde(rename = "profile", default, skip_serializing_if = "Option::is_none")]
    pub profile: Option<bool>,  /// An inline search template. Supports the same parameters as the search API
  /// request body. Also supports Mustache variables. If no id is specified, this
  /// parameter is required.
    #[serde(rename = "source", default, skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
}

impl SearchTemplate {
      /// The search definition template and its parameters.
    pub fn new() -> SearchTemplate {
        SearchTemplate {
            params: None,
            explain: None,
            id: None,
            profile: None,
            source: None,
        }
    }
}