Files
zeekay 645325a641 regenerate from cloud 939b09d4
The projection was 113 commits behind the document it claims to describe, and
`generate.py --all --check` reported every one of the thirteen clients DRIFTED —
the same +19 models in each, because they all fell behind the same emission.

Regenerated in place from hanzo-inc/cloud openapi.yaml at 939b09d4
(sha256 087024f6…), which is the only description of this API that cannot name a
route the binary does not serve. `--check` is clean across all thirteen after.

.spec-lock moved with the code. The generator READS that file and never writes
it — hanzoai/ci`s lane does — so a hand run leaves every lock naming the previous
document. A lock that disagrees with the tree beside it is worse than no lock:
the next `--check` without `--spec` fetches what production serves, compares it
to a digest that was already wrong, and reports drift that is really staleness.
2026-08-24 23:32:53 -07:00

125 lines
9.8 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.
*/
/*
* UsageApi.h
*
*
*/
#ifndef HANZO_API_UsageApi_H_
#define HANZO_API_UsageApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/DashResp.h"
#include "hanzo/model/ReportReq.h"
#include "hanzo/model/ReportResp.h"
#include "hanzo/model/UsageAnalyticsAccess.h"
#include "hanzo/model/UsageAnalyticsView.h"
#include "hanzo/model/UsageSummary.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class UsageApi
{
public:
explicit UsageApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~UsageApi();
/// <summary>
/// Is the entitlement-GATED per-provider breakdown of the caller org&#39;s LLM usage — the paid lens over the same warehouse ledger GET /v1/usage/summary reads its totals from.
/// </summary>
/// <remarks>
/// Is the entitlement-GATED per-provider breakdown of the caller org&#39;s LLM usage — the paid lens over the same warehouse ledger GET /v1/usage/summary reads its totals from. Basic own-org usage stays ungated at /v1/usage/summary. A plan that does not grant the analytics datastore is refused with 402, and an unresolvable plan fails closed to the free floor, which does not grant it. The window is clamped forward to the plan&#39;s retention entitlement, so a tenant can never read older than its plan allows even with a custom start. The response is marked no-store. INTERIM (mirrors apps/world&#39;s limits echo): no org→plan resolver exists in cloud yet — the subscription lookup is owned by the billing plane and the gateway principal carries no plan claim — so the caller passes the plan and the gate resolves THAT plan&#39;s access.
/// </remarks>
/// <param name="end">End is the exclusive window end, RFC3339. Read only when Range is custom. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="plan">Plan is the plan id whose entitlement decides access and retention. INTERIM: cloud has no org-to-plan resolver yet, so the caller names the plan; when that resolver lands this becomes the caller org&#39;s own plan. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="range">Range is the window: a count and a unit — 24h, 7d, 90d, any &lt;N&gt;h or &lt;N&gt;d — or day, week, month, all, custom. Empty means 24h. The window is then clamped forward to the plan&#39;s retention entitlement. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="start">Start is the inclusive window start, RFC3339. Read only when Range is custom, and clamped forward to the plan&#39;s retention floor. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<UsageAnalyticsView>> getUsageAnalytics(
boost::optional<utility::string_t> end,
boost::optional<utility::string_t> plan,
boost::optional<utility::string_t> range,
boost::optional<utility::string_t> start
) const;
/// <summary>
/// Echoes a plan&#39;s resolved analytics entitlement so a dashboard can configure itself against the LIVE catalog instead of hardcoding tier numbers.
/// </summary>
/// <remarks>
/// Echoes a plan&#39;s resolved analytics entitlement so a dashboard can configure itself against the LIVE catalog instead of hardcoding tier numbers. An empty plan resolves the free floor, and a catalog resolution failure serves that same floor rather than erroring — so this always answers 200. It is a read-only contract echo and carries no tenant data.
/// </remarks>
/// <param name="plan">Plan is a plan id from the live @hanzo/plans catalog. Empty resolves the free floor, and so does an id the catalog does not know — this never fails on an unknown plan. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<UsageAnalyticsAccess>> getUsageAnalyticsAccess(
boost::optional<utility::string_t> plan
) const;
/// <summary>
/// Is the PER-PROVIDER view: one connected account&#39;s own consumption of its own plan — \&quot;my plan is 47% through its 6h window, resets at 14:20\&quot;.
/// </summary>
/// <remarks>
/// Is the PER-PROVIDER view: one connected account&#39;s own consumption of its own plan — \&quot;my plan is 47% through its 6h window, resets at 14:20\&quot;. &#x60;current&#x60; is the newest instance of each lane (the headline); &#x60;windows&#x60; is the history behind it. Both come from ONE deduped read, so they can never disagree. The rows are the caller&#39;s OWN linked accounts, scoped to the validated principal and its subject — never another user&#39;s, and never another org&#39;s.
/// </remarks>
/// <param name="account">Account narrows to ONE linked account of that provider. Empty covers every account the caller has linked there. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="provider">Provider is the upstream to read, e.g. anthropic. Required. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="range">Range is the window to read: a count and a unit — 1h, 24h, 90d, any &lt;N&gt;h or &lt;N&gt;d — or day, week, month, all. Empty means 24h. A label that is not a count, or one reaching past the 730-day horizon, is refused rather than silently replaced. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="window">Window narrows to ONE window class: 6h, day, week or month. Empty covers every class. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<DashResp>> getUsageSamples(
boost::optional<utility::string_t> account,
boost::optional<utility::string_t> provider,
boost::optional<utility::string_t> range,
boost::optional<utility::string_t> window
) const;
/// <summary>
/// Answers GET /v1/usage/summary: the caller&#39;s own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org&#39;s LLM usage totals from the warehouse, and the caller&#39;s OWN linked provider accounts beside the org&#39;s Hanzo-routed usage.
/// </summary>
/// <remarks>
/// Answers GET /v1/usage/summary: the caller&#39;s own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org&#39;s LLM usage totals from the warehouse, and the caller&#39;s OWN linked provider accounts beside the org&#39;s Hanzo-routed usage. Every source degrades INDEPENDENTLY to honest zeros and says so in &#x60;sources&#x60; and in its own &#x60;available&#x60; flag, so a partial deploy reports \&quot;no data\&quot; rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan&#39;s percent is not money. The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.
/// </remarks>
/// <param name="range">Range is the window: a count and a unit — 24h, 7d, 90d, any &lt;N&gt;h or &lt;N&gt;d — or day, week, month, all, custom. Empty means 24h. A label this surface does not know, or one reaching past the 730-day horizon, is refused rather than silently replaced. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="start">Start is the inclusive window start, RFC3339. Read only when Range is custom. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="end">End is the exclusive window end, RFC3339. Read only when Range is custom. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<UsageSummary>> getUsageSummary(
boost::optional<utility::string_t> range,
boost::optional<utility::string_t> start,
boost::optional<utility::string_t> end
) const;
/// <summary>
/// Ingests a batch of account-usage samples — what a developer&#39;s OWN AI accounts have consumed of their OWN plans, metered from each provider&#39;s own login — and appends them to the warehouse series.
/// </summary>
/// <remarks>
/// Ingests a batch of account-usage samples — what a developer&#39;s OWN AI accounts have consumed of their OWN plans, metered from each provider&#39;s own login — and appends them to the warehouse series. Answers 202. Send either a &#x60;samples&#x60; array or one sample&#39;s fields at the top level. Every sample needs a provider, a machine and a known window class; an unknown window or kind is refused rather than silently rewritten, because a dash filled with a class nobody reported is worse than an error. There is no timestamp field: the server owns the observation clock, and a sample says which window it measured with windowStart or resetsAt. It is FAIL-SOFT on storage: a warehouse outage costs a poll of history (stored:false), never a failed request. It records usage ONLY — the link registry is refreshed separately via POST /v1/link, so there is one and only one way to update an account row.
/// </remarks>
/// <param name="reportReq"></param>
pplx::task<std::shared_ptr<ReportResp>> postUsage(
std::shared_ptr<ReportReq> reportReq
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_UsageApi_H_ */