Campaign class

Constructors

Campaign({int? budget, String? channel, int? createdAt, String? id, String? name, String? objective, int? scheduledAt, int? spend, String? status, int? updatedAt})
Returns a new Campaign instance.

Properties

budget ↔ int?
Budget is what the campaign is allowed to cost, in USD cents. A negative value is clamped to 0; nothing enforces the ceiling here.
getter/setter pair
channel ↔ String?
Channel is the delivery surface: email, sms, social, meta, google or tiktok. Empty means email.
getter/setter pair
createdAt ↔ int?
CreatedAt is unix seconds when the campaign was registered. Server-assigned and never rewritten — an update leaves it as it was.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
id ↔ String?
ID is the server-assigned campaign id ("camp_" + 128 random bits).
getter/setter pair
name ↔ String?
Name is the campaign's label. Required, trimmed, capped at 1024 bytes.
getter/setter pair
objective ↔ String?
Objective is the free-text goal ("signups"), capped at 1024 bytes.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scheduledAt ↔ int?
ScheduledAt is the unix send time; 0 means unscheduled. Setting it on a campaign with no explicit status makes that status "scheduled".
getter/setter pair
spend ↔ int?
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.
getter/setter pair
status ↔ String?
Status is the lifecycle: draft, scheduled, active, paused or completed. Empty means draft.
getter/setter pair
updatedAt ↔ int?
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.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → Campaign?
Returns a new Campaign instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<Campaign>
mapFromJson(dynamic json) → Map<String, Campaign>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<Campaign>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.