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.
146 lines
9.4 KiB
C++
146 lines
9.4 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.
|
|
*/
|
|
|
|
/*
|
|
* LabelApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_LabelApi_H_
|
|
#define HANZO_API_LabelApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/RiskDisposeIn.h"
|
|
#include "hanzo/model/RiskDisposeOut.h"
|
|
#include "hanzo/model/RiskHoldIn.h"
|
|
#include "hanzo/model/RiskHoldOut.h"
|
|
#include "hanzo/model/RiskLabelCoverage.h"
|
|
#include "hanzo/model/RiskLabelIn.h"
|
|
#include "hanzo/model/RiskLabelOut.h"
|
|
#include "hanzo/model/RiskLabelVocabulary.h"
|
|
#include "hanzo/model/RiskLabelsOut.h"
|
|
#include "hanzo/model/RiskResolveIn.h"
|
|
#include "hanzo/model/RiskResolveOut.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class LabelApi
|
|
{
|
|
public:
|
|
|
|
explicit LabelApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~LabelApi();
|
|
|
|
/// <summary>
|
|
/// Dispose of this tenant's expired assertions, whole records only
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Applies this tenant's retention, and only this tenant's. It is bounded three ways, each a compliance property rather than a convenience. It refuses a boundary younger than the platform floor, because a label can be the input to an adverse action and five years is what the retention ledger holds such a record for. It never touches a record under litigation hold. And it disposes of whole records rather than redacting fields. It removes the derived columnar copy BEFORE the record, and refuses the whole disposal if the warehouse cannot be reached. The other order would leave rows in the warehouse that nothing can identify any more, which is a disposal that did not happen and says it did.
|
|
/// </remarks>
|
|
/// <param name="riskDisposeIn"></param>
|
|
pplx::task<std::shared_ptr<RiskDisposeOut>> riskDisposeLabels(
|
|
std::shared_ptr<RiskDisposeIn> riskDisposeIn
|
|
) const;
|
|
/// <summary>
|
|
/// Place or release a litigation hold on named records
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Places or releases a litigation hold on named records. A hold is a fact about the RECORD, not about the world: it says retention may not dispose of this row, and it asserts nothing about what happened. So it is not a field on an assertion and it is not folded into the content digest — carried there it was silently a no-op on any record that already existed, since re-filing the same assertion with a hold flag produced the same digest, the insert was ignored, and the caller was answered `duplicate` while the hold it asked for was never placed. This op is the one way a hold moves, in either direction, and the move is written to the audit log. Every named id is this tenant's or is nothing. The statement runs against the tenant's own file, which holds no other tenant's rows and has no column that could name one.
|
|
/// </remarks>
|
|
/// <param name="riskHoldIn"></param>
|
|
pplx::task<std::shared_ptr<RiskHoldOut>> riskHoldLabels(
|
|
std::shared_ptr<RiskHoldIn> riskHoldIn
|
|
) const;
|
|
/// <summary>
|
|
/// Assert ground truth about events
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Records a batch of ground truth against the entities it judges. Each assertion carries TWO times — when the judged event happened, and when the assertion became knowable — and both are required. The second is what keeps a chargeback that landed in June out of a model that had to decide in February. It is idempotent on the CONTENT of an assertion, so a webhook that redelivers is safe. It never overwrites: a source that corrects itself later files a NEW assertion, which wins from the moment it became knowable and leaves every earlier observation instant seeing exactly what it saw. The asserter is stamped from the validated credential and is not a body field.
|
|
/// </remarks>
|
|
/// <param name="riskLabelIn"></param>
|
|
pplx::task<std::shared_ptr<RiskLabelOut>> riskLabel(
|
|
std::shared_ptr<RiskLabelIn> riskLabelIn
|
|
) const;
|
|
/// <summary>
|
|
/// How much of the window has matured, and how much of that is judged
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reports how much of a window has matured and how much of that is judged, per source. It is the gate on training. A supervised fit over a window whose judged count is near zero produces a number, and the number is meaningless; this op is what lets that be stated before the fit rather than discovered after it. It reads the RECORD plane and folds every assertion at that event's OWN as-of, so the counts obey exactly the leakage rule a materialisation would. It counts only what was ASSERTED: what share of the whole event STREAM carries a label is a question about the feature plane's denominator and is not answerable here.
|
|
/// </remarks>
|
|
/// <param name="from">From and To bound the EVENT window, half-open, RFC 3339. Unstated, the window is the 90 days ENDING where maturity begins — `to` is the horizon ago, not now. A default window running to now under a default horizon could not contain one matured event, so every count below it would be zero however much ground truth the tenant held. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="to"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="horizon">Horizon is the maturity horizon in days the coverage is measured under. Unstated takes 120. It also moves the default window, which ends where maturity begins. (optional, default to 0L)</param>
|
|
pplx::task<std::shared_ptr<RiskLabelCoverage>> riskLabelCoverage(
|
|
boost::optional<utility::string_t> from,
|
|
boost::optional<utility::string_t> to,
|
|
boost::optional<int64_t> horizon
|
|
) const;
|
|
/// <summary>
|
|
/// The closed vocabularies and the precedence rule that resolves a conflict
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Publishes the closed vocabularies and the precedence rule that resolves a conflict between two sources. A precedence rule nobody can read is a rule nobody can audit or dispute, and the whole defensibility of a contested label rests on being able to say why one assertion beat another. The order returned here is derived from the same declaration the resolver reads — it is not a description of it.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<RiskLabelVocabulary>> riskLabelVocabulary(
|
|
) const;
|
|
/// <summary>
|
|
/// Read the assertions this tenant has recorded
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reads the assertions this tenant has recorded, newest event first. It reads the RECORD — the tenant's own store — and not the columnar copy, so what it returns is what would be produced in an audit. Narrow it by entity, by asserter, or by event window.
|
|
/// </remarks>
|
|
/// <param name="kind">Kind and Subject narrow to one entity. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="subject"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="source">Source narrows to one asserter — the read that answers \"what has commerce told us\", separately from \"what has an analyst told us\". (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="from">From and To bound the EVENT time, half-open, RFC 3339. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="to"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="limit">Limit caps the page. Out of range takes the plane's own bound. (optional, default to 0L)</param>
|
|
pplx::task<std::shared_ptr<RiskLabelsOut>> riskLabels(
|
|
boost::optional<utility::string_t> kind,
|
|
boost::optional<utility::string_t> subject,
|
|
boost::optional<utility::string_t> source,
|
|
boost::optional<utility::string_t> from,
|
|
boost::optional<utility::string_t> to,
|
|
boost::optional<int64_t> limit
|
|
) const;
|
|
/// <summary>
|
|
/// Resolve the label in force for named events, as of each event's own horizon
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers, for each named event, which assertion was in force AS OF that event's own horizon — and what disagreed with it. This is the join surface: the dataset materialiser calls it to attach ground truth to training rows, and the evaluator calls it to score a past decision against what was knowable when the decision had to be made. One mechanism for both, so a model can never be trained under one leakage rule and scored under another. Three answers are distinct and all three are honest: a resolved label, an event that has not matured, and a matured event nobody has judged. The last is never reported as unproductive.
|
|
/// </remarks>
|
|
/// <param name="riskResolveIn"></param>
|
|
pplx::task<std::shared_ptr<RiskResolveOut>> riskResolveLabels(
|
|
std::shared_ptr<RiskResolveIn> riskResolveIn
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_LabelApi_H_ */
|
|
|