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 RiskScoreOut {
    /// Alert is whether this would become evidence. It is false in shadow however high the score.
    #[serde(rename = "alert", skip_serializing_if = "Option::is_none")]
    pub alert: Option<bool>,
    /// Causes is the per-feature attribution, ordered by contribution. Each is a COUNTERFACTUAL on the model that produced the score — the coordinate moved to its neutral value and the event rescored — so the explanation is the same arithmetic the score came from.
    #[serde(rename = "causes", skip_serializing_if = "Option::is_none")]
    pub causes: Option<Vec<models::RiskCause>>,
    /// Cut is the threshold in force, derived from the stated appetite as a quantile of the scores actually observed rather than fixed at a number.
    #[serde(rename = "cut", skip_serializing_if = "Option::is_none")]
    pub cut: Option<f64>,
    /// Policy is the version of your organisation's decision regime this verdict was reached under, from its own policy history (GET /v1/risk/policy). Cut is derived from the appetite that version states, so it is the record that makes this decision reconstructible after the appetite is restated. Zero means no regime has ever been stated and the default posture — shadow — was in force.
    #[serde(rename = "policy", skip_serializing_if = "Option::is_none")]
    pub policy: Option<i32>,
    /// Refusal names why the model declined, when it did.
    #[serde(rename = "refusal", skip_serializing_if = "Option::is_none")]
    pub refusal: Option<String>,
    /// Score is where the event sits in the tenant's own density: 0 where its recent behaviour is densest, 1 where there is none of it.
    #[serde(rename = "score", skip_serializing_if = "Option::is_none")]
    pub score: Option<f64>,
    /// Scored is false when the model declined, and Refusal says which refusal it was: warming, unusable or unidentified. None of them is a clean bill of health, which is why the refusal is stated rather than rendered as a score of zero.
    #[serde(rename = "scored", skip_serializing_if = "Option::is_none")]
    pub scored: Option<bool>,
    /// Shadow is whether the model is testing rather than deciding — scoring, learning and recording what it WOULD have alerted on, and changing no outcome. It is the default for a model no one has reviewed yet.
    #[serde(rename = "shadow", skip_serializing_if = "Option::is_none")]
    pub shadow: Option<bool>,
    /// Shape is the model space this verdict was reached in, as `<family>:<digest>`: the KIND of model, and that family's own digest over your organisation's feature inventory in order and the detector's geometry parameters. It is what pins an adverse decision to a model — a score is only meaningful against the space that produced it, and without this the only answer to \"which model decided this\" was \"the one that was running\", which is not an answer.  The family leads it because everything after it is one family's arithmetic. Two spaces are the same space only if they are the same family, so comparing this with the `shape` on your model state or on a published value is a comparison that holds ACROSS families and not only inside one.  It names the SPACE, not the learned state, and that is deliberate. The masses at the instant of a score are in-process counters somewhere between two published values, so citing a published address here would claim that value produced this score — true only for the score taken the instant after a publication. This, the policy version and the event's own time are what IS true, and the published history's clock (GET /v1/risk/state) brackets the decision between two named values from there.
    #[serde(rename = "shape", skip_serializing_if = "Option::is_none")]
    pub shape: Option<String>,
    /// Values is every coordinate, including the ones that contributed nothing, so a reviewer sees what the model read and not only what it concluded.
    #[serde(rename = "values", skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<models::RiskValue>>,
}

impl RiskScoreOut {
    pub fn new() -> RiskScoreOut {
        RiskScoreOut {
            alert: None,
            causes: None,
            cut: None,
            policy: None,
            refusal: None,
            score: None,
            scored: None,
            shadow: None,
            shape: None,
            values: None,
        }
    }
}