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

248 lines
16 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.
*/
/*
* IndexApi.h
*
*
*/
#ifndef HANZO_API_IndexApi_H_
#define HANZO_API_IndexApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/AnyType.h"
#include "hanzo/model/IndexDocuments.h"
#include "hanzo/model/IndexEnqueued.h"
#include "hanzo/model/IndexFilter.h"
#include "hanzo/model/IndexHealth.h"
#include "hanzo/model/IndexHits.h"
#include "hanzo/model/IndexList.h"
#include "hanzo/model/IndexNew.h"
#include "hanzo/model/IndexQuery.h"
#include "hanzo/model/IndexSettings.h"
#include "hanzo/model/IndexStats.h"
#include "hanzo/model/IndexTask.h"
#include "hanzo/model/IndexVersion.h"
#include "hanzo/model/IndexView.h"
#include <vector>
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class IndexApi
{
public:
explicit IndexApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~IndexApi();
/// <summary>
/// Deletes an index and everything in it.
/// </summary>
/// <remarks>
/// Deletes an index and everything in it. Drops the index and every document in it from the caller&#39;s own org, and answers the dialect&#39;s EnqueuedTask. This is the only way to retire an index; without it a mistaken uid is permanent. Deleting an index that is not there succeeds, so a cleanup pass is safe to re-run. The 202 and its &#x60;enqueued&#x60; task are DIALECT COMPATIBILITY, not a promise of later work: the documents are already gone when this answers.
/// </remarks>
/// <param name="uid"></param>
pplx::task<std::shared_ptr<IndexEnqueued>> deleteIndexIndexesByUid(
utility::string_t uid
) const;
/// <summary>
/// Deletes one document by its primary key.
/// </summary>
/// <remarks>
/// Deletes one document by its primary key. Removes the document from the caller&#39;s own org and answers the dialect&#39;s EnqueuedTask. Deleting a key that is not there succeeds, so a client reconciling its own corpus can delete without checking first. The 202 and its &#x60;enqueued&#x60; task are DIALECT COMPATIBILITY, not a promise of later work: the document is already gone when this answers.
/// </remarks>
/// <param name="uid"></param>
/// <param name="id"></param>
pplx::task<std::shared_ptr<IndexEnqueued>> deleteIndexIndexesByUidDocumentsById(
utility::string_t uid,
utility::string_t id
) const;
/// <summary>
/// Reports whether the search plane can serve.
/// </summary>
/// <remarks>
/// Reports whether the search plane can serve. Answers the dialect&#39;s &#x60;{\&quot;status\&quot;:\&quot;available\&quot;}&#x60; when the index store is readable. It FAILS CLOSED — an unreadable store answers 503 with &#x60;{\&quot;status\&quot;:\&quot;unavailable\&quot;}&#x60; rather than an empty result set, because a Meilisearch client probes this before it will use a server at all and a cheerful 200 over a broken volume turns \&quot;search is down\&quot; into \&quot;nothing matched\&quot;. It requires no principal and reads no tenant data.
/// </remarks>
pplx::task<std::shared_ptr<IndexHealth>> getIndexHealth(
) const;
/// <summary>
/// Lists the indexes your org holds.
/// </summary>
/// <remarks>
/// Lists the indexes your org holds. Answers every index in the caller&#39;s own org with its primary key and timestamps. Without it an index whose uid a caller has forgotten is unreachable — there is no other way to enumerate what an org holds. The page is the whole set: an org&#39;s index count is small by construction, so &#x60;limit&#x60; and &#x60;total&#x60; both report it. The tenant is the org minted from the VALIDATED bearer&#39;s owner claim, never a client-supplied header, and two orgs may both hold an index named \&quot;messages\&quot; without either seeing the other. Without a validated principal the answer is 403 carrying the dialect&#39;s &#x60;invalid_api_key&#x60; body.
/// </remarks>
pplx::task<std::shared_ptr<IndexList>> getIndexIndexes(
) const;
/// <summary>
/// Reads one index&#39;s definition.
/// </summary>
/// <remarks>
/// Reads one index&#39;s definition. Answers the index&#39;s uid, primary key and timestamps. An index this org does not hold answers 404 carrying the dialect&#39;s &#x60;index_not_found&#x60; — the code a Meilisearch client reads as permission to create it, which is why this is a refusal rather than an empty object. The uid is scoped to the caller&#39;s own org, so another tenant&#39;s index is indistinguishable from one that never existed: this surface is not an existence oracle.
/// </remarks>
/// <param name="uid"></param>
pplx::task<std::shared_ptr<IndexView>> getIndexIndexesByUid(
utility::string_t uid
) const;
/// <summary>
/// Pages through the documents in an index.
/// </summary>
/// <remarks>
/// Pages through the documents in an index. Answers the org&#39;s stored documents in insertion order, whole, with the page&#39;s bounds and the index&#39;s total. It is the enumeration surface — search ranks by relevance and cannot walk a corpus — so a caller reconciling what it has written reads it here. An index this org does not hold answers 404 carrying the dialect&#39;s &#x60;index_not_found&#x60;.
/// </remarks>
/// <param name="uid"></param>
/// <param name="limit"> (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="offset"> (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<IndexDocuments>> getIndexIndexesByUidDocuments(
utility::string_t uid,
boost::optional<utility::string_t> limit,
boost::optional<utility::string_t> offset
) const;
/// <summary>
/// Reads one document by its primary key.
/// </summary>
/// <remarks>
/// Reads one document by its primary key. Answers the stored document exactly as it was written — this surface keeps documents whole rather than projecting them, so what comes back is what went in. A primary key this index does not hold answers 404 carrying the dialect&#39;s &#x60;document_not_found&#x60;; an index this org does not hold answers &#x60;index_not_found&#x60;, and the two are different facts a client acts on differently.
/// </remarks>
/// <param name="uid"></param>
/// <param name="id"></param>
pplx::task<std::shared_ptr<AnyType>> getIndexIndexesByUidDocumentsById(
utility::string_t uid,
utility::string_t id
) const;
/// <summary>
/// Reads an index&#39;s filterable attributes.
/// </summary>
/// <remarks>
/// Reads an index&#39;s filterable attributes. Answers the settings subset this surface implements: the attributes a search &#x60;filter&#x60; may constrain. An index this org does not hold answers 404 carrying the dialect&#39;s &#x60;index_not_found&#x60;.
/// </remarks>
/// <param name="uid"></param>
pplx::task<std::shared_ptr<IndexSettings>> getIndexIndexesByUidSettings(
utility::string_t uid
) const;
/// <summary>
/// Counts the documents in each of your indexes.
/// </summary>
/// <remarks>
/// Counts the documents in each of your indexes. Reports every index the caller&#39;s own org holds with its document count, plus the org&#39;s total. &#x60;isIndexing&#x60; is always false because writes here are applied before their response — there is never a background pass to wait on. The tenant is the org minted from the VALIDATED bearer&#39;s owner claim, never a client-supplied header, so this counts the caller&#39;s own documents and no other tenant&#39;s. Without a validated principal the answer is 403 carrying the dialect&#39;s &#x60;invalid_api_key&#x60; body.
/// </remarks>
pplx::task<std::shared_ptr<IndexStats>> getIndexStats(
) const;
/// <summary>
/// Checks a write task, which has already finished.
/// </summary>
/// <remarks>
/// Checks a write task, which has already finished. Always reports &#x60;succeeded&#x60;. Writes here are applied to SQLite before their EnqueuedTask is returned, so a client polling waitForTask resolves on its first call rather than waiting for a queue that was never there. The three timestamps are the same instant for the same reason. It requires a validated principal but reads no tenant data: the task id it echoes was minted by this process and names nothing about any org.
/// </remarks>
/// <param name="uid"></param>
pplx::task<std::shared_ptr<IndexTask>> getIndexTasksByUid(
int64_t uid
) const;
/// <summary>
/// Identifies the search implementation answering.
/// </summary>
/// <remarks>
/// Identifies the search implementation answering. Reports the dialect&#39;s version shape with &#x60;commitSha&#x60; naming this implementation rather than a Meilisearch build, so a client that logs the version records which server answered instead of implying a release of software this is not. It requires no principal and reads no tenant data.
/// </remarks>
pplx::task<std::shared_ptr<IndexVersion>> getIndexVersion(
) const;
/// <summary>
/// Sets which attributes an index can be filtered on.
/// </summary>
/// <remarks>
/// Sets which attributes an index can be filtered on. Replaces the whole filterable set. An attribute not listed here cannot be used in a search &#x60;filter&#x60;, so this is what makes a per-user or per-tag narrowing possible at all. It CREATES the index when it is missing rather than answering 404, because a Meilisearch client configures settings on an index it has just asked for and a refusal there leaves the client with no index at all. The 202 and its &#x60;enqueued&#x60; task are DIALECT COMPATIBILITY, not a promise of later work: the setting is already applied when this answers.
/// </remarks>
/// <param name="uid"></param>
/// <param name="indexFilter"></param>
pplx::task<std::shared_ptr<IndexEnqueued>> patchIndexIndexesByUidSettings(
utility::string_t uid,
std::shared_ptr<IndexFilter> indexFilter
) const;
/// <summary>
/// Creates an index.
/// </summary>
/// <remarks>
/// Creates an index. Registers a named index in the caller&#39;s own org and answers the dialect&#39;s EnqueuedTask. It is idempotent: creating an index that already exists returns the same receipt and changes nothing, which is what lets a client create on startup without checking first. &#x60;primaryKey&#x60; is optional — the first write establishes one when it is omitted. An index is a ROW here rather than a table, so an unusual uid is stored verbatim instead of being sanitised into a schema name. The 202 and its &#x60;enqueued&#x60; task are DIALECT COMPATIBILITY, not a promise of later work: the write is already applied when this answers. A client that polls waitForTask resolves immediately.
/// </remarks>
/// <param name="indexNew"></param>
pplx::task<std::shared_ptr<IndexEnqueued>> postIndexIndexes(
std::shared_ptr<IndexNew> indexNew
) const;
/// <summary>
/// Add or replace documents in an index
/// </summary>
/// <remarks>
/// Writes documents into the caller&#39;s own index, keyed by the index&#39;s primary key: a document whose key is already present is REPLACED whole. The body is the dialect&#39;s own — an array of documents, or a single document — and each is stored verbatim, so a read gives back exactly what was written. The index is CREATED when it is missing rather than refused, because a Meilisearch client writes before it configures. The tenant is the org minted from the VALIDATED bearer&#39;s owner claim, never a client-supplied header, so two orgs may both hold an index named \&quot;messages\&quot; and neither can see the other&#39;s documents. Without a validated principal the answer is 403 carrying the dialect&#39;s &#x60;invalid_api_key&#x60; body. The 202 and its &#x60;enqueued&#x60; task are DIALECT COMPATIBILITY, not a promise of later work: the documents are searchable when this answers, and a client that polls waitForTask resolves immediately.
/// </remarks>
/// <param name="uid"></param>
/// <param name="requestBody"> (optional)</param>
pplx::task<std::shared_ptr<IndexEnqueued>> postIndexIndexesByUidDocuments(
utility::string_t uid,
boost::optional<std::vector<std::shared_ptr<AnyType>>> requestBody
) const;
/// <summary>
/// Delete many documents by primary key in one call
/// </summary>
/// <remarks>
/// Removes every named document from the caller&#39;s own index. The body is the dialect&#39;s own: a bare array of primary keys, which may be strings or numbers. A key that is not there is not an error, so a client reconciling its own corpus can send one list rather than checking each key first. The tenant is the org minted from the VALIDATED bearer&#39;s owner claim, never a client-supplied header. Without a validated principal the answer is 403 carrying the dialect&#39;s &#x60;invalid_api_key&#x60; body. The 202 and its &#x60;enqueued&#x60; task are DIALECT COMPATIBILITY, not a promise of later work: the documents are already gone when this answers.
/// </remarks>
/// <param name="uid"></param>
/// <param name="requestBody"> (optional)</param>
pplx::task<std::shared_ptr<IndexEnqueued>> postIndexIndexesByUidDocumentsDeleteBatch(
utility::string_t uid,
boost::optional<std::vector<std::shared_ptr<AnyType>>> requestBody
) const;
/// <summary>
/// Searches an index, forgiving typos.
/// </summary>
/// <remarks>
/// Searches an index, forgiving typos. Ranks the org&#39;s documents in one index against &#x60;q&#x60; and answers the matching documents whole, most relevant first. A prefix matches, so a partial word finds the documents containing it, and &#x60;filter&#x60; narrows the result to documents whose filterable attributes match — which is how a caller scopes results to one end user within its own org. &#x60;estimatedTotalHits&#x60; is the dialect&#39;s name for the count; every hit is materialised here, so for this page it is exact. An index this org does not hold answers 404 carrying the dialect&#39;s &#x60;index_not_found&#x60;.
/// </remarks>
/// <param name="uid"></param>
/// <param name="indexQuery"></param>
pplx::task<std::shared_ptr<IndexHits>> postIndexIndexesByUidSearch(
utility::string_t uid,
std::shared_ptr<IndexQuery> indexQuery
) const;
/// <summary>
/// Add or update documents in an index
/// </summary>
/// <remarks>
/// The dialect&#39;s update spelling of the write above, and the same act: an upsert keyed by the index&#39;s primary key. The JS client&#39;s addDocuments and updateDocuments both reduce to this for whole documents, so both spellings are served and both behave identically. The tenant is the org minted from the VALIDATED bearer&#39;s owner claim, never a client-supplied header. Without a validated principal the answer is 403 carrying the dialect&#39;s &#x60;invalid_api_key&#x60; body. The 202 and its &#x60;enqueued&#x60; task are DIALECT COMPATIBILITY, not a promise of later work: the write is already applied when this answers.
/// </remarks>
/// <param name="uid"></param>
/// <param name="requestBody"> (optional)</param>
pplx::task<std::shared_ptr<IndexEnqueued>> putIndexIndexesByUidDocuments(
utility::string_t uid,
boost::optional<std::vector<std::shared_ptr<AnyType>>> requestBody
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_IndexApi_H_ */