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.
99 lines
5.3 KiB
C++
99 lines
5.3 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.
|
|
*/
|
|
|
|
/*
|
|
* BotApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_BotApi_H_
|
|
#define HANZO_API_BotApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/BotRoster.h"
|
|
#include "hanzo/model/BotRuns.h"
|
|
#include "hanzo/model/BotStopped.h"
|
|
#include "hanzo/model/BotSync.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class BotApi
|
|
{
|
|
public:
|
|
|
|
explicit BotApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~BotApi();
|
|
|
|
/// <summary>
|
|
/// Returns the caller org's bots as space members — each with the member account uuid and the Person reference the roster addresses it by.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's bots as space members — each with the member account uuid and the Person reference the roster addresses it by. A deployment that runs no team subsystem has no spaces and therefore no roster, which is an empty list rather than an error: ErrNoPeer is the ONE error that means \"this deployment does not run that app\", and every other failure is an outage and says so.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<BotRoster>> getBotMembers(
|
|
) const;
|
|
/// <summary>
|
|
/// List returns the caller org's live bot runs, read from the bot runtime and projected into the console contract with each run's live session URL derived here.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// List returns the caller org's live bot runs, read from the bot runtime and projected into the console contract with each run's live session URL derived here. The org is ALWAYS the validated principal's org, NEVER a request field, and it is what scopes the runtime's answer — so one tenant can never enumerate another's runs. A runtime that cannot answer is an error, not an empty list: [] would tell the caller \"your org has no runs\", which is a different claim from \"we could not ask\", and the difference is the whole reason this endpoint exists.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<BotRuns>> getBotRuns(
|
|
) const;
|
|
/// <summary>
|
|
/// Re-projects the caller org's bots as members into every space of the org and removes the ones whose agent is gone.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Re-projects the caller org's bots as members into every space of the org and removes the ones whose agent is gone. Idempotent, and admin only — the admin bit rides the caller to team, which is what decides it.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<BotSync>> postBotMembersSync(
|
|
) const;
|
|
/// <summary>
|
|
/// Answers 501 to every call: launching a bot run is not implemented.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers 501 to every call: launching a bot run is not implemented. The bot runtime exposes no launch operation, so nothing here can start a sandbox. This address is published rather than dropped because it is the collection every run is created in: GET lists them, POST would launch one. The refusal is total and takes no input. No run id is minted, no session URL is handed back, and no per-run fee is charged. That is the point: the earlier version minted an id the runtime had never heard of, pointed it at a VNC node that did not exist, and took real money for it. 501 is the truth, and the truth is cheaper than a plausible lie. Listing and stopping runs are live and org-scoped. Only the launch is missing, and it returns in the same change that can prove a bot boots — a runtime-side launch operation first (TS, cross-repo), with the entitlement gate and the meter beside it.
|
|
/// </remarks>
|
|
pplx::task<void> postBotRuns(
|
|
) const;
|
|
/// <summary>
|
|
/// Stop terminates one of the caller org's own bot runs and reports its terminal state.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Stop terminates one of the caller org's own bot runs and reports its terminal state. The own-key guard is the org: it is the caller's validated org, never theirs to choose, and the runtime resolves the run id UNDER it. A run belonging to another tenant is not among this org's runs, so it answers absent — the same 404 a nonexistent id gets, which is what keeps this from being an oracle. Absence is honoured ONLY when the runtime answers it. A runtime that does not serve stop reports nothing about the run, and reporting \"stopped\" on that basis would be a stop that cannot fail — so it is a 502.
|
|
/// </remarks>
|
|
/// <param name="runId">RunID is the run to stop, as the bot runtime named it. It is read from the URL — the `{runId}` segment the router matched on — and a body carrying a different id cannot redirect the stop.</param>
|
|
pplx::task<std::shared_ptr<BotStopped>> postBotRunsByRunidStop(
|
|
utility::string_t runId
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_BotApi_H_ */
|
|
|