mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
The projection these were generated from was a month old and predated the compute migration, so every one of them described /v1/visor — which the API serves at zero paths now. That is why a hand-written console client and a generated one had drifted the same way at the same time. No /v1/visor path survives here. The word still appears as a source-plane value and inside gvisor and supervisor, which are not this rename.
270 lines
10 KiB
C++
270 lines
10 KiB
C++
/**
|
|
* 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
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
/*
|
|
* RiskModelState.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_RiskModelState_H_
|
|
#define HANZO_MODEL_RiskModelState_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include "hanzo/model/RiskSurface.h"
|
|
#include "hanzo/model/RiskAggregates.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <map>
|
|
#include "hanzo/model/RiskModelValue.h"
|
|
#include <vector>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
class RiskAggregates;
|
|
class RiskSurface;
|
|
class RiskModelValue;
|
|
|
|
|
|
class RiskModelState
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
RiskModelState();
|
|
virtual ~RiskModelState();
|
|
|
|
/////////////////////////////////////////////
|
|
/// ModelBase overrides
|
|
|
|
void validate() override;
|
|
|
|
web::json::value toJson() const override;
|
|
bool fromJson(const web::json::value& json) override;
|
|
|
|
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
|
|
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) override;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// RiskModelState members
|
|
|
|
|
|
/// <summary>
|
|
/// Aggregates reports the pressure on this organisation's own sliding aggregates, and whether they have started forgetting subjects to stay inside their bound.
|
|
/// </summary>
|
|
std::shared_ptr<RiskAggregates> getAggregates() const;
|
|
bool aggregatesIsSet() const;
|
|
void unsetAggregates();
|
|
void setAggregates(const std::shared_ptr<RiskAggregates>& value);
|
|
|
|
/// <summary>
|
|
/// Blind counts, per feature, how often it took its neutral value for want of data. A feature blind on most traffic is not contributing whatever the inventory claims for it.
|
|
/// </summary>
|
|
std::map<utility::string_t, int64_t> getBlind() const;
|
|
bool blindIsSet() const;
|
|
void unsetBlind();
|
|
void setBlind(std::map<utility::string_t, int64_t> value);
|
|
|
|
/// <summary>
|
|
/// Cut is the threshold in force, derived from Stated as a quantile of the scores actually observed.
|
|
/// </summary>
|
|
double getCut() const;
|
|
bool cutIsSet() const;
|
|
void unsetCut();
|
|
void setCut(double value);
|
|
|
|
/// <summary>
|
|
/// Descends is the published value the working model grew out of: the newest one whose mass count it has reached or passed. Empty when nothing has been published yet. It is DERIVED from the count and never stored, so an instant rollback is right for free — adopting an older value moves the count backward and this answers with that older value, where a stored pointer would be a second fact to keep in step. Read with Learned it is also the DRIFT: this model is Descends plus however many events the two counts differ by.
|
|
/// </summary>
|
|
utility::string_t getDescends() const;
|
|
bool descendsIsSet() const;
|
|
void unsetDescends();
|
|
void setDescends(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Disposed is how many published values retention has taken. It is DERIVED from the lowest surviving sequence, so it cannot drift from what it describes, and it is reported because a retention that binds is a fact an operator must be able to read rather than a silence.
|
|
/// </summary>
|
|
int64_t getDisposed() const;
|
|
bool disposedIsSet() const;
|
|
void unsetDisposed();
|
|
void setDisposed(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Learned is how many events the model has learned from.
|
|
/// </summary>
|
|
int64_t getLearned() const;
|
|
bool learnedIsSet() const;
|
|
void unsetLearned();
|
|
void setLearned(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Live is false while the model is in shadow — scoring, learning and recording what it WOULD have alerted on, and changing no outcome. Shadow is the default for a new tenant.
|
|
/// </summary>
|
|
bool isLive() const;
|
|
bool liveIsSet() const;
|
|
void unsetLive();
|
|
void setLive(bool value);
|
|
|
|
/// <summary>
|
|
/// Policy is the version of the decision regime this model is deciding under, from your organisation's own policy history (GET /v1/risk/policy). Every score cites it, so it is the join between a past decision and the appetite that produced its threshold. Zero means no regime has ever been stated and the default posture — shadow — is in force.
|
|
/// </summary>
|
|
int64_t getPolicy() const;
|
|
bool policyIsSet() const;
|
|
void unsetPolicy();
|
|
void setPolicy(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Realised is the share that actually was. Reading it beside Stated is what makes the appetite a measured commitment rather than an intention.
|
|
/// </summary>
|
|
double getRealised() const;
|
|
bool realisedIsSet() const;
|
|
void unsetRealised();
|
|
void setRealised(double value);
|
|
|
|
/// <summary>
|
|
/// Refused counts events the model would not score, by reason. None of them was examined; a refusal is counted, never silent.
|
|
/// </summary>
|
|
std::map<utility::string_t, int64_t> getRefused() const;
|
|
bool refusedIsSet() const;
|
|
void unsetRefused();
|
|
void setRefused(std::map<utility::string_t, int64_t> value);
|
|
|
|
/// <summary>
|
|
/// Sample is the share of below-the-line events retained for review, which is how the miss rate is measured rather than assumed.
|
|
/// </summary>
|
|
double getSample() const;
|
|
bool sampleIsSet() const;
|
|
void unsetSample();
|
|
void setSample(double value);
|
|
|
|
/// <summary>
|
|
/// Saturated means no threshold can honour the stated appetite because too much of the stream scores in the top bucket, so the model is alerting on nothing — the one state that must never be mistaken for quiet.
|
|
/// </summary>
|
|
bool isSaturated() const;
|
|
bool saturatedIsSet() const;
|
|
void unsetSaturated();
|
|
void setSaturated(bool value);
|
|
|
|
/// <summary>
|
|
/// Shape is the model's identity, as `<family>:<digest>`: the KIND of model, and that family's own digest over the inventory in order and the detector's geometry parameters. It is what an auditor pins an alert to, because learned state is only meaningful against the space that produced it — and the family leads it because two families' masses are not fitted differently, they are different kinds of number.
|
|
/// </summary>
|
|
utility::string_t getShape() const;
|
|
bool shapeIsSet() const;
|
|
void unsetShape();
|
|
void setShape(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Stated is the share of the stream this organisation said may be examined.
|
|
/// </summary>
|
|
double getStated() const;
|
|
bool statedIsSet() const;
|
|
void unsetStated();
|
|
void setStated(double value);
|
|
|
|
/// <summary>
|
|
/// Surface reports what of the tenant's OWN event surface has been folded in.
|
|
/// </summary>
|
|
std::shared_ptr<RiskSurface> getSurface() const;
|
|
bool surfaceIsSet() const;
|
|
void unsetSurface();
|
|
void setSurface(const std::shared_ptr<RiskSurface>& value);
|
|
|
|
/// <summary>
|
|
/// Tenant is the qualified key the model is held under — the brand whose issuer vouched for the caller and the organisation it acts for. It is echoed so a reader can see the answer is its own and not a parameter it passed.
|
|
/// </summary>
|
|
utility::string_t getTenant() const;
|
|
bool tenantIsSet() const;
|
|
void unsetTenant();
|
|
void setTenant(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Values is your organisation's own published model values, newest first — every state it deliberately named, each addressed by its own content and immutable. This is what PUT /v1/risk/state/model names, so it is reported HERE rather than behind an address of its own: they are part of what a review of one model reads, and a list of names is a few hundred bytes. Compare each one's `shape` with the `shape` above: equal means adopting it restores masses into the space this model already runs, and different means adopting it REPLANTS the model into the space that value describes — which is how the shape a search found becomes the shape you are running. The working model is NOT in it. Publication is a boundary somebody marked; the state between two boundaries is in-process counters, and calling those a value would be a claim about reproducibility that nothing could honour.
|
|
/// </summary>
|
|
std::vector<std::shared_ptr<RiskModelValue>> getValues() const;
|
|
bool valuesIsSet() const;
|
|
void unsetValues();
|
|
void setValues(const std::vector<std::shared_ptr<RiskModelValue>>& value);
|
|
|
|
/// <summary>
|
|
/// Warm is whether that is enough for the model to have an opinion at all. Below it the model declines to score, which is an ordinary state and is not a clean bill of health.
|
|
/// </summary>
|
|
bool isWarm() const;
|
|
bool warmIsSet() const;
|
|
void unsetWarm();
|
|
void setWarm(bool value);
|
|
|
|
|
|
protected:
|
|
std::shared_ptr<RiskAggregates> m_Aggregates;
|
|
bool m_AggregatesIsSet;
|
|
|
|
std::map<utility::string_t, int64_t> m_Blind;
|
|
bool m_BlindIsSet;
|
|
|
|
double m_Cut;
|
|
bool m_CutIsSet;
|
|
|
|
utility::string_t m_Descends;
|
|
bool m_DescendsIsSet;
|
|
|
|
int64_t m_Disposed;
|
|
bool m_DisposedIsSet;
|
|
|
|
int64_t m_Learned;
|
|
bool m_LearnedIsSet;
|
|
|
|
bool m_Live;
|
|
bool m_LiveIsSet;
|
|
|
|
int64_t m_Policy;
|
|
bool m_PolicyIsSet;
|
|
|
|
double m_Realised;
|
|
bool m_RealisedIsSet;
|
|
|
|
std::map<utility::string_t, int64_t> m_Refused;
|
|
bool m_RefusedIsSet;
|
|
|
|
double m_Sample;
|
|
bool m_SampleIsSet;
|
|
|
|
bool m_Saturated;
|
|
bool m_SaturatedIsSet;
|
|
|
|
utility::string_t m_Shape;
|
|
bool m_ShapeIsSet;
|
|
|
|
double m_Stated;
|
|
bool m_StatedIsSet;
|
|
|
|
std::shared_ptr<RiskSurface> m_Surface;
|
|
bool m_SurfaceIsSet;
|
|
|
|
utility::string_t m_Tenant;
|
|
bool m_TenantIsSet;
|
|
|
|
std::vector<std::shared_ptr<RiskModelValue>> m_Values;
|
|
bool m_ValuesIsSet;
|
|
|
|
bool m_Warm;
|
|
bool m_WarmIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_RiskModelState_H_ */
|