Skip to main content

hanzo_client/models/
commerce_overview.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
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 CommerceOverview {
16    /// AOV is average order value — Revenue/Orders, rounded to two places. Zero when there were no orders.
17    #[serde(rename = "aov", skip_serializing_if = "Option::is_none")]
18    pub aov: Option<f64>,
19    /// Available is false when the product-event table could not be read — the lens is reported missing rather than as zeros that look like no sales.
20    #[serde(rename = "available", skip_serializing_if = "Option::is_none")]
21    pub available: Option<bool>,
22    /// Orders is how many order_completed events landed in the window.
23    #[serde(rename = "orders", skip_serializing_if = "Option::is_none")]
24    pub orders: Option<i32>,
25    /// Reason says why the lens is unavailable. Omitted when it is available.
26    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
27    pub reason: Option<String>,
28    /// Revenue is the total those orders carried, in the events' own currency unit.
29    #[serde(rename = "revenue", skip_serializing_if = "Option::is_none")]
30    pub revenue: Option<f64>,
31    /// Source is the warehouse table the lens read.
32    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
33    pub source: Option<String>,
34}
35
36impl CommerceOverview {
37    pub fn new() -> CommerceOverview {
38        CommerceOverview {
39            aov: None,
40            available: None,
41            orders: None,
42            reason: None,
43            revenue: None,
44            source: None,
45        }
46    }
47}
48