1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* 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 Campaign {
/// Budget is what the campaign is allowed to cost, in USD cents. A negative value is clamped to 0; nothing enforces the ceiling here.
#[serde(rename = "budget", skip_serializing_if = "Option::is_none")]
pub budget: Option<i32>,
/// Channel is the delivery surface: email, sms, social, meta, google or tiktok. Empty means email.
#[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
pub channel: Option<String>,
/// CreatedAt is unix seconds when the campaign was registered. Server-assigned and never rewritten — an update leaves it as it was.
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<i32>,
/// ID is the server-assigned campaign id (\"camp_\" + 128 random bits).
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Name is the campaign's label. Required, trimmed, capped at 1024 bytes.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Objective is the free-text goal (\"signups\"), capped at 1024 bytes.
#[serde(rename = "objective", skip_serializing_if = "Option::is_none")]
pub objective: Option<String>,
/// ScheduledAt is the unix send time; 0 means unscheduled. Setting it on a campaign with no explicit status makes that status \"scheduled\".
#[serde(rename = "scheduledAt", skip_serializing_if = "Option::is_none")]
pub scheduled_at: Option<i32>,
/// Spend is what the campaign has cost so far, in USD cents, clamped to >= 0. The CALLER owns it: no send, ad buy or invoice moves it, so it changes only when create or update carries a new value. It is summed across the org's campaigns into GET /v1/marketing/summary.
#[serde(rename = "spend", skip_serializing_if = "Option::is_none")]
pub spend: Option<i32>,
/// Status is the lifecycle: draft, scheduled, active, paused or completed. Empty means draft.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// UpdatedAt is unix seconds of the last write. Server-assigned on create and on every update or schedule change, and the campaign list is ordered by it, newest first.
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<i32>,
}
impl Campaign {
pub fn new() -> Campaign {
Campaign {
budget: None,
channel: None,
created_at: None,
id: None,
name: None,
objective: None,
scheduled_at: None,
spend: None,
status: None,
updated_at: None,
}
}
}