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

/// UpdateDocumentRequest : Payload for updating a document or multiple documents in a table
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateDocumentRequest {
    /// Name of the document table
    #[serde(rename = "table")]
    pub table: String,
    /// Name of the document cluster
    #[serde(rename = "cluster", skip_serializing_if = "Option::is_none")]
    pub cluster: Option<String>,
    /// Object containing the document fields to update
    #[serde(rename = "doc")]
    pub doc: serde_json::Value,
    /// Document ID
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<u64>,
    #[serde(rename = "query", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub query: Option<Option<Box<models::QueryFilter>>>,
}

impl UpdateDocumentRequest {
    /// Payload for updating a document or multiple documents in a table
    pub fn new(table: String, doc: serde_json::Value) -> UpdateDocumentRequest {
        UpdateDocumentRequest {
            table,
            cluster: None,
            doc,
            id: None,
            query: None,
        }
    }
}