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.
131 lines
4.9 KiB
C++
131 lines
4.9 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.
|
||
*/
|
||
|
||
/*
|
||
* KvApi.h
|
||
*
|
||
*
|
||
*/
|
||
|
||
#ifndef HANZO_API_KvApi_H_
|
||
#define HANZO_API_KvApi_H_
|
||
|
||
|
||
|
||
#include "hanzo/ApiClient.h"
|
||
|
||
#include "hanzo/model/BucketRecord.h"
|
||
#include "hanzo/model/BucketWrite.h"
|
||
#include "hanzo/model/KvAck.h"
|
||
#include "hanzo/model/KvEntry.h"
|
||
#include "hanzo/model/KvPage.h"
|
||
#include "hanzo/model/KvWrite.h"
|
||
#include <cpprest/details/basic_types.h>
|
||
#include <boost/optional.hpp>
|
||
|
||
namespace hanzo {
|
||
namespace api {
|
||
|
||
using namespace hanzo::model;
|
||
|
||
|
||
|
||
class KvApi
|
||
{
|
||
public:
|
||
|
||
explicit KvApi( std::shared_ptr<const ApiClient> apiClient );
|
||
|
||
virtual ~KvApi();
|
||
|
||
/// <summary>
|
||
/// Removes one bucket of the caller's org — every key and every revision with it — and answers 204 with no body.
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// Removes one bucket of the caller's org — every key and every revision with it — and answers 204 with no body. 404 when the org has no bucket of that name.
|
||
/// </remarks>
|
||
/// <param name="bucket">Bucket is the bucket's name, from the path.</param>
|
||
pplx::task<void> deleteKvByBucket(
|
||
utility::string_t bucket
|
||
) const;
|
||
/// <summary>
|
||
/// Delete removes one key — a delete marker in the key's history, so watchers see it and Get answers 404 — and answers 204 with no body.
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// Delete removes one key — a delete marker in the key's history, so watchers see it and Get answers 404 — and answers 204 with no body. 404 when the bucket does not exist.
|
||
/// </remarks>
|
||
/// <param name="bucket">Bucket is the bucket, from the path.</param>
|
||
/// <param name="key">Key is the key, from the path.</param>
|
||
pplx::task<void> deleteKvByBucketByKey(
|
||
utility::string_t bucket,
|
||
utility::string_t key
|
||
) const;
|
||
/// <summary>
|
||
/// Get returns one key's current value and revision.
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// Get returns one key's current value and revision. 404 when the bucket does not exist, the key was never written, or its latest revision is a delete.
|
||
/// </remarks>
|
||
/// <param name="bucket">Bucket is the bucket, from the path.</param>
|
||
/// <param name="key">Key is the key, from the path.</param>
|
||
pplx::task<std::shared_ptr<KvEntry>> getKvByBucketByKey(
|
||
utility::string_t bucket,
|
||
utility::string_t key
|
||
) const;
|
||
/// <summary>
|
||
/// History returns one key's retained revisions, oldest first — every put and every delete marker up to the bucket's History depth.
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// History returns one key's retained revisions, oldest first — every put and every delete marker up to the bucket's History depth. 404 when the bucket does not exist or the key was never written.
|
||
/// </remarks>
|
||
/// <param name="bucket">Bucket is the bucket, from the path.</param>
|
||
/// <param name="key">Key is the key, from the path.</param>
|
||
pplx::task<std::shared_ptr<KvPage>> getKvByBucketByKeyHistory(
|
||
utility::string_t bucket,
|
||
utility::string_t key
|
||
) const;
|
||
/// <summary>
|
||
/// Creates a KV bucket and returns it.
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// Creates a KV bucket and returns it. A bucket is keyed state on the same durable plane as the streams: each key holds up to History revisions, entries can expire by TTL, and watchers on the NATS port see every write. 409 when the org already has a bucket of that name.
|
||
/// </remarks>
|
||
/// <param name="bucket">Bucket is the bucket's name within the org, from the path: 1–64 of [A-Za-z0-9_], no dash.</param>
|
||
/// <param name="bucketWrite"></param>
|
||
pplx::task<std::shared_ptr<BucketRecord>> postKvByBucket(
|
||
utility::string_t bucket,
|
||
std::shared_ptr<BucketWrite> bucketWrite
|
||
) const;
|
||
/// <summary>
|
||
/// Put sets one key to one value and returns the revision the write created.
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// Put sets one key to one value and returns the revision the write created. Writes are versioned: each put is a new revision and the bucket retains up to its History of them per key.
|
||
/// </remarks>
|
||
/// <param name="bucket">Bucket is the bucket, from the path.</param>
|
||
/// <param name="key">Key is the key, from the path.</param>
|
||
/// <param name="kvWrite"></param>
|
||
pplx::task<std::shared_ptr<KvAck>> putKvByBucketByKey(
|
||
utility::string_t bucket,
|
||
utility::string_t key,
|
||
std::shared_ptr<KvWrite> kvWrite
|
||
) const;
|
||
|
||
protected:
|
||
std::shared_ptr<const ApiClient> m_ApiClient;
|
||
};
|
||
|
||
}
|
||
}
|
||
|
||
#endif /* HANZO_API_KvApi_H_ */
|
||
|