opensearch-client 0.3.2

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

/// Term
/// Term to match the query.

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Term {
    /// The function name.
    #[serde(
        rename = "function_name",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub function_name: Option<String>,
    /// The type.
    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
    pub r#type: Option<ml::Type>,
    /// The algorithm.
    #[serde(rename = "algorithm", default, skip_serializing_if = "Option::is_none")]
    pub algorithm: Option<ml::Algorithm>,
    /// The owner name keyword.
    #[serde(rename = "name", default, skip_serializing_if = "Option::is_none")]
    pub name: Option<ml::OwnerNameKeyword>,
    /// The owner name keyword.
    #[serde(
        rename = "owner.name.keyword",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub owner_name_keyword: Option<ml::OwnerNameKeyword>,
    #[serde(rename = "model_id", default, skip_serializing_if = "Option::is_none")]
    pub model_id: Option<String>,
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<Vec<String>>,
}

impl Term {
    /// Term to match the query.
    pub fn new() -> Term {
        Term {
            function_name: None,
            r#type: None,
            algorithm: None,
            name: None,
            owner_name_keyword: None,
            model_id: None,
            id: None,
        }
    }
}