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.
378 lines
21 KiB
C++
378 lines
21 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.
|
|
*/
|
|
|
|
/*
|
|
* CaptableApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_CaptableApi_H_
|
|
#define HANZO_API_CaptableApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/CaptableCompany.h"
|
|
#include "hanzo/model/CaptableCompanyUpdate.h"
|
|
#include "hanzo/model/CaptableConvertibleIn.h"
|
|
#include "hanzo/model/CaptableCreated.h"
|
|
#include "hanzo/model/CaptableDeleted.h"
|
|
#include "hanzo/model/CaptableEquityPlanIn.h"
|
|
#include "hanzo/model/CaptableEquityPlans.h"
|
|
#include "hanzo/model/CaptableInvested.h"
|
|
#include "hanzo/model/CaptableInvestmentIn.h"
|
|
#include "hanzo/model/CaptableInvestments.h"
|
|
#include "hanzo/model/CaptableNotes.h"
|
|
#include "hanzo/model/CaptableOptionIn.h"
|
|
#include "hanzo/model/CaptableOptions.h"
|
|
#include "hanzo/model/CaptableRoundCloseRequest.h"
|
|
#include "hanzo/model/CaptableRoundDetail.h"
|
|
#include "hanzo/model/CaptableRoundIn.h"
|
|
#include "hanzo/model/CaptableRounds.h"
|
|
#include "hanzo/model/CaptableSafeIn.h"
|
|
#include "hanzo/model/CaptableSafes.h"
|
|
#include "hanzo/model/CaptableShareClass.h"
|
|
#include "hanzo/model/CaptableShareClassAmend.h"
|
|
#include "hanzo/model/CaptableShareClassIn.h"
|
|
#include "hanzo/model/CaptableShareIn.h"
|
|
#include "hanzo/model/CaptableShareTransfer.h"
|
|
#include "hanzo/model/CaptableShares.h"
|
|
#include "hanzo/model/CaptableStakeholder.h"
|
|
#include "hanzo/model/CaptableStakeholderPatch.h"
|
|
#include "hanzo/model/CaptableSummary.h"
|
|
#include "hanzo/model/CaptableTransferred.h"
|
|
#include "hanzo/model/CaptableUpdated.h"
|
|
#include <vector>
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class CaptableApi
|
|
{
|
|
public:
|
|
|
|
explicit CaptableApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~CaptableApi();
|
|
|
|
/// <summary>
|
|
/// Removes one of the caller org's convertible notes, taking its principal out of the cap table's unconverted-instrument totals.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one of the caller org's convertible notes, taking its principal out of the cap table's unconverted-instrument totals. An id this org does not hold is not found.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the convertible note to delete.</param>
|
|
pplx::task<std::shared_ptr<CaptableDeleted>> deleteCaptableConvertiblesById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Removes one of the caller org's option grants, taking its shares out of the cap table's granted-options and fully-diluted counts.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one of the caller org's option grants, taking its shares out of the cap table's granted-options and fully-diluted counts. An id this org does not hold is not found.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the option grant to delete.</param>
|
|
pplx::task<std::shared_ptr<CaptableDeleted>> deleteCaptableOptionsById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Removes one of the caller org's SAFEs, taking its capital out of the cap table's unconverted-instrument totals.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one of the caller org's SAFEs, taking its capital out of the cap table's unconverted-instrument totals. An id this org does not hold is not found.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the SAFE to delete.</param>
|
|
pplx::task<std::shared_ptr<CaptableDeleted>> deleteCaptableSafesById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Removes one of the caller org's share certificates, taking its shares out of the cap table's outstanding and fully-diluted counts.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one of the caller org's share certificates, taking its shares out of the cap table's outstanding and fully-diluted counts. An id this org does not hold is not found.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the share certificate to delete.</param>
|
|
pplx::task<std::shared_ptr<CaptableDeleted>> deleteCaptableSharesById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Removes one of the caller org's stakeholders.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one of the caller org's stakeholders. It REFUSES to orphan issued equity: a holder that still holds share certificates or option grants cannot be deleted, and answers 400 saying so — release or transfer the holdings first. An id this org does not hold is not found.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the stakeholder to delete.</param>
|
|
pplx::task<std::shared_ptr<CaptableDeleted>> deleteCaptableStakeholdersById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's share classes, in creation order.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's share classes, in creation order. A share class is what a certificate is issued in, and every class the company has authorized appears. The response is a bare JSON array, not an envelope.
|
|
/// </remarks>
|
|
pplx::task<std::vector<std::shared_ptr<CaptableShareClass>>> getCaptableClasses(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's cap-table company record.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's cap-table company record. The row is seeded when the tenant's store first opens, so it always exists; its name and incorporation details are set with PUT /v1/captable/company.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableCompany>> getCaptableCompany(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's convertible notes, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's convertible notes, newest first. A note's principal sits OUTSIDE issued equity until it converts, so it is not part of the share counts.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableNotes>> getCaptableConvertibles(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's investments, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's investments, newest first. It spans every round, so it is the flat ledger of cheques written into the company, each naming its investor and the round it went into.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableInvestments>> getCaptableInvestments(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's option grants, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's option grants, newest first. Each row is joined to its grantee and its equity plan. Grants that are EXERCISED, EXPIRED or CANCELLED are listed here but do not dilute the cap table.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableOptions>> getCaptableOptions(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's equity plans, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's equity plans, newest first. An equity plan is an option pool: a reserve of shares, drawn from one share class, that option grants are written against.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableEquityPlans>> getCaptablePlans(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's fundraising rounds, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's fundraising rounds, newest first. A round groups a fundraising event; a PRICED round also carries the share class and price per share it issues at.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableRounds>> getCaptableRounds(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns one of the caller org's fundraising rounds together with every investment written into it, oldest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns one of the caller org's fundraising rounds together with every investment written into it, oldest first. A round id that does not exist in the caller's org is not found — including one that exists in another tenant, since the org comes from the caller's principal and is part of the lookup.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the round to read. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an id from another tenant is simply not found.</param>
|
|
pplx::task<std::shared_ptr<CaptableRoundDetail>> getCaptableRoundsById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's SAFEs, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's SAFEs, newest first. A SAFE is a simple agreement for future equity: its capital sits OUTSIDE issued equity until it converts, so it is not part of the share counts.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableSafes>> getCaptableSafes(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's share certificates, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's share certificates, newest first. Each row is joined to its holder and its share class, so a certificate names who holds it and what class it is in without a second call.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableShares>> getCaptableShares(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the caller org's stakeholders, newest first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the caller org's stakeholders, newest first. The response is a bare JSON array, not an envelope. Each row carries the holder's contact and address fields alongside the company's name.
|
|
/// </remarks>
|
|
pplx::task<std::vector<std::shared_ptr<CaptableStakeholder>>> getCaptableStakeholders(
|
|
) const;
|
|
/// <summary>
|
|
/// Computes the caller org's cap table.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Computes the caller org's cap table. It answers who owns what on a fully-diluted basis: outstanding shares, granted options, per-stakeholder ownership percentages, each share class's authorized versus issued position, and the capital sitting on SAFEs and convertible notes that have not yet converted. Only non-terminal option grants dilute — EXERCISED, EXPIRED and CANCELLED grants are excluded, so equity issued through an exercised option is never counted twice.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<CaptableSummary>> getCaptableSummary(
|
|
) const;
|
|
/// <summary>
|
|
/// Replaces one share class's terms.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Replaces one share class's terms. It is a full REPLACE and not a merge, despite the PATCH: every field is written as sent, so a field omitted is written empty rather than left alone. Send the whole class. The method is PATCH because the resource is addressed by id, not because the body is partial — and getting that backwards silently blanks terms every later issuance prices against.
|
|
/// </remarks>
|
|
/// <param name="id">ID addresses the resource. The URL is the addressing authority — a path segment binds after the body and after the query — so the address decides which row is written whatever a body claims.</param>
|
|
/// <param name="captableShareClassAmend"></param>
|
|
pplx::task<std::shared_ptr<CaptableUpdated>> patchCaptableClassesById(
|
|
utility::string_t id,
|
|
std::shared_ptr<CaptableShareClassAmend> captableShareClassAmend
|
|
) const;
|
|
/// <summary>
|
|
/// Changes one of the caller org's stakeholders.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Changes one of the caller org's stakeholders. It is a PARTIAL update: only the fields the request names are written, and a field sent as null clears that column. A request that names no updatable field is refused, and an id this org does not hold is not found. The values are stored as sent. Unlike adding a stakeholder, this route does not check the email's shape or the type and relationship vocabularies, so it can record a value that adding one would have rejected.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the stakeholder to update. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an id from another tenant is simply not found.</param>
|
|
/// <param name="captableStakeholderPatch"></param>
|
|
pplx::task<std::shared_ptr<CaptableUpdated>> patchCaptableStakeholdersById(
|
|
utility::string_t id,
|
|
std::shared_ptr<CaptableStakeholderPatch> captableStakeholderPatch
|
|
) const;
|
|
/// <summary>
|
|
/// Defines a new class of shares.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Defines a new class of shares. Every field but convertsToShareClassId is required — a class is the instrument every later issuance prices against, so a partially-specified one would silently mis-value every share issued into it. `seniority` orders liquidation preference with LOWER first.
|
|
/// </remarks>
|
|
/// <param name="captableShareClassIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableCreated>> postCaptableClasses(
|
|
std::shared_ptr<CaptableShareClassIn> captableShareClassIn
|
|
) const;
|
|
/// <summary>
|
|
/// Records a convertible note.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Records a convertible note.
|
|
/// </remarks>
|
|
/// <param name="captableConvertibleIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableCreated>> postCaptableConvertibles(
|
|
std::shared_ptr<CaptableConvertibleIn> captableConvertibleIn
|
|
) const;
|
|
/// <summary>
|
|
/// Grants options to a stakeholder from an equity plan.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Grants options to a stakeholder from an equity plan.
|
|
/// </remarks>
|
|
/// <param name="captableOptionIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableCreated>> postCaptableOptions(
|
|
std::shared_ptr<CaptableOptionIn> captableOptionIn
|
|
) const;
|
|
/// <summary>
|
|
/// Opens an equity plan that options are granted from.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Opens an equity plan that options are granted from.
|
|
/// </remarks>
|
|
/// <param name="captableEquityPlanIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableCreated>> postCaptablePlans(
|
|
std::shared_ptr<CaptableEquityPlanIn> captableEquityPlanIn
|
|
) const;
|
|
/// <summary>
|
|
/// Opens a priced round that investments can be added to.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Opens a priced round that investments can be added to. The round opens OPEN; investing into a closed one is refused.
|
|
/// </remarks>
|
|
/// <param name="captableRoundIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableCreated>> postCaptableRounds(
|
|
std::shared_ptr<CaptableRoundIn> captableRoundIn
|
|
) const;
|
|
/// <summary>
|
|
/// Closes one of the caller org's fundraising rounds, recording the close date and moving its status to CLOSED.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Closes one of the caller org's fundraising rounds, recording the close date and moving its status to CLOSED. Only an OPEN round can be closed: a round that is already closed — like an id this org does not hold — is not found. Closing a round does not change what was invested in it.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the round to close. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an id from another tenant is simply not found.</param>
|
|
/// <param name="captableRoundCloseRequest"></param>
|
|
pplx::task<std::shared_ptr<CaptableUpdated>> postCaptableRoundsByIdClose(
|
|
utility::string_t id,
|
|
std::shared_ptr<CaptableRoundCloseRequest> captableRoundCloseRequest
|
|
) const;
|
|
/// <summary>
|
|
/// Records one investor's money into an open round.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Records one investor's money into an open round. The round must be OPEN; investing into a closed one is refused. Where the round carries a price per share, the investment also issues the shares it buys and the answer names them.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the round to invest in. The URL is the addressing authority — a path segment binds after the body and after the query — so the address decides which round is written whatever a body claims.</param>
|
|
/// <param name="captableInvestmentIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableInvested>> postCaptableRoundsByIdInvestments(
|
|
utility::string_t id,
|
|
std::shared_ptr<CaptableInvestmentIn> captableInvestmentIn
|
|
) const;
|
|
/// <summary>
|
|
/// Records a SAFE — a simple agreement for future equity.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Records a SAFE — a simple agreement for future equity.
|
|
/// </remarks>
|
|
/// <param name="captableSafeIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableCreated>> postCaptableSafes(
|
|
std::shared_ptr<CaptableSafeIn> captableSafeIn
|
|
) const;
|
|
/// <summary>
|
|
/// Issues a share certificate to a stakeholder.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Issues a share certificate to a stakeholder. The certificate id must be UNIQUE within the company — a duplicate is refused 409, not silently merged — and both the stakeholder and the share class must belong to this company, so an id from another tenant is a 400 rather than a cross-company issuance.
|
|
/// </remarks>
|
|
/// <param name="captableShareIn"></param>
|
|
pplx::task<std::shared_ptr<CaptableCreated>> postCaptableShares(
|
|
std::shared_ptr<CaptableShareIn> captableShareIn
|
|
) const;
|
|
/// <summary>
|
|
/// Moves shares from one stakeholder to another.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Moves shares from one stakeholder to another. Omit `quantity` to transfer the whole certificate, which REASSIGNS it and mints no new share. Send a quantity below the amount held to SPLIT it — the source certificate keeps the remainder, and a split additionally requires `certificateId` for the new certificate, which must be unique in the company. A quantity outside 1..held is refused, so a transfer can never over-issue. Both outcomes answer 200: a transfer records a movement between holders and mints no security of its own, which is why this is not a 201 the way an investment is.
|
|
/// </remarks>
|
|
/// <param name="captableShareTransfer"></param>
|
|
pplx::task<std::shared_ptr<CaptableTransferred>> postCaptableSharesTransfer(
|
|
std::shared_ptr<CaptableShareTransfer> captableShareTransfer
|
|
) const;
|
|
/// <summary>
|
|
/// Add stakeholders to the cap table
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Records the people and institutions that can hold equity — the rows every share, option, SAFE, note and investment is issued to. The body is ONE stakeholder object or an ARRAY of them, and the array is the point: a whole roster loads in a single call. Email is the identity within the company, so a stakeholder whose email is already on the table is SKIPPED rather than duplicated or rejected — the 201 reports how many rows were actually inserted, which is what makes re-running an import safe. Validation is all-or-nothing across the batch: one bad entry refuses the whole array. Writes the caller's OWN cap table: the org resolved from the validated principal selects the tenant's store and scopes every row, so there is no field by which a caller can write into another company's table; a request with no validated org is refused. The whole write runs in one transaction, so a refusal leaves nothing behind. Validation is the cap-table bundle's and so is its refusal: a bad body comes back as {success:false, message, errors:[…]} with the failing fields listed, and numeric fields accept a number OR a numeric string. Bodies are capped at 1 MiB.
|
|
/// </remarks>
|
|
pplx::task<void> postCaptableStakeholders(
|
|
) const;
|
|
/// <summary>
|
|
/// Sets the caller org's company name and incorporation details.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Sets the caller org's company name and incorporation details. The name is required; the three incorporation fields are optional and each is stored as empty when omitted, so a call that sends only a name CLEARS them. The company row itself is seeded when the tenant's store first opens, so this never creates one.
|
|
/// </remarks>
|
|
/// <param name="captableCompanyUpdate"></param>
|
|
pplx::task<std::shared_ptr<CaptableUpdated>> putCaptableCompany(
|
|
std::shared_ptr<CaptableCompanyUpdate> captableCompanyUpdate
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_CaptableApi_H_ */
|
|
|