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

246 lines
14 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.
*/
/*
* AutoApi.h
*
*
*/
#ifndef HANZO_API_AutoApi_H_
#define HANZO_API_AutoApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/Catalog.h"
#include "hanzo/model/CreateFlowReq.h"
#include "hanzo/model/CreateVersionIn.h"
#include "hanzo/model/Flow.h"
#include "hanzo/model/FlowPage.h"
#include "hanzo/model/FlowRun.h"
#include "hanzo/model/FlowVersion.h"
#include "hanzo/model/PatchFlowIn.h"
#include "hanzo/model/PopulatedFlow.h"
#include "hanzo/model/RunIn.h"
#include "hanzo/model/RunPage.h"
#include "hanzo/model/RunResp.h"
#include "hanzo/model/VersionPage.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class AutoApi
{
public:
explicit AutoApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~AutoApi();
/// <summary>
/// Deletes one automation, its versions and its run history.
/// </summary>
/// <remarks>
/// Deletes one automation, its versions and its run history. It answers no content, and a flow of another org answers not-found.
/// </remarks>
/// <param name="id">ID is the flow to act on, from the path.</param>
pplx::task<void> deleteAutoFlowsById(
utility::string_t id
) const;
/// <summary>
/// Connectors returns the connector catalogue.
/// </summary>
/// <remarks>
/// Connectors returns the connector catalogue. Each entry is an external service a flow step can invoke, carrying its auth descriptor and the input properties of its actions and triggers. The catalogue is the same for every tenant, so the gate is a validated principal rather than a per-org view.
/// </remarks>
pplx::task<std::shared_ptr<Catalog>> getAutoConnectors(
) const;
/// <summary>
/// Returns the caller org&#39;s automations, most-recently-updated first.
/// </summary>
/// <remarks>
/// Returns the caller org&#39;s automations, most-recently-updated first. The optional &#x60;limit&#x60; query bounds the page.
/// </remarks>
/// <param name="limit">Limit bounds the page (default 200, maximum 1000). (optional, default to 0L)</param>
pplx::task<std::shared_ptr<FlowPage>> getAutoFlows(
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one automation and its latest version.
/// </summary>
/// <remarks>
/// Returns one automation and its latest version. That is the flow record plus the step tree the builder edits; a flow of another org answers not-found.
/// </remarks>
/// <param name="id">ID is the flow to act on, from the path.</param>
pplx::task<std::shared_ptr<PopulatedFlow>> getAutoFlowsById(
utility::string_t id
) const;
/// <summary>
/// Returns one flow&#39;s versions, newest first.
/// </summary>
/// <remarks>
/// Returns one flow&#39;s versions, newest first. The optional &#x60;limit&#x60; query bounds the page.
/// </remarks>
/// <param name="id">ID is the flow whose versions to list, from the path.</param>
/// <param name="limit">Limit bounds the page (default 200, maximum 1000). (optional, default to 0L)</param>
pplx::task<std::shared_ptr<VersionPage>> getAutoFlowsByIdVersions(
utility::string_t id,
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns the caller org&#39;s run history, newest first.
/// </summary>
/// <remarks>
/// Returns the caller org&#39;s run history, newest first. The optional &#x60;flowId&#x60; query narrows it to one flow and &#x60;limit&#x60; bounds the page.
/// </remarks>
/// <param name="flowId">FlowID narrows the history to one flow. Omit it for the whole org&#39;s runs. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="limit">Limit bounds the page (default 200, maximum 1000). (optional, default to 0L)</param>
pplx::task<std::shared_ptr<RunPage>> getAutoRuns(
boost::optional<utility::string_t> flowId,
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one run.
/// </summary>
/// <remarks>
/// Returns one run. A run that has not reached a terminal status is refreshed from the durable engine first — scoped to the org&#39;s own namespace — so the caller sees live progress rather than the last status that happened to be persisted.
/// </remarks>
/// <param name="id">ID is the run to read, from the path.</param>
pplx::task<std::shared_ptr<FlowRun>> getAutoRunsById(
utility::string_t id
) const;
/// <summary>
/// Updates one automation&#39;s metadata in place.
/// </summary>
/// <remarks>
/// Updates one automation&#39;s metadata in place. Every field is optional; a field the request omits is left alone. Publishing a version pins which one runs, and is refused unless that version belongs to this flow.
/// </remarks>
/// <param name="id">ID is the flow to update, from the path.</param>
/// <param name="patchFlowIn"></param>
pplx::task<std::shared_ptr<Flow>> patchAutoFlowsById(
utility::string_t id,
std::shared_ptr<PatchFlowIn> patchFlowIn
) const;
/// <summary>
/// Run executes one connector action in-process and answers the outcome.
/// </summary>
/// <remarks>
/// Run executes one connector action in-process and answers the outcome. The caller&#39;s resolved credential travels in &#x60;auth&#x60;, delivered to the action verbatim — the runtime resolves no credential itself. An action that ran and failed (or an action name the connector does not have) answers ok:false with the failure message, not an HTTP error; an unknown connector is 404 and a missing action 422.
/// </remarks>
/// <param name="id">ID is the connector to run, from the path.</param>
/// <param name="runIn"></param>
pplx::task<std::shared_ptr<RunResp>> postAutoConnectorsByIdRun(
utility::string_t id,
std::shared_ptr<RunIn> runIn
) const;
/// <summary>
/// Creates an automation and its initial DRAFT version in one call.
/// </summary>
/// <remarks>
/// Creates an automation and its initial DRAFT version in one call. The new flow is DISABLED — creating it does not arm its trigger; POST /v1/auto/flows/{id}/enable does that.
/// </remarks>
/// <param name="createFlowReq"></param>
pplx::task<std::shared_ptr<PopulatedFlow>> postAutoFlows(
std::shared_ptr<CreateFlowReq> createFlowReq
) const;
/// <summary>
/// Disarms a flow&#39;s trigger and marks it DISABLED.
/// </summary>
/// <remarks>
/// Disarms a flow&#39;s trigger and marks it DISABLED. Its schedule and its event subscriptions are dropped, so a disabled flow is never a live target; runs already in flight are unaffected, and it can still be started on demand.
/// </remarks>
/// <param name="id">ID is the flow to act on, from the path.</param>
pplx::task<std::shared_ptr<Flow>> postAutoFlowsByIdDisable(
utility::string_t id
) const;
/// <summary>
/// Arms a flow&#39;s trigger and marks it ENABLED.
/// </summary>
/// <remarks>
/// Arms a flow&#39;s trigger and marks it ENABLED. A POLLING trigger gets a cron schedule on the durable engine; a WEBHOOK trigger gets a subscription in the routing index, so an inbound event starts it; a MANUAL trigger arms nothing and still runs on demand.
/// </remarks>
/// <param name="id">ID is the flow to act on, from the path.</param>
pplx::task<std::shared_ptr<Flow>> postAutoFlowsByIdEnable(
utility::string_t id
) const;
/// <summary>
/// Edit a flow — rename it, retarget its trigger, or add, move and delete steps
/// </summary>
/// <remarks>
/// Applies ONE flow operation and answers the thing it changed. The operation is named by &#x60;type&#x60;, with its arguments under &#x60;request&#x60;: &#x60;CHANGE_NAME&#x60;, &#x60;UPDATE_TRIGGER&#x60;, &#x60;ADD_ACTION&#x60;, &#x60;UPDATE_ACTION&#x60;, &#x60;MOVE_ACTION&#x60;, &#x60;DELETE_ACTION&#x60; edit the flow&#39;s LATEST version and answer with that version, and &#x60;CHANGE_STATUS&#x60; instead enables or disables the flow and answers with the FLOW. Two response shapes on one address is the rule a reader would otherwise get wrong, and it is why this route is not a typed op. Edits land on the latest version only — the published version a run executes is untouched until it is republished — and the whole resulting step tree is re-validated against the step-count and size caps after every operation, so a long sequence of &#x60;ADD_ACTION&#x60; calls cannot grow a flow past a bound one step at a time (422 when it would). Org-scoped and fails closed: a validated principal is required (403 without one), the flow and its version are read under the caller&#39;s OWN org so another tenant&#39;s id is a 404, and an operation whose &#x60;request&#x60; does not decode is a 400.
/// </remarks>
/// <param name="id"></param>
pplx::task<void> postAutoFlowsByIdOperations(
utility::string_t id
) const;
/// <summary>
/// Starts one durable run of a flow now.
/// </summary>
/// <remarks>
/// Starts one durable run of a flow now. It runs the flow&#39;s published version if one is pinned, else its latest, and answers the run record it created. The run is bounded by the org&#39;s per-minute run-start budget and its in-flight concurrency ceiling; over either, or with the engine not ready, no run is started and no run id is burned.
/// </remarks>
/// <param name="id">ID is the flow to act on, from the path.</param>
pplx::task<std::shared_ptr<FlowRun>> postAutoFlowsByIdRun(
utility::string_t id
) const;
/// <summary>
/// Adds a new DRAFT version to a flow.
/// </summary>
/// <remarks>
/// Adds a new DRAFT version to a flow. The version is created invalid unless it carries a trigger, and it does not become the running version until it is published (PATCH the flow&#39;s publishedVersionId) or becomes the latest.
/// </remarks>
/// <param name="id">ID is the flow to add a version to, from the path.</param>
/// <param name="createVersionIn"></param>
pplx::task<std::shared_ptr<FlowVersion>> postAutoFlowsByIdVersions(
utility::string_t id,
std::shared_ptr<CreateVersionIn> createVersionIn
) const;
/// <summary>
/// Fire an event that starts every enabled flow subscribed to it
/// </summary>
/// <remarks>
/// Delivers one event to the org&#39;s automation triggers and answers &#x60;{matched:n}&#x60; — how many enabled flows had a webhook trigger on this &#x60;(source, event)&#x60; key and were started by it. A zero match is a success, not an error: nothing was subscribed. The path is the trigger key and the JSON object body is the event payload, threaded into each started run as &#x60;{{trigger.*}}&#x60; with all of its keys intact — which is why this is not a typed op, since a declared input struct would silently DISCARD every payload key it had no field for. Re-delivery is a no-op: an &#x60;X-Idempotency-Key&#x60; header dedupes, and with none the body is content-hashed instead, so a hammer of identical posts collapses to ONE run rather than minting a fresh one per post. An in-platform producer may propagate &#x60;X-Causation-Depth&#x60; so a firing that a flow caused is bounded against a loop; an absent or invalid header reads as depth 0, an external origin. Authenticated and org-scoped, unlike a provider&#39;s public webhook URL: a validated principal is required (403 without one) and the org is that principal&#39;s, never the body&#39;s, so a producer can only fire into its own tenant&#39;s flows. Both path segments are required (400) and a payload over the size limit is a 413.
/// </remarks>
/// <param name="source"></param>
/// <param name="event"></param>
pplx::task<void> postAutoHooksBySourceByEvent(
utility::string_t source,
utility::string_t event
) const;
/// <summary>
/// Release a run waiting at an approval step, with the approval payload
/// </summary>
/// <remarks>
/// Delivers the durable &#x60;resume&#x60; signal to a run parked on a &#x60;wait_for_approval&#x60; waitpoint and answers &#x60;{resumed:true}&#x60; once the engine has taken it. The body is an ARBITRARY JSON value — object, array, string, number — delivered VERBATIM into the workflow as that waitpoint&#39;s output, so it is what the steps after the approval read as their input. An empty body resumes with no payload. That open shape is why this route is not a typed op: an operation&#39;s input can carry the payload or the run address, never both. Org-scoped and fails closed: a validated principal is required (403 without one), the run is read under the caller&#39;s OWN org so another tenant&#39;s run id is a 404, a body that is not JSON is a 400, and a payload over the size limit is a 413 — it becomes durable engine state, so it is bounded here rather than after it lands. The resume is audited as &#x60;automations.run.resume&#x60;.
/// </remarks>
/// <param name="id"></param>
pplx::task<void> postAutoRunsByIdResume(
utility::string_t id
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_AutoApi_H_ */