fastcomments-sdk 3.0.1

Official FastComments Rust SDK (Typed API Client & Utilities)
Documentation
/*
 * fastcomments
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::client::models;
use serde::{Deserialize, Serialize};

/// AggregationOperation : An operation that will be applied on a field
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AggregationOperation {
    /// The field to operate on
    #[serde(rename = "field")]
    pub field: String,
    #[serde(rename = "op")]
    pub op: models::AggregationOpType,
    /// Optional alias for the output; if not provided, a default alias is computed
    #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
    pub alias: Option<String>,
    #[serde(rename = "expandArray", skip_serializing_if = "Option::is_none")]
    pub expand_array: Option<bool>,
}

impl AggregationOperation {
    /// An operation that will be applied on a field
    pub fn new(field: String, op: models::AggregationOpType) -> AggregationOperation {
        AggregationOperation {
            field,
            op,
            alias: None,
            expand_array: None,
        }
    }
}