mirror of
https://github.com/hanzo-cpp/sdk.git
synced 2026-11-20 19:55:32 +00:00
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.
73 lines
3.0 KiB
C++
73 lines
3.0 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.
|
|
*/
|
|
|
|
/*
|
|
* ReferralApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_ReferralApi_H_
|
|
#define HANZO_API_ReferralApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/ClaimRequest.h"
|
|
#include "hanzo/model/ClaimView.h"
|
|
#include "hanzo/model/MyReferrals.h"
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class ReferralApi
|
|
{
|
|
public:
|
|
|
|
explicit ReferralApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~ReferralApi();
|
|
|
|
/// <summary>
|
|
/// Returns the caller's referral code, share link and the referrals they have made.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller's referral code, share link and the referrals they have made. The code is a stable, deterministic function of the org, so the link in this response is the same one every time. Each row carries the referee and the status of that attribution. IT IS A PURE READ. It advances no referral, grants nothing and deposits nothing — a GET reports state, it never changes it. Qualification is the admin sweep's job (POST /v1/admin/referral/sweep). The one row this handler can write is the caller's OWN code-directory entry (EnsureCode), which materialises a value deriveCode already computes deterministically from the org id so the code has an O(1) reverse lookup; it carries no money, no referral state and no other tenant.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<MyReferrals>> getReferral(
|
|
) const;
|
|
/// <summary>
|
|
/// Records that the caller's org signed up through a referral code.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Records that the caller's org signed up through a referral code. The REFEREE is the validated caller, never a client field, and the referrer is resolved from the code — so a caller can only ever attach THEMSELVES to someone else's code. Referring yourself is 400 and an unknown code is 404. It is idempotent and first-touch: an org can be referred once, ever. A repeat call returns the referral already on file with created=false and 200, where the first call answers 201. Recording a referral grants nothing, and neither does anything downstream of it: the edge later advances to qualified when the referee makes metered spend (POST /v1/admin/referral/sweep), and that is the end of it. No credit is ever issued from this package.
|
|
/// </remarks>
|
|
/// <param name="claimRequest"></param>
|
|
pplx::task<std::shared_ptr<ClaimView>> postReferralClaim(
|
|
std::shared_ptr<ClaimRequest> claimRequest
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_ReferralApi_H_ */
|
|
|