manticoresearch 2.0.0

Сlient for Manticore Search.
Documentation
/*
 * Manticore Search Client
 *
 * Сlient for Manticore Search. 
 *
 * The version of the OpenAPI document: 5.0.0
 * Contact: info@manticoresearch.com
 * Generated by: https://openapi-generator.tech
 */

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

/// InsertDocumentRequest : Object containing data for inserting a new document into the table 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InsertDocumentRequest {
    /// Name of the table to insert the document into
    #[serde(rename = "table")]
    pub table: String,
    /// Name of the cluster to insert the document into
    #[serde(rename = "cluster", skip_serializing_if = "Option::is_none")]
    pub cluster: Option<String>,
    /// Document ID. If not provided, an ID will be auto-generated 
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<u64>,
    /// Object containing document data 
    #[serde(rename = "doc")]
    pub doc: serde_json::Value,
}

impl InsertDocumentRequest {
    /// Object containing data for inserting a new document into the table 
    pub fn new(table: String, doc: serde_json::Value) -> InsertDocumentRequest {
        InsertDocumentRequest {
            table,
            cluster: None,
            id: None,
            doc,
        }
    }
}