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




#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DocumentSimulation {
    #[serde(rename = "_index")]
    pub index: String,  /// Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures
  /// this behavior while keeping the semantics of the field type.
  /// 
  /// Depending on the target language, code generators can keep the union or remove it and leniently parse
  /// strings to the target type.
    #[serde(rename = "_version", default, skip_serializing_if = "Option::is_none")]
    pub version: Option<common::StringifiedVersionNumber>,  /// Value used to send the document to a specific primary shard.
    #[serde(rename = "_routing", default, skip_serializing_if = "Option::is_none")]
    pub routing: Option<String>,
    #[serde(rename = "_version_type", default, skip_serializing_if = "Option::is_none")]
    pub version_type: Option<String>,
    #[serde(rename = "_ingest")]
    pub ingest: ingest::simulate::Ingest,
    #[serde(rename = "_id")]
    pub id: String,  /// JSON body for the document.
    #[serde(rename = "_source")]
    pub source: serde_json::Value,
}

impl DocumentSimulation {
    
    pub fn new(index: String, ingest: ingest::simulate::Ingest, id: String, source: serde_json::Value) -> DocumentSimulation {
        DocumentSimulation {
            index,
            version: None,
            routing: None,
            version_type: None,
            ingest,
            id,
            source,
        }
    }
}