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 CampaignRecord {
    /// Audience is an opaque reference to the segment this campaign targets. It is stored and echoed but not yet handed to the executors — a channel targets through the provider account it runs under — so it is documentation for now. Absent when never set.
    #[serde(rename = "audience", skip_serializing_if = "Option::is_none")]
    pub audience: Option<String>,
    /// Budget is the campaign's total budget in CENTS, handed to each executor as the budget for its channel. 0 means none was set.
    #[serde(rename = "budget", skip_serializing_if = "Option::is_none")]
    pub budget: Option<i32>,
    /// Channels are the fan-out targets, at most one per kind and at most 12, each carrying its own post-launch state. Empty means nothing to launch, which is what makes a launch of this campaign a 400.
    #[serde(rename = "channels", skip_serializing_if = "Option::is_none")]
    pub channels: Option<Vec<models::ChannelSpec>>,
    /// Content is the ordered creative set, at most 32, empty entries dropped. Content[0] is the creative that runs; the rest are A/B variants a wired experiment can assign per launch.
    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
    pub content: Option<Vec<String>>,
    /// CreatedAt is when the campaign was created, in unix seconds. Server-set.
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<i32>,
    /// ID is the campaign's server-minted handle — \"cmp_\" and 128 random bits — and the id every other campaign call is addressed by. Never read off the wire: a create that sends one has it ignored.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Name is the campaign's display name. Required on write, trimmed, and capped at 2048 characters.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// ScheduleAt is when the campaign should run, in unix seconds. 0 (absent) means launch immediately. It is passed to each executor; nothing in this service wakes up to launch it for you.
    #[serde(rename = "scheduleAt", skip_serializing_if = "Option::is_none")]
    pub schedule_at: Option<i32>,
    /// Status is the lifecycle state, server-owned and never accepted from a caller. Four values actually occur: draft (inert and fully mutable — nothing is sent and no budget is committed), live, paused and failed. After a fan-out live means AT LEAST ONE channel launched — read the channel rows for the rest — and failed means none did.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// UpdatedAt is the last write in unix seconds — an edit, a launch or a pause. Server-set on every save.
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<i32>,
}

impl CampaignRecord {
    pub fn new() -> CampaignRecord {
        CampaignRecord {
            audience: None,
            budget: None,
            channels: None,
            content: None,
            created_at: None,
            id: None,
            name: None,
            schedule_at: None,
            status: None,
            updated_at: None,
        }
    }
}