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
/*
* 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 serde::{Deserialize, Serialize};
/// _source
/// Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
/// Use this setting with the `source_includes` and `source_excludes` parameters.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum Source {
Fields(common::Fields),
FetchValue(bool),
}
impl std::fmt::Display for Source {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Fields(v) => write!(f, "{}", v),
Self::FetchValue(v) => write!(f, "{}", *v),
}
}
}
impl Default for Source {
fn default() -> Source {
Self::FetchValue(true)
}
}