fastcomments_sdk/client/src/models/
aggregation_operation.rs

1/*
2 * fastcomments
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 0.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::client::models;
12use serde::{Deserialize, Serialize};
13
14/// AggregationOperation : An operation that will be applied on a field
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AggregationOperation {
17    /// The field to operate on
18    #[serde(rename = "field")]
19    pub field: String,
20    #[serde(rename = "op")]
21    pub op: models::AggregationOpType,
22    /// Optional alias for the output; if not provided, a default alias is computed
23    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
24    pub alias: Option<String>,
25    #[serde(rename = "expandArray", skip_serializing_if = "Option::is_none")]
26    pub expand_array: Option<bool>,
27}
28
29impl AggregationOperation {
30    /// An operation that will be applied on a field
31    pub fn new(field: String, op: models::AggregationOpType) -> AggregationOperation {
32        AggregationOperation {
33            field,
34            op,
35            alias: None,
36            expand_array: None,
37        }
38    }
39}
40