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.
197 lines
12 KiB
C++
197 lines
12 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.
|
|
*/
|
|
|
|
/*
|
|
* SocialApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_SocialApi_H_
|
|
#define HANZO_API_SocialApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/model/SocialAccount.h"
|
|
#include "hanzo/model/SocialAccountBody.h"
|
|
#include "hanzo/model/SocialAccountWrite.h"
|
|
#include "hanzo/model/SocialAccounts.h"
|
|
#include "hanzo/model/SocialPost.h"
|
|
#include "hanzo/model/SocialPostBody.h"
|
|
#include "hanzo/model/SocialPostWrite.h"
|
|
#include "hanzo/model/SocialPosts.h"
|
|
#include "hanzo/model/SocialProviders.h"
|
|
#include "hanzo/model/SocialSummary.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class SocialApi
|
|
{
|
|
public:
|
|
|
|
explicit SocialApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~SocialApi();
|
|
|
|
/// <summary>
|
|
/// Removes one connected account from the org and answers 204 with no body; an id that is not there is 404.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one connected account from the org and answers 204 with no body; an id that is not there is 404. It removes the account record only. Posts that already published through it keep their published state and their recorded external ids — this does not retract anything from the network.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the account or post to act on, taken from the path.</param>
|
|
pplx::task<void> deleteSocialAccountsById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Removes one post from the org and answers 204 with no body; an id that is not there is 404.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes one post from the org and answers 204 with no body; an id that is not there is 404. It deletes the record here only. A post that has already published is not retracted from the network by deleting it.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the account or post to act on, taken from the path.</param>
|
|
pplx::task<void> deleteSocialPostsById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the org's connected accounts — each one's id, network, handle, status and timestamps, most-recently-updated first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the org's connected accounts — each one's id, network, handle, status and timestamps, most-recently-updated first. An account's provider access token is NEVER included in any response on this surface. Only the publisher reads it.
|
|
/// </remarks>
|
|
/// <param name="provider">Provider keeps only accounts on one network — x, facebook, instagram, linkedin, tiktok, youtube or threads. Omit it for every network. It is lower-cased and trimmed before it is matched, and a value that names no network simply matches nothing rather than being refused. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="limit">Limit bounds the page, defaulting to 200 and capped at 1000. It is a string rather than an integer on purpose: the route parses it with a leading trim and falls back to the default on anything it cannot read, so `?limit=%2050` is a page of fifty today. An integer field would refuse the space and read an unparseable value as zero, which is a different page. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<SocialAccounts>> getSocialAccounts(
|
|
boost::optional<utility::string_t> provider,
|
|
boost::optional<utility::string_t> limit
|
|
) const;
|
|
/// <summary>
|
|
/// Returns one of the org's connected accounts by id — its network, handle, status and timestamps — or 404.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns one of the org's connected accounts by id — its network, handle, status and timestamps — or 404. The provider access token is not part of the response.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the account or post to act on, taken from the path.</param>
|
|
pplx::task<std::shared_ptr<SocialAccount>> getSocialAccountsById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Returns the org's posts — content, channel, status, scheduled time, media and timestamps — most-recently-updated first.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns the org's posts — content, channel, status, scheduled time, media and timestamps — most-recently-updated first.
|
|
/// </remarks>
|
|
/// <param name="status">Status keeps only posts in one state — draft, scheduled, published or failed. Omit it for every state. The transient publishing claim is not a user-visible state and matching it is not useful. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="limit">Limit bounds the page, defaulting to 200 and capped at 1000. A string for the same reason accountFilter.Limit is. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<SocialPosts>> getSocialPosts(
|
|
boost::optional<utility::string_t> status,
|
|
boost::optional<utility::string_t> limit
|
|
) const;
|
|
/// <summary>
|
|
/// Returns one of the org's posts by id, with its current status, scheduled time, media and — once it has published — the account and external id it published under.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns one of the org's posts by id, with its current status, scheduled time, media and — once it has published — the account and external id it published under. 404 when there is no such post for this org.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the account or post to act on, taken from the path.</param>
|
|
pplx::task<std::shared_ptr<SocialPost>> getSocialPostsById(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Reports each supported network's publish-readiness: whether this deployment holds the OAuth application credentials for it and, when it does not, exactly which environment variables are missing.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reports each supported network's publish-readiness: whether this deployment holds the OAuth application credentials for it and, when it does not, exactly which environment variables are missing. This is a live read of the deployment's own configuration, not a static list of networks — it answers \"can I connect this today\", which is what a connect affordance and a pre-cutover checklist both need. It says nothing about whether the caller has connected an account; that is the accounts listing.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<SocialProviders>> getSocialProviders(
|
|
) const;
|
|
/// <summary>
|
|
/// Returns four counts for the caller's org: total posts, how many are scheduled, how many have published, and how many accounts are connected.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Returns four counts for the caller's org: total posts, how many are scheduled, how many have published, and how many accounts are connected. It is the dashboard roll-up, computed over the org's own rows in one read.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<SocialSummary>> getSocialSummary(
|
|
) const;
|
|
/// <summary>
|
|
/// Records a social account for the org and answers 201 with the stored row, including the generated id later calls address it by.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Records a social account for the org and answers 201 with the stored row, including the generated id later calls address it by.
|
|
/// </remarks>
|
|
/// <param name="socialAccountBody"></param>
|
|
pplx::task<std::shared_ptr<SocialAccount>> postSocialAccounts(
|
|
std::shared_ptr<SocialAccountBody> socialAccountBody
|
|
) const;
|
|
/// <summary>
|
|
/// Stores a post for the org and answers 201 with the stored row.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Stores a post for the org and answers 201 with the stored row. A post created as scheduled for a time that has already passed is published IMMEDIATELY, and the row returned carries that outcome — this is the one behaviour a reader would otherwise miss. A future-scheduled post is left for the scheduler, and a draft is left alone. Publishing never fails the creation: the post is stored either way, and a publish that could not run leaves the row for the scheduler to retry.
|
|
/// </remarks>
|
|
/// <param name="socialPostBody"></param>
|
|
pplx::task<std::shared_ptr<SocialPost>> postSocialPosts(
|
|
std::shared_ptr<SocialPostBody> socialPostBody
|
|
) const;
|
|
/// <summary>
|
|
/// Publishes the post immediately to the connected accounts on its channel and answers with the updated row, carrying the account and external id it published under.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Publishes the post immediately to the connected accounts on its channel and answers with the updated row, carrying the account and external id it published under. It is IDEMPOTENT: a post that has already published, or that another caller is publishing right now, comes back unchanged rather than being posted twice. That claim is taken before any network call, which is what makes a double submit safe. The two failure shapes differ on purpose. Having no connected account for the channel is the caller's to fix, so it is recorded ON the post as failed with the reason and answers normally. A deployment that lacks the network's own credentials cannot publish for anyone, so that is a 503 naming exactly what is missing.
|
|
/// </remarks>
|
|
/// <param name="id">ID is the account or post to act on, taken from the path.</param>
|
|
pplx::task<std::shared_ptr<SocialPost>> postSocialPostsByIdPublish(
|
|
utility::string_t id
|
|
) const;
|
|
/// <summary>
|
|
/// Replaces the account's network, handle and status with what the body carries, and answers with the stored row.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Replaces the account's network, handle and status with what the body carries, and answers with the stored row. This is a REPLACEMENT, not a merge, which is the rule most easily got wrong: a field the body omits is written as its default, so leaving out the handle blanks it and leaving out the status resets it to connected. Send the whole record. The same vocabularies as create apply, and an unknown network or status is refused rather than coerced.
|
|
/// </remarks>
|
|
/// <param name="id"></param>
|
|
/// <param name="socialAccountWrite"></param>
|
|
pplx::task<std::shared_ptr<SocialAccount>> putSocialAccountsById(
|
|
utility::string_t id,
|
|
std::shared_ptr<SocialAccountWrite> socialAccountWrite
|
|
) const;
|
|
/// <summary>
|
|
/// Replaces the post's content, channel, status, scheduled time and media with what the body carries, and answers with the stored row.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Replaces the post's content, channel, status, scheduled time and media with what the body carries, and answers with the stored row. A REPLACEMENT, not a merge: an omitted field is written as its default, so omitting media clears it and omitting the status resets the post to draft. `content` is required on every update. Unlike create, this never triggers a publish — moving a post's scheduled time into the past here leaves it for the scheduler; publish now is its own operation.
|
|
/// </remarks>
|
|
/// <param name="id"></param>
|
|
/// <param name="socialPostWrite"></param>
|
|
pplx::task<std::shared_ptr<SocialPost>> putSocialPostsById(
|
|
utility::string_t id,
|
|
std::shared_ptr<SocialPostWrite> socialPostWrite
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_SocialApi_H_ */
|
|
|