1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Manticore Search Client
 *
 * Сlient for Manticore Search. 
 *
 * The version of the OpenAPI document: 3.3.1
 * Contact: info@manticoresearch.com
 * Generated by: https://openapi-generator.tech
 */

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

/// UpdateDocumentRequest : Payload for update document
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateDocumentRequest {
    #[serde(rename = "index")]
    pub index: String,
    /// Index name
    #[serde(rename = "doc")]
    pub doc: std::collections::HashMap<String, serde_json::Value>,
    /// Document ID
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    /// Query tree object
    #[serde(rename = "query", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub query: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
}

impl UpdateDocumentRequest {
    /// Payload for update document
    pub fn new(index: String, doc: std::collections::HashMap<String, serde_json::Value>) -> UpdateDocumentRequest {
        UpdateDocumentRequest {
            index,
            doc,
            id: None,
            query: None,
        }
    }
}