Files
zeekay 189ce08e51 Regenerate against the document the deployment answers for
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.
2026-09-05 18:07:13 -07:00

128 lines
8.6 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.
*/
/*
* ContentApi.h
*
*
*/
#ifndef HANZO_API_ContentApi_H_
#define HANZO_API_ContentApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/BoardPage.h"
#include "hanzo/model/ChannelList.h"
#include "hanzo/model/GenerateInput.h"
#include "hanzo/model/GenerateResult.h"
#include "hanzo/model/PublishInput.h"
#include "hanzo/model/PublishResult.h"
#include "hanzo/model/StateGraph.h"
#include "hanzo/model/TransitionIn.h"
#include "hanzo/model/TransitionResult.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class ContentApi
{
public:
explicit ContentApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~ContentApi();
/// <summary>
/// Aggregates the caller org&#39;s marketing content across every publishable content type into ONE queue board — the cross-type read the framework&#39;s per-DocType list cannot give.
/// </summary>
/// <remarks>
/// Aggregates the caller org&#39;s marketing content across every publishable content type into ONE queue board — the cross-type read the framework&#39;s per-DocType list cannot give. It never fails on a partial outage: a content type the org has not installed, or one whose search errors, is skipped and logged rather than failing the whole board.
/// </remarks>
/// <param name="status">Status keeps only items in one lifecycle state (draft, in_review, approved, queued, published, archived). An undefined state is refused. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="project">Project keeps only items in one brand/site sub-scope. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="doctype">DocType keeps only one content type; omitted, the board spans every publishable type. An unknown type is refused. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="limit">Limit caps the rows returned, clamped to 1000. Defaults to 200, which is also what a non-positive or unparseable value takes. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<BoardPage>> getContentBoard(
boost::optional<utility::string_t> status,
boost::optional<utility::string_t> project,
boost::optional<utility::string_t> doctype,
boost::optional<int64_t> limit
) const;
/// <summary>
/// Lists the distribution channels the caller&#39;s org has connected — the social integrations a publish can target.
/// </summary>
/// <remarks>
/// Lists the distribution channels the caller&#39;s org has connected — the social integrations a publish can target. A deployment with no distribution edge wired answers 503 rather than an empty list that would read as \&quot;no channels\&quot;.
/// </remarks>
pplx::task<std::shared_ptr<ChannelList>> getContentChannels(
) const;
/// <summary>
/// Returns the ONE marketing-content state machine: the ordered lifecycle states, which state a fresh document starts in, which one is publicly live, and the legal successors of every state.
/// </summary>
/// <remarks>
/// Returns the ONE marketing-content state machine: the ordered lifecycle states, which state a fresh document starts in, which one is publicly live, and the legal successors of every state. The console builds its board columns and its per-item action buttons from this single answer, so the UI and the write-time enforcement hook can never disagree about what is legal.
/// </remarks>
pplx::task<std::shared_ptr<StateGraph>> getContentLifecycle(
) const;
/// <summary>
/// Moves one content item to a new lifecycle state and, on the move to published, fans it out to the item&#39;s channels.
/// </summary>
/// <remarks>
/// Moves one content item to a new lifecycle state and, on the move to published, fans it out to the item&#39;s channels. The edge must be legal for the item&#39;s current state — an illegal move is refused with 409 — and the status write re-validates it at the storage boundary. Distribution is best effort: its honest state is reported on the result and a distribution failure never rolls the status change back.
/// </remarks>
/// <param name="doctype">DocType is the content type to act on, from the path.</param>
/// <param name="name">Name is the document to act on, from the path.</param>
/// <param name="transitionIn"></param>
pplx::task<std::shared_ptr<TransitionResult>> postContentByDoctypeByNameTransition(
utility::string_t doctype,
utility::string_t name,
std::shared_ptr<TransitionIn> transitionIn
) const;
/// <summary>
/// Draft a piece of marketing content and file it in the CMS as a draft.
/// </summary>
/// <remarks>
/// Draft a piece of marketing content and file it in the CMS as a draft. Answers 201 with the created draft&#39;s identity — {doctype, name, status} — and the document itself lands in the CMS through the SAME validate and lifecycle-hook pipeline an ordinary create runs. This is a WRITE, not a preview: there is no dry-run, and every call that succeeds leaves a document behind. &#x60;doctype&#x60; picks which of two generation planes runs, and they are the only two. Campaign and SocialPost are drafted as brand COPY on the platform AI plane (zen5 by default, overridable per request with &#x60;model&#x60; or per deployment); Asset is a studio image render the AI plane never sees. Everything else about the call is identical. MONEY, metered in exactly one place per mode and never both. Copy rides the platform&#39;s own inference meter — the org&#39;s balance is authorised before the model call and debited at the exact token cost after — so content never re-bills it. A studio render is invisible to that meter, so content is the sole meter for it: the org is gated BEFORE the GPU compute and refused 402 when out of funds or over its spend cap, and the debit is recorded only once the render actually returns, because the billable event is the consumed compute and not the CMS row. &#x60;project&#x60; rides the BODY rather than a server-minted identity claim, so it attributes spend but a project-scoped cap stays soft on it — the org is the value that is enforced. The org is the caller&#39;s own, resolved once from the validated principal and never read from the body; a caller without one is refused 403. Status is not the generator&#39;s to choose: a generated item is ALWAYS a draft, and the storage-boundary hook enforces that a second time. It fails closed rather than inventing anything. An unknown content type is 404 and a deployment whose marketing module is not installed is 409 naming the install call. An AI plane or studio that is unconfigured or unreachable, a graph the studio rejects, and a render that does not return in time all degrade to 503 — never fabricated copy, never a fake render. A &#x60;source_media&#x60; that fails the SSRF and traversal validator is 400 raised before the billing gate and before the studio is contacted, so a hostile source never costs the caller anything.
/// </remarks>
/// <param name="generateInput"></param>
pplx::task<std::shared_ptr<GenerateResult>> postContentGenerate(
std::shared_ptr<GenerateInput> generateInput
) const;
/// <summary>
/// Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome.
/// </summary>
/// <remarks>
/// Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome. The item names itself — its caption, media and channel list are read from the stored document, not from this request. It is idempotent per channel (a channel already posted for this item is skipped), and a publish that loses the per-item lease to a live publisher answers status \&quot;in_progress\&quot; having posted nothing.
/// </remarks>
/// <param name="publishInput"></param>
pplx::task<std::shared_ptr<PublishResult>> postContentPublish(
std::shared_ptr<PublishInput> publishInput
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_ContentApi_H_ */