hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * 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/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChannelMetric {
    /// ExternalID is the provider-side id of the execution the spend belongs to. Absent until the channel has launched.
    #[serde(rename = "externalId", skip_serializing_if = "Option::is_none")]
    pub external_id: Option<String>,
    /// Kind is which channel this row is: paid, organic or email. It is also the row's identity — a campaign carries at most one channel per kind.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Platform is the provider the spend was read from: meta, google, x, instagram, or the email provider.
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    /// SpendCents is what the provider itself reports this channel spent, in CENTS. 0 when the channel never launched, when no executor is wired for it, or when the read failed — SpendError tells the last case apart from a genuine zero.
    #[serde(rename = "spendCents", skip_serializing_if = "Option::is_none")]
    pub spend_cents: Option<i32>,
    /// SpendError is why this channel's spend could not be read (connector not connected, provider error), as one secret-free line. Present only on failure; the campaign total then simply omits this channel rather than failing.
    #[serde(rename = "spendError", skip_serializing_if = "Option::is_none")]
    pub spend_error: Option<String>,
    /// Status is the channel's launch state on the campaign — pending, live, paused, failed or unavailable. Only a live channel is asked for its spend at all.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
}

impl ChannelMetric {
    pub fn new() -> ChannelMetric {
        ChannelMetric {
            external_id: None,
            kind: None,
            platform: None,
            spend_cents: None,
            spend_error: None,
            status: None,
        }
    }
}