manticore_openapi/models/
update_document_request.rs

1/*
2 * Manticore Search Client
3 *
4 * Сlient for Manticore Search. 
5 *
6 * The version of the OpenAPI document: 3.3.1
7 * Contact: info@manticoresearch.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// UpdateDocumentRequest : Payload for update document
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UpdateDocumentRequest {
17    #[serde(rename = "index")]
18    pub index: String,
19    /// Index name
20    #[serde(rename = "doc")]
21    pub doc: std::collections::HashMap<String, serde_json::Value>,
22    /// Document ID
23    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
24    pub id: Option<i64>,
25    /// Query tree object
26    #[serde(rename = "query", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub query: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
28}
29
30impl UpdateDocumentRequest {
31    /// Payload for update document
32    pub fn new(index: String, doc: std::collections::HashMap<String, serde_json::Value>) -> UpdateDocumentRequest {
33        UpdateDocumentRequest {
34            index,
35            doc,
36            id: None,
37            query: None,
38        }
39    }
40}
41