pub struct BudgetSourceAnomaly {
pub code: Option<String>,
pub field: Option<String>,
pub bound_field: Option<String>,
pub action: Option<String>,
pub reported_value: Option<f64>,
pub served_value: Option<f64>,
pub likely_cause: Option<String>,
pub affected_fields: Option<Vec<String>>,
pub message: Option<String>,
pub source: Option<BudgetSourceAnomalySource>,
pub extra: HashMap<String, Value>,
}Expand description
One problem found in the source data behind a budget-account row.
Client::list_budget_accounts and Client::get_budget_account return untyped Records; the source_anomalies field in them is a JSON list, [] when the row is clean.
Decode it with BudgetSourceAnomaly::from_record.
code is an open set, so match on the strings you know and treat anything else as a new kind of anomaly.
Known codes: contract_exceeds_obligations (contract obligations reported above the account’s obligations, so contract_obligated is capped), assistance_exceeds_obligations and contract_without_obligations (both flagged, the served values unchanged).
Every field is optional, and unknown server-side fields fall through to extra.
Fields§
§code: Option<String>What kind of anomaly this is, e.g. "contract_exceeds_obligations".
field: Option<String>The row field the anomaly is about, e.g. "contract_obligated".
bound_field: Option<String>The field whose value field was checked against, e.g. "obligated_total".
action: Option<String>What was done about it: "capped" (the served value was reduced to the bound) or "flagged" (served unchanged).
reported_value: Option<f64>The value the source data reported.
served_value: Option<f64>The value the API serves for field.
likely_cause: Option<String>Short description of the most likely cause.
affected_fields: Option<Vec<String>>Every served field the anomaly affects, including values derived from field.
message: Option<String>Human-readable explanation.
source: Option<BudgetSourceAnomalySource>The source rows behind the anomaly.
extra: HashMap<String, Value>Forward-compat catch-all for server-side fields the SDK does not yet model.