openai_struct/models/compound_filter.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https:///platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https:///github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub CompoundFilter : Combine multiple filters using `and` or `or`.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// CompoundFilter:
20/// $recursiveAnchor: true
21/// type: object
22/// additionalProperties: false
23/// title: Compound Filter
24/// description: Combine multiple filters using `and` or `or`.
25/// properties:
26/// type:
27/// type: string
28/// description: "Type of operation: `and` or `or`."
29/// enum:
30/// - and
31/// - or
32/// filters:
33/// type: array
34/// description:
35/// Array of filters to combine. Items can be `ComparisonFilter` or
36/// `CompoundFilter`.
37/// items:
38/// oneOf:
39/// - $ref: "#/components/schemas/ComparisonFilter"
40/// - $recursiveRef: "#"
41/// required:
42/// - type
43/// - filters
44/// x-oaiMeta:
45/// name: CompoundFilter
46/// ```
47#[derive(Debug, Serialize, Deserialize)]
48pub struct CompoundFilter {
49 /// Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`.
50 #[serde(rename = "filters")]
51 pub filters: Vec<CompoundFilterItem>,
52 /// Type of operation: `and` or `or`.
53 #[serde(rename = "type")]
54 pub _type: String,
55}
56
57#[derive(Debug, Serialize, Deserialize)]
58#[serde(untagged)]
59pub enum CompoundFilterItem {
60 Comparison(crate::ComparisonFilter),
61 Compound(CompoundFilter),
62}