AdCampaign class

Constructors

AdCampaign({String? account, int? budget, int? createdAt, String? externalId, String? id, String? name, String? objective, String? platform, int? spend, String? status, int? updatedAt})
Returns a new AdCampaign instance.

Properties

account ↔ String?
Account is the provider ad-account the campaign runs under, in Meta's act_
getter/setter pair
budget ↔ int?
Budget is the campaign's authorized spend in MINOR units (cents). Negative clamps to 0. It is the org's stored plan: a Meta launch creates the campaign object only, and the delivering budget lives on the ad set.
getter/setter pair
createdAt ↔ int?
CreatedAt is when the campaign was first stored, in unix seconds. It never changes, including across a full-replace update.
getter/setter pair
externalId ↔ String?
ExternalID is the ad network's own campaign id, written by a successful launch and by nothing else — an update never touches it. Empty means this campaign has never reached its network.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
id ↔ String?
ID is the campaign's server-minted handle, "camp_" + 32 hex. A create body cannot choose it, and it is the id every other route addresses.
getter/setter pair
name ↔ String?
Name is the campaign's display label, and the name Meta creates the campaign object under at launch. Required; trimmed and bounded to 1024 bytes.
getter/setter pair
objective ↔ String?
Objective is the campaign goal spelled as the provider names it ("conversions", "OUTCOME_TRAFFIC"), passed through to the network verbatim at launch — Meta defaults an empty one to OUTCOME_TRAFFIC. Free text, bounded to 1024 bytes; no vocabulary is enforced here.
getter/setter pair
platform ↔ String?
Platform is the ad network: meta, google, tiktok or x, and nothing else — a write naming another is 400. Empty stores as meta. Only meta executes today; launching any of the other three is 501.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spend ↔ int?
Spend is spend-to-date in MINOR units (cents), as last written through create or update. Negative clamps to 0. It is NOT read back from the network — that is a separate insights call — so 0 means nothing was recorded here, not that nothing was spent.
getter/setter pair
status ↔ String?
Status is the lifecycle: draft, active, paused or completed, and nothing else — a write naming another is 400. Empty stores as draft; a successful launch sets active. It records what this deployment did, not what the ad network currently reports.
getter/setter pair
updatedAt ↔ int?
UpdatedAt is when the row was last written, in unix seconds — set by create, update and launch. Listings are 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) → AdCampaign?
Returns a new AdCampaign instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<AdCampaign>
mapFromJson(dynamic json) → Map<String, AdCampaign>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<AdCampaign>>

Constants

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