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.
120 lines
7.1 KiB
C++
120 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.
|
|
*/
|
|
|
|
/*
|
|
* LeaderboardApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_LeaderboardApi_H_
|
|
#define HANZO_API_LeaderboardApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/ActivityView.h"
|
|
#include "hanzo/model/LeaderboardView.h"
|
|
#include "hanzo/model/OptinView.h"
|
|
#include "hanzo/model/OrgOptinReq.h"
|
|
#include "hanzo/model/OrgOptinView.h"
|
|
#include "hanzo/model/UserOptinReq.h"
|
|
#include "hanzo/model/UserOptinView.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class LeaderboardApi
|
|
{
|
|
public:
|
|
|
|
explicit LeaderboardApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~LeaderboardApi();
|
|
|
|
/// <summary>
|
|
/// Leaderboard ranks AI usage over a window, either the users of the caller's own org or organizations against each other, and always reports the caller's own standing even when it falls outside the returned page.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Leaderboard ranks AI usage over a window, either the users of the caller's own org or organizations against each other, and always reports the caller's own standing even when it falls outside the returned page. Identities are private by default: a caller sees themselves, plus the peers or orgs that opted into public listing, and only an admin sees their own org's members named. Cross-org spend is restricted to platform admins. When the warehouse is not connected the board answers empty with available=false rather than a fabricated rank.
|
|
/// </remarks>
|
|
/// <param name="scope">Scope picks the board: \"personal\" (default) ranks the caller among their own org's users, \"org\" is that same org board named for an admin, \"global\" ranks organizations against each other. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="metric">Metric is the value ranked: tokens (default), requests, or cost. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="period">Period is the window ranked: day, week, month (default) or all. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="limit">Limit caps the rows returned, clamped to 100. Defaults to 10, which is also what a non-positive or unparseable value takes. (optional, default to 0L)</param>
|
|
pplx::task<std::shared_ptr<LeaderboardView>> getLeaderboard(
|
|
boost::optional<utility::string_t> scope,
|
|
boost::optional<utility::string_t> metric,
|
|
boost::optional<utility::string_t> period,
|
|
boost::optional<int64_t> limit
|
|
) const;
|
|
/// <summary>
|
|
/// Activity returns the per-day usage series for ONE authorized subject — the points a contribution heatmap and a timeline are drawn from, gap-filled so every day in the range is present.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Activity returns the per-day usage series for ONE authorized subject — the points a contribution heatmap and a timeline are drawn from, gap-filled so every day in the range is present. Authorization is resolved server-side from the validated principal, so a caller can never widen the subject past what they are entitled to: a non-admin reads only themselves and their own org. subject=project answers empty with a note, because the usage ledger records no project column yet. When the warehouse is not connected the series answers empty with available=false rather than fabricated days.
|
|
/// </remarks>
|
|
/// <param name="subject">Subject is what the series is about: \"user\" (default), \"org\" or \"project\". (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="id">ID names the subject within what the caller is entitled to see. Omitted (or \"me\") it is the caller themselves, or their own org. Another user requires org admin and must belong to the caller's org; another org requires a SuperAdmin. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="from">From is the first day of the range, \"2006-01-02\". Defaults to 90 days back. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="to">To is the last day of the range, \"2006-01-02\". Defaults to today; the span is clamped to 366 days. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<ActivityView>> getLeaderboardActivity(
|
|
boost::optional<utility::string_t> subject,
|
|
boost::optional<utility::string_t> id,
|
|
boost::optional<utility::string_t> from,
|
|
boost::optional<utility::string_t> to
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller's own public-listing preference and their org's, each with whether the caller may change it.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller's own public-listing preference and their org's, each with whether the caller may change it. Public listing is opt-in and private by default, so a fresh caller reads listed=false for both.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<OptinView>> getLeaderboardOptin(
|
|
) const;
|
|
/// <summary>
|
|
/// Sets the CALLER's own public-listing preference on the leaderboard.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Sets the CALLER's own public-listing preference on the leaderboard. Self only: the row written is keyed by the caller's validated ledger identity, so this can never edit another member's visibility whatever the request says. A caller opting in with no handle is given their username, so a listed row never renders as \"Anonymous\" to its own owner.
|
|
/// </remarks>
|
|
/// <param name="userOptinReq"></param>
|
|
pplx::task<std::shared_ptr<UserOptinView>> putLeaderboardOptin(
|
|
std::shared_ptr<UserOptinReq> userOptinReq
|
|
) const;
|
|
/// <summary>
|
|
/// Sets the ORG's listing on the cross-org global board.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Sets the ORG's listing on the cross-org global board. Only an admin of the caller's own org — an org admin or a platform SuperAdmin — may change it, and the org written is the caller's validated tenant, never a value from the request. Listing consents to publishing the org's usage VOLUME; cross-org spend stays restricted to platform admins regardless.
|
|
/// </remarks>
|
|
/// <param name="orgOptinReq"></param>
|
|
pplx::task<std::shared_ptr<OrgOptinView>> putLeaderboardOptinOrg(
|
|
std::shared_ptr<OrgOptinReq> orgOptinReq
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_LeaderboardApi_H_ */
|
|
|