Skip to main content

mistral_openapi_client/models/
filters.rs

1/*
2 * Mistral AI API
3 *
4 * Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Filters {
16    #[serde(rename = "AND", skip_serializing_if = "Option::is_none")]
17    pub and: Option<Vec<models::FilterGroupAndInner>>,
18    #[serde(rename = "OR", skip_serializing_if = "Option::is_none")]
19    pub or: Option<Vec<models::FilterGroupAndInner>>,
20    #[serde(rename = "field")]
21    pub field: String,
22    #[serde(rename = "op")]
23    pub op: Op,
24    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
25    pub value: Option<serde_json::Value>,
26}
27
28impl Filters {
29    pub fn new(field: String, op: Op, value: Option<serde_json::Value>) -> Filters {
30        Filters {
31            and: None,
32            or: None,
33            field,
34            op,
35            value,
36        }
37    }
38}
39/// 
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
41pub enum Op {
42    #[serde(rename = "lt")]
43    Lt,
44    #[serde(rename = "lte")]
45    Lte,
46    #[serde(rename = "gt")]
47    Gt,
48    #[serde(rename = "gte")]
49    Gte,
50    #[serde(rename = "startswith")]
51    Startswith,
52    #[serde(rename = "istartswith")]
53    Istartswith,
54    #[serde(rename = "endswith")]
55    Endswith,
56    #[serde(rename = "iendswith")]
57    Iendswith,
58    #[serde(rename = "contains")]
59    Contains,
60    #[serde(rename = "icontains")]
61    Icontains,
62    #[serde(rename = "matches")]
63    Matches,
64    #[serde(rename = "notcontains")]
65    Notcontains,
66    #[serde(rename = "inotcontains")]
67    Inotcontains,
68    #[serde(rename = "eq")]
69    Eq,
70    #[serde(rename = "neq")]
71    Neq,
72    #[serde(rename = "isnull")]
73    Isnull,
74    #[serde(rename = "includes")]
75    Includes,
76    #[serde(rename = "excludes")]
77    Excludes,
78    #[serde(rename = "len_eq")]
79    LenEq,
80}
81
82impl Default for Op {
83    fn default() -> Op {
84        Self::Lt
85    }
86}
87