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

97 lines
5.7 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.
*/
/*
* ValidatorApi.h
*
*
*/
#ifndef HANZO_API_ValidatorApi_H_
#define HANZO_API_ValidatorApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/ChallengeView.h"
#include "hanzo/model/SlotView.h"
#include "hanzo/model/ValidatorClaim.h"
#include "hanzo/model/ValidatorList.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class ValidatorApi
{
public:
explicit ValidatorApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~ValidatorApi();
/// <summary>
/// Returns the validator slots the caller&#39;s org has claimed.
/// </summary>
/// <remarks>
/// Returns the validator slots the caller&#39;s org has claimed. One entry per claimed slot with its node identity, its live-ish node status and the owner-gated registration queued for it, if any. Slots are org-scoped by the validated identity, so a caller can only ever see their own — a slot claimed by another org is not merely hidden from this list, it is unreachable through the whole surface.
/// </remarks>
/// <param name="limit">Limit is how many slots to return, as a decimal string in the &#x60;?limit&#x3D;&#x60; query. Absent, unparseable or non-positive means 200; over 1000 is clamped to 1000. It is a string rather than a number because the parse that has always served this route trims surrounding whitespace, and one parse rule is better than two. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<ValidatorList>> getValidator(
boost::optional<utility::string_t> limit
) const;
/// <summary>
/// Returns one claimed validator slot, scoped to the caller&#39;s org.
/// </summary>
/// <remarks>
/// Returns one claimed validator slot, scoped to the caller&#39;s org. A slot another org holds, and a slot nobody holds, are both 404 — never a different status, so this route cannot be used to probe which slots are taken.
/// </remarks>
/// <param name="tokenId">TokenID is the slot&#39;s GenesisNFT token id, from the path, as a decimal string. A value that is not a positive integer is 400. It is a string rather than a number because the parse that has always served this route trims surrounding whitespace, and one parse rule is better than two.</param>
pplx::task<std::shared_ptr<SlotView>> getValidatorByTokenid(
utility::string_t tokenId
) const;
/// <summary>
/// Issues the single-use nonce and the exact message a wallet must sign to claim a validator slot.
/// </summary>
/// <remarks>
/// Issues the single-use nonce and the exact message a wallet must sign to claim a validator slot. The nonce is bound to (validated org, slot) and stored server-side, so a signature obtained for one org or one slot can never be replayed for another, and the message POST /v1/validator verifies is rebuilt from those same server facts rather than trusted from the caller. Redeem it with POST /v1/validator before it expires; it can be redeemed once. A tokenId outside the Validator tier is refused here rather than after signing.
/// </remarks>
/// <param name="tokenId">TokenID is the Validator-tier GenesisNFT token id, as a decimal string in the &#x60;?tokenId&#x3D;&#x60; query. A value that is not a positive integer is 400. It is a string rather than a number because the parse that has always served this route trims surrounding whitespace, and one parse rule is better than two. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<ChallengeView>> getValidatorChallenge(
boost::optional<utility::string_t> tokenId
) const;
/// <summary>
/// Claims a validator slot and provisions its node, after proving the caller&#39;s wallet owns the slot&#39;s NFT.
/// </summary>
/// <remarks>
/// Claims a validator slot and provisions its node, after proving the caller&#39;s wallet owns the slot&#39;s NFT. The pipeline, all server-enforced: burn the single-use challenge (so a replayed or forged nonce dies before any chain read), recover the signer from the message this server rebuilds, require that wallet to hold Validator-tier GenesisNFT #tokenId on Ethereum mainnet, generate a fresh luxd staking identity and seal it into KMS, write a LuxNetwork CR for a NEW node, and ENQUEUE an owner-gated registration. The registration is never auto-submitted to any P-Chain — the owner co-signs it out of band — and the stake weight is set at co-sign time, never derived from the NFT. It fails CLOSED at every gate: a bad signature, a non-owner, a non-tier slot or an unavailable KMS all leave no claim persisted and no key material exposed. Re-claiming a slot this org already holds re-applies the node CR and returns 200 with the existing identity (keys and NodeID are stable); a slot held by another org is 409. A cluster-less deployment still claims the slot, seals the keys and queues the registration, reporting the node as \&quot;node_pending\&quot;.
/// </remarks>
/// <param name="validatorClaim"></param>
pplx::task<std::shared_ptr<SlotView>> postValidator(
std::shared_ptr<ValidatorClaim> validatorClaim
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_ValidatorApi_H_ */