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.
222 lines
7.1 KiB
C++
222 lines
7.1 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.
|
|
*/
|
|
|
|
/*
|
|
* TrafficView.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_TrafficView_H_
|
|
#define HANZO_MODEL_TrafficView_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include "hanzo/model/TrafficCaller.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
class TrafficCaller;
|
|
|
|
|
|
class TrafficView
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
TrafficView();
|
|
virtual ~TrafficView();
|
|
|
|
/////////////////////////////////////////////
|
|
/// 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;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// TrafficView members
|
|
|
|
|
|
/// <summary>
|
|
/// Blind is how many requests in the window carried no identity to attribute them to — no validated credential and no client address. Non-zero on a public plane means the client address is not reaching this process (a TCP load balancer with no PROXY protocol in front of it, typically), so this scope's callers cannot be told apart and nothing can be held against them.
|
|
/// </summary>
|
|
int64_t getBlind() const;
|
|
bool blindIsSet() const;
|
|
void unsetBlind();
|
|
void setBlind(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Callers is the scope's busiest callers this window. A credentialed caller appears as a FINGERPRINT — a per-process one-way digest: enough to recognise the same caller across requests, never enough to reconstruct the credential.
|
|
/// </summary>
|
|
std::vector<std::shared_ptr<TrafficCaller>> getCallers() const;
|
|
bool callersIsSet() const;
|
|
void unsetCallers();
|
|
void setCallers(const std::vector<std::shared_ptr<TrafficCaller>>& value);
|
|
|
|
/// <summary>
|
|
/// Ceiling is the most callers this scope may hold at once.
|
|
/// </summary>
|
|
int64_t getCeiling() const;
|
|
bool ceilingIsSet() const;
|
|
void unsetCeiling();
|
|
void setCeiling(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Denied is how many of them the gate refused.
|
|
/// </summary>
|
|
int64_t getDenied() const;
|
|
bool deniedIsSet() const;
|
|
void unsetDenied();
|
|
void setDenied(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Lanes is the request count per lane — agent, human, bot, unknown. This is the split that separates a customer's automation from a scraper.
|
|
/// </summary>
|
|
std::map<utility::string_t, int64_t> getLanes() const;
|
|
bool lanesIsSet() const;
|
|
void unsetLanes();
|
|
void setLanes(std::map<utility::string_t, int64_t> value);
|
|
|
|
/// <summary>
|
|
/// Mode is the abuse gate's posture for this scope: \"shadow\" records the scorer's action without enforcing it, \"live\" enforces it.
|
|
/// </summary>
|
|
utility::string_t getMode() const;
|
|
bool modeIsSet() const;
|
|
void unsetMode();
|
|
void setMode(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Org is the scope this view was taken for — the validated principal's own, never a value the caller supplied. Empty names the anonymous lane, the one scope that has no tenant.
|
|
/// </summary>
|
|
utility::string_t getOrg() const;
|
|
bool orgIsSet() const;
|
|
void unsetOrg();
|
|
void setOrg(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Refused is how many callers this scope's ceilings turned away in the window.
|
|
/// </summary>
|
|
int64_t getRefused() const;
|
|
bool refusedIsSet() const;
|
|
void unsetRefused();
|
|
void setRefused(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Requests is how many requests this scope made in the window.
|
|
/// </summary>
|
|
int64_t getRequests() const;
|
|
bool requestsIsSet() const;
|
|
void unsetRequests();
|
|
void setRequests(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Screens is how many of them were put to the scorer — the billable unit of the risk product. Counted from the first request, whatever the SKU costs.
|
|
/// </summary>
|
|
int64_t getScreens() const;
|
|
bool screensIsSet() const;
|
|
void unsetScreens();
|
|
void setScreens(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Strain is what this scope's ceilings are doing: \"clear\" below them, \"full\" at them, \"refuse\" once a caller has been turned away inside this window — which means that caller is UNMEASURED and the numbers here are a sample rather than a census. It is reported rather than logged because the alternative — a bound that degrades a scope silently — is the failure this design exists to rule out. No other scope can move it.
|
|
/// </summary>
|
|
utility::string_t getStrain() const;
|
|
bool strainIsSet() const;
|
|
void unsetStrain();
|
|
void setStrain(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// Tracked is how many callers this scope holds state for right now, and Ceiling is the most it may hold. Tracked == Ceiling is the fact a bound that binds cannot hide.
|
|
/// </summary>
|
|
int64_t getTracked() const;
|
|
bool trackedIsSet() const;
|
|
void unsetTracked();
|
|
void setTracked(int64_t value);
|
|
|
|
/// <summary>
|
|
/// Unscored is how many of those screens got NO answer — the scorer was absent, stuck, slow, erroring or silent. An unanswered screen allows ordinary traffic, so this is the number that separates \"a quiet day\" from \"the judge stopped answering and nothing said so\".
|
|
/// </summary>
|
|
int64_t getUnscored() const;
|
|
bool unscoredIsSet() const;
|
|
void unsetUnscored();
|
|
void setUnscored(int64_t value);
|
|
|
|
/// <summary>
|
|
/// WindowSec is the span the counts cover, in seconds.
|
|
/// </summary>
|
|
int64_t getWindowSec() const;
|
|
bool windowSecIsSet() const;
|
|
void unsetWindow_sec();
|
|
void setWindowSec(int64_t value);
|
|
|
|
|
|
protected:
|
|
int64_t m_Blind;
|
|
bool m_BlindIsSet;
|
|
|
|
std::vector<std::shared_ptr<TrafficCaller>> m_Callers;
|
|
bool m_CallersIsSet;
|
|
|
|
int64_t m_Ceiling;
|
|
bool m_CeilingIsSet;
|
|
|
|
int64_t m_Denied;
|
|
bool m_DeniedIsSet;
|
|
|
|
std::map<utility::string_t, int64_t> m_Lanes;
|
|
bool m_LanesIsSet;
|
|
|
|
utility::string_t m_Mode;
|
|
bool m_ModeIsSet;
|
|
|
|
utility::string_t m_Org;
|
|
bool m_OrgIsSet;
|
|
|
|
int64_t m_Refused;
|
|
bool m_RefusedIsSet;
|
|
|
|
int64_t m_Requests;
|
|
bool m_RequestsIsSet;
|
|
|
|
int64_t m_Screens;
|
|
bool m_ScreensIsSet;
|
|
|
|
utility::string_t m_Strain;
|
|
bool m_StrainIsSet;
|
|
|
|
int64_t m_Tracked;
|
|
bool m_TrackedIsSet;
|
|
|
|
int64_t m_Unscored;
|
|
bool m_UnscoredIsSet;
|
|
|
|
int64_t m_Window_sec;
|
|
bool m_Window_secIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_TrafficView_H_ */
|