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.
176 lines
6.1 KiB
C++
176 lines
6.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.
|
|
*/
|
|
|
|
/*
|
|
* Policy.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_MODEL_Policy_H_
|
|
#define HANZO_MODEL_Policy_H_
|
|
|
|
#include <boost/optional.hpp>
|
|
|
|
#include "hanzo/ModelBase.h"
|
|
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
namespace hanzo {
|
|
namespace model {
|
|
|
|
|
|
|
|
class Policy
|
|
: public ModelBase
|
|
{
|
|
public:
|
|
Policy();
|
|
virtual ~Policy();
|
|
|
|
/////////////////////////////////////////////
|
|
/// 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;
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
/// Policy members
|
|
|
|
|
|
/// <summary>
|
|
/// CachePaths overrides CacheTTLSec per path PREFIX (key \"/v1/models\" → seconds). The longest matching prefix wins.
|
|
/// </summary>
|
|
std::map<utility::string_t, int64_t> getCachePaths() const;
|
|
bool cachePathsIsSet() const;
|
|
void unsetCache_paths();
|
|
void setCachePaths(std::map<utility::string_t, int64_t> value);
|
|
|
|
/// <summary>
|
|
/// CacheTTLSec is the org's default edge-cache TTL for its responses, in seconds; 0 means no caching. Unset inherits the platform default.
|
|
/// </summary>
|
|
int64_t getCacheTtlSec() const;
|
|
bool cacheTtlSecIsSet() const;
|
|
void unsetCache_ttl_sec();
|
|
void setCacheTtlSec(int64_t value);
|
|
|
|
/// <summary>
|
|
/// CORSOrigins is the PLATFORM-scope CORS allowlist EdgeCORS admits: an exact origin, a bare host, or a \"*.host\" wildcard. Writable only by a SuperAdmin — CORS is evaluated before identity, so it has no tenant to scope to.
|
|
/// </summary>
|
|
std::vector<utility::string_t> getCorsOrigins() const;
|
|
bool corsOriginsIsSet() const;
|
|
void unsetCors_origins();
|
|
void setCorsOrigins(const std::vector<utility::string_t>& value);
|
|
|
|
/// <summary>
|
|
/// Methods is the allowlist of HTTP methods the edge accepts for this org. Empty means all are accepted.
|
|
/// </summary>
|
|
std::vector<utility::string_t> getMethods() const;
|
|
bool methodsIsSet() const;
|
|
void unsetMethods();
|
|
void setMethods(const std::vector<utility::string_t>& value);
|
|
|
|
/// <summary>
|
|
/// Mode is the abuse gate's posture for THIS scope: \"shadow\" scores traffic and records the verdict without acting on it, \"live\" enforces it. Unset means shadow. It is the one per-org field that does NOT inherit. Every other field here layers a platform default under the org's own value, which is right for a default: a tenant that sets no rate ceiling should get the platform's. Mode is not a default, it is an ARMING DECISION — it is what makes a statistical judgement start refusing real traffic — and inheriting it means arming one scope arms every tenant that never asked for it, without a write to their row and without anything in their config changing. So a tenant is live only if that tenant's OWN row says live, and the platform row's mode governs exactly one scope: the anonymous lane, which has no tenant of its own. It is also not self-service. Writing it requires SuperAdmin (see the /v1/gateway config op): the subject of an abuse control does not get to switch the control off.
|
|
/// </summary>
|
|
utility::string_t getMode() const;
|
|
bool modeIsSet() const;
|
|
void unsetMode();
|
|
void setMode(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// OrgRPM is the org's OWN authenticated rate ceiling, requests per minute, as ScopeRateLimit enforces it. Unset inherits the platform default, then the static boot default.
|
|
/// </summary>
|
|
int64_t getOrgRpm() const;
|
|
bool orgRpmIsSet() const;
|
|
void unsetOrg_rpm();
|
|
void setOrgRpm(int64_t value);
|
|
|
|
/// <summary>
|
|
/// PerIPRPM is the PLATFORM-scope pre-auth flood cap: requests EdgeRateLimit admits per WindowSec from one client IP. SuperAdmin-only, same reason.
|
|
/// </summary>
|
|
int64_t getPerIpRpm() const;
|
|
bool perIpRpmIsSet() const;
|
|
void unsetPer_ip_rpm();
|
|
void setPerIpRpm(int64_t value);
|
|
|
|
/// <summary>
|
|
/// UpdatedAt is the unix second this policy row was last written. Server-stamped; a client-supplied value is ignored.
|
|
/// </summary>
|
|
int64_t getUpdatedAt() const;
|
|
bool updatedAtIsSet() const;
|
|
void unsetUpdated_at();
|
|
void setUpdatedAt(int64_t value);
|
|
|
|
/// <summary>
|
|
/// UpdatedBy is the validated user id that wrote this policy row. Server-stamped; a client-supplied value is ignored.
|
|
/// </summary>
|
|
utility::string_t getUpdatedBy() const;
|
|
bool updatedByIsSet() const;
|
|
void unsetUpdated_by();
|
|
void setUpdatedBy(const utility::string_t& value);
|
|
|
|
/// <summary>
|
|
/// WindowSec is the window PerIPRPM is counted over, in seconds. SuperAdmin-only.
|
|
/// </summary>
|
|
int64_t getWindowSec() const;
|
|
bool windowSecIsSet() const;
|
|
void unsetWindow_sec();
|
|
void setWindowSec(int64_t value);
|
|
|
|
|
|
protected:
|
|
std::map<utility::string_t, int64_t> m_Cache_paths;
|
|
bool m_Cache_pathsIsSet;
|
|
|
|
int64_t m_Cache_ttl_sec;
|
|
bool m_Cache_ttl_secIsSet;
|
|
|
|
std::vector<utility::string_t> m_Cors_origins;
|
|
bool m_Cors_originsIsSet;
|
|
|
|
std::vector<utility::string_t> m_Methods;
|
|
bool m_MethodsIsSet;
|
|
|
|
utility::string_t m_Mode;
|
|
bool m_ModeIsSet;
|
|
|
|
int64_t m_Org_rpm;
|
|
bool m_Org_rpmIsSet;
|
|
|
|
int64_t m_Per_ip_rpm;
|
|
bool m_Per_ip_rpmIsSet;
|
|
|
|
int64_t m_Updated_at;
|
|
bool m_Updated_atIsSet;
|
|
|
|
utility::string_t m_Updated_by;
|
|
bool m_Updated_byIsSet;
|
|
|
|
int64_t m_Window_sec;
|
|
bool m_Window_secIsSet;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_MODEL_Policy_H_ */
|