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.
437 lines
24 KiB
C++
437 lines
24 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.
|
|
*/
|
|
|
|
/*
|
|
* CloudflareApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef HANZO_API_CloudflareApi_H_
|
|
#define HANZO_API_CloudflareApi_H_
|
|
|
|
|
|
|
|
#include "hanzo/ApiClient.h"
|
|
|
|
#include "hanzo/AnyType.h"
|
|
#include "hanzo/model/BucketCreateIn.h"
|
|
#include "hanzo/model/D1Query.h"
|
|
#include "hanzo/model/DatabaseCreateIn.h"
|
|
#include "hanzo/model/DomainAddIn.h"
|
|
#include "hanzo/model/NamespaceCreateIn.h"
|
|
#include "hanzo/model/PagesDeploy.h"
|
|
#include "hanzo/model/PagesProjectCreate.h"
|
|
#include "hanzo/model/PurgeIn.h"
|
|
#include "hanzo/model/RouteCreateIn.h"
|
|
#include "hanzo/model/SubdomainSetIn.h"
|
|
#include "hanzo/model/WorkerScriptPut.h"
|
|
#include <cpprest/details/basic_types.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
namespace hanzo {
|
|
namespace api {
|
|
|
|
using namespace hanzo::model;
|
|
|
|
|
|
|
|
class CloudflareApi
|
|
{
|
|
public:
|
|
|
|
explicit CloudflareApi( std::shared_ptr<const ApiClient> apiClient );
|
|
|
|
virtual ~CloudflareApi();
|
|
|
|
/// <summary>
|
|
/// Deletes a D1 database and everything stored in it.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Deletes a D1 database and everything stored in it. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="database">Database is the Cloudflare D1 database id or name.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflareD1DatabasesByDatabase(
|
|
utility::string_t database
|
|
) const;
|
|
/// <summary>
|
|
/// KVNamespaceDelete deletes a Workers KV namespace and every key in it.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// KVNamespaceDelete deletes a Workers KV namespace and every key in it. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="r_namespace">Namespace is the Cloudflare KV namespace id.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflareKvNamespacesByNamespace(
|
|
utility::string_t r_namespace
|
|
) const;
|
|
/// <summary>
|
|
/// KVValueDelete removes one key from a Workers KV namespace.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// KVValueDelete removes one key from a Workers KV namespace. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="r_namespace">Namespace is the Cloudflare KV namespace id.</param>
|
|
/// <param name="key">Key is the key within that namespace. KV keys are broad (up to 512 bytes), so this one is escaped rather than charset-restricted.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflareKvNamespacesByNamespaceValuesByKey(
|
|
utility::string_t r_namespace,
|
|
utility::string_t key
|
|
) const;
|
|
/// <summary>
|
|
/// Deletes a Cloudflare Pages project, and with it every deployment it has ever made.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Deletes a Cloudflare Pages project, and with it every deployment it has ever made. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="project">Project is the Pages project name.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflarePagesProjectsByProject(
|
|
utility::string_t project
|
|
) const;
|
|
/// <summary>
|
|
/// Detaches a custom domain from a Cloudflare Pages project.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Detaches a custom domain from a Cloudflare Pages project. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="project">Project is the Pages project name.</param>
|
|
/// <param name="domain">Domain is the attached custom domain to detach.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflarePagesProjectsByProjectDomainsByDomain(
|
|
utility::string_t project,
|
|
utility::string_t domain
|
|
) const;
|
|
/// <summary>
|
|
/// Deletes an R2 bucket.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Deletes an R2 bucket. Requires org admin. Cloudflare refuses a bucket that still holds objects, and that refusal is relayed.
|
|
/// </remarks>
|
|
/// <param name="bucket">Bucket is the R2 bucket name.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflareR2BucketsByBucket(
|
|
utility::string_t bucket
|
|
) const;
|
|
/// <summary>
|
|
/// Removes a Worker script from the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Removes a Worker script from the org's Cloudflare account. Requires org admin. Routes bound to the script stop serving it.
|
|
/// </remarks>
|
|
/// <param name="script">Script is the Worker script name.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflareWorkersScriptsByScript(
|
|
utility::string_t script
|
|
) const;
|
|
/// <summary>
|
|
/// Unbinds a Worker route, so its pattern stops dispatching to a script.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Unbinds a Worker route, so its pattern stops dispatching to a script. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="zone">Zone is the 32-hex Cloudflare zone id.</param>
|
|
/// <param name="route">Route is the 32-hex Cloudflare route id.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> deleteCloudflareWorkersZonesByZoneRoutesByRoute(
|
|
utility::string_t zone,
|
|
utility::string_t route
|
|
) const;
|
|
/// <summary>
|
|
/// Lists the D1 databases on the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Lists the D1 databases on the org's Cloudflare account. Any org member may read.
|
|
/// </remarks>
|
|
/// <param name="page">Page is the 1-based page of databases to return. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="perPage">PerPage is how many databases one page holds. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="name">Name filters to the database with this name. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareD1Databases(
|
|
boost::optional<utility::string_t> page,
|
|
boost::optional<utility::string_t> perPage,
|
|
boost::optional<utility::string_t> name
|
|
) const;
|
|
/// <summary>
|
|
/// KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// KVNamespaceList lists the Workers KV namespaces on the org's Cloudflare account. Any org member may read.
|
|
/// </remarks>
|
|
/// <param name="page">Page is the 1-based page of namespaces to return. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="perPage">PerPage is how many namespaces one page holds. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="order">Order names the field to sort by, and Direction sorts asc or desc. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="direction"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareKvNamespaces(
|
|
boost::optional<utility::string_t> page,
|
|
boost::optional<utility::string_t> perPage,
|
|
boost::optional<utility::string_t> order,
|
|
boost::optional<utility::string_t> direction
|
|
) const;
|
|
/// <summary>
|
|
/// Read a Workers KV value as its stored bytes
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Answers one KV key's value from the org's OWN Cloudflare account as RAW BYTES under the content type it was written with — not wrapped in a JSON envelope, which is why this is not a typed op. Any org member may read. A key that does not exist is Cloudflare's own 404; an invalid namespace, or a key that is empty, over 512 bytes, not valid UTF-8, or carries a control character, is 400; 503 if the org has never connected a Cloudflare token.
|
|
/// </remarks>
|
|
/// <param name="r_namespace"></param>
|
|
/// <param name="key"></param>
|
|
pplx::task<void> getCloudflareKvNamespacesByNamespaceValuesByKey(
|
|
utility::string_t r_namespace,
|
|
utility::string_t key
|
|
) const;
|
|
/// <summary>
|
|
/// Lists the org's Cloudflare Pages projects.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Lists the org's Cloudflare Pages projects. Any org member may read.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflarePagesProjects(
|
|
) const;
|
|
/// <summary>
|
|
/// Reads one Cloudflare Pages project — its build config, deployment configs and latest deployment.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reads one Cloudflare Pages project — its build config, deployment configs and latest deployment. Any org member may read.
|
|
/// </remarks>
|
|
/// <param name="project">Project is the Pages project name.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflarePagesProjectsByProject(
|
|
utility::string_t project
|
|
) const;
|
|
/// <summary>
|
|
/// Lists the R2 buckets on the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Lists the R2 buckets on the org's Cloudflare account. Any org member may read.
|
|
/// </remarks>
|
|
/// <param name="perPage">PerPage is how many buckets one page holds. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="cursor">Cursor continues from the position a previous page returned. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="nameContains">NameContains filters to buckets whose name contains this substring. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="order">Order names the field to sort by, and Direction sorts asc or desc. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="direction"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareR2Buckets(
|
|
boost::optional<utility::string_t> perPage,
|
|
boost::optional<utility::string_t> cursor,
|
|
boost::optional<utility::string_t> nameContains,
|
|
boost::optional<utility::string_t> order,
|
|
boost::optional<utility::string_t> direction
|
|
) const;
|
|
/// <summary>
|
|
/// Lists the Worker scripts on the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Lists the Worker scripts on the org's Cloudflare account. Any org member may read.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareWorkersScripts(
|
|
) const;
|
|
/// <summary>
|
|
/// Reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reads the org account's workers.dev subdomain — the name under which every subdomain-enabled script is served. Any org member may read.
|
|
/// </remarks>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareWorkersSubdomain(
|
|
) const;
|
|
/// <summary>
|
|
/// Lists the Worker routes bound within one zone — the URL patterns that dispatch to a script.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Lists the Worker routes bound within one zone — the URL patterns that dispatch to a script. Any org member may read. Routes are zone-scoped, so no account is resolved.
|
|
/// </remarks>
|
|
/// <param name="zone">Zone is the 32-hex Cloudflare zone id.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareWorkersZonesByZoneRoutes(
|
|
utility::string_t zone
|
|
) const;
|
|
/// <summary>
|
|
/// Lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Lists the Cloudflare zones the org's connected API token can see, paged and filtered by the query parameters Cloudflare itself accepts. Zones are token-scoped by Cloudflare, so no account is resolved. Any org member may read. Zone and DNS-record MANAGEMENT is not here: it stays on the Hanzo DNS plane (/v1/dns). This only surfaces the Cloudflare zone objects the asset plane needs — a zone id is what addresses a Worker route or an analytics read.
|
|
/// </remarks>
|
|
/// <param name="page">Page is the 1-based page of zones to return. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="perPage">PerPage is how many zones one page holds. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="name">Name filters to the zone with this domain name. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="status">Status filters by zone status (active, pending, initializing, …). (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="order">Order names the field to sort by, and Direction sorts asc or desc. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="direction"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareZones(
|
|
boost::optional<utility::string_t> page,
|
|
boost::optional<utility::string_t> perPage,
|
|
boost::optional<utility::string_t> name,
|
|
boost::optional<utility::string_t> status,
|
|
boost::optional<utility::string_t> order,
|
|
boost::optional<utility::string_t> direction
|
|
) const;
|
|
/// <summary>
|
|
/// Reads one Cloudflare zone the org's token can see.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reads one Cloudflare zone the org's token can see. Any org member may read. A zone id the token cannot see is Cloudflare's own not-found, relayed.
|
|
/// </remarks>
|
|
/// <param name="zone">Zone is the 32-hex Cloudflare zone id.</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareZonesByZone(
|
|
utility::string_t zone
|
|
) const;
|
|
/// <summary>
|
|
/// Reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Reads a zone's Cloudflare traffic dashboard — requests, bandwidth, threats and pageviews over the since/until window. Any org member may read. A zone whose Cloudflare plan does not serve this endpoint yields Cloudflare's OWN error, never a fabricated success.
|
|
/// </remarks>
|
|
/// <param name="zone">Zone is the 32-hex Cloudflare zone id.</param>
|
|
/// <param name="since">Since and Until bound the window, in the form Cloudflare accepts — an RFC 3339 time or a negative number of minutes from now (\"-1440\" is the last day). (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="until"> (optional, default to utility::conversions::to_string_t(""))</param>
|
|
/// <param name="continuous">Continuous asks Cloudflare for only fully-aggregated buckets. (optional, default to utility::conversions::to_string_t(""))</param>
|
|
pplx::task<std::shared_ptr<AnyType>> getCloudflareZonesByZoneAnalytics(
|
|
utility::string_t zone,
|
|
boost::optional<utility::string_t> since,
|
|
boost::optional<utility::string_t> until,
|
|
boost::optional<utility::string_t> continuous
|
|
) const;
|
|
/// <summary>
|
|
/// Creates a D1 database on the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Creates a D1 database on the org's Cloudflare account. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="databaseCreateIn"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflareD1Databases(
|
|
std::shared_ptr<DatabaseCreateIn> databaseCreateIn
|
|
) const;
|
|
/// <summary>
|
|
/// Runs one SQL statement against a D1 database.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Runs one SQL statement against a D1 database. It executes on the org's OWN Cloudflare account and relays D1's result set. The body is checked for a non-empty `sql` and then forwarded VERBATIM, so every field D1 accepts reaches D1 even though only two are named here. Requires ORG ADMIN — a statement may INSERT, UPDATE or DROP, so a query takes the write gate rather than the read one — and a caller who is only an org member is refused 403. A missing `sql` is 400; 503 if the org has never connected a Cloudflare token.
|
|
/// </remarks>
|
|
/// <param name="database"></param>
|
|
/// <param name="d1Query"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflareD1DatabasesByDatabaseQuery(
|
|
utility::string_t database,
|
|
std::shared_ptr<D1Query> d1Query
|
|
) const;
|
|
/// <summary>
|
|
/// KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// KVNamespaceCreate creates a Workers KV namespace on the org's Cloudflare account. Requires org admin. Cloudflare mints the namespace id the value routes address.
|
|
/// </remarks>
|
|
/// <param name="namespaceCreateIn"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflareKvNamespaces(
|
|
std::shared_ptr<NamespaceCreateIn> namespaceCreateIn
|
|
) const;
|
|
/// <summary>
|
|
/// Creates a Cloudflare Pages project on the org's account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Creates a Cloudflare Pages project on the org's account. Requires org admin. Only the modeled fields reach Cloudflare, so an unmodeled key in the request is dropped rather than forwarded.
|
|
/// </remarks>
|
|
/// <param name="pagesProjectCreate"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflarePagesProjects(
|
|
std::shared_ptr<PagesProjectCreate> pagesProjectCreate
|
|
) const;
|
|
/// <summary>
|
|
/// Trigger a new Pages deployment for a project
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Starts a build and deployment of one Cloudflare Pages project on the org's OWN Cloudflare account, and relays Cloudflare's deployment record back. `branch` picks what to build; OMITTING it builds the project's production branch. A body it cannot parse is IGNORED rather than refused — the deployment falls back to the production branch — which is the one rule to get right here and the reason this is not a typed op: a typed request would answer 400 where this deploys. Requires ORG ADMIN (403 otherwise), and 503 if the org has never connected a Cloudflare token.
|
|
/// </remarks>
|
|
/// <param name="project"></param>
|
|
/// <param name="pagesDeploy"> (optional)</param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflarePagesProjectsByProjectDeployments(
|
|
utility::string_t project,
|
|
boost::optional<std::shared_ptr<PagesDeploy>> pagesDeploy
|
|
) const;
|
|
/// <summary>
|
|
/// Attaches a custom domain to a Cloudflare Pages project.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Attaches a custom domain to a Cloudflare Pages project. Requires org admin. Cloudflare owns validation and certificate issuance from here on.
|
|
/// </remarks>
|
|
/// <param name="project">Project is the Pages project name, from the path.</param>
|
|
/// <param name="domainAddIn"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflarePagesProjectsByProjectDomains(
|
|
utility::string_t project,
|
|
std::shared_ptr<DomainAddIn> domainAddIn
|
|
) const;
|
|
/// <summary>
|
|
/// Creates an R2 bucket on the org's Cloudflare account.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Creates an R2 bucket on the org's Cloudflare account. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="bucketCreateIn"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflareR2Buckets(
|
|
std::shared_ptr<BucketCreateIn> bucketCreateIn
|
|
) const;
|
|
/// <summary>
|
|
/// Publishes or withdraws one Worker script on the account's workers.dev subdomain.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Publishes or withdraws one Worker script on the account's workers.dev subdomain. Requires org admin.
|
|
/// </remarks>
|
|
/// <param name="script">Script is the Worker script name, from the path.</param>
|
|
/// <param name="subdomainSetIn"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflareWorkersScriptsByScriptSubdomain(
|
|
utility::string_t script,
|
|
std::shared_ptr<SubdomainSetIn> subdomainSetIn
|
|
) const;
|
|
/// <summary>
|
|
/// Binds a URL pattern in a zone to a Worker script.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Binds a URL pattern in a zone to a Worker script. Requires org admin — a route is what puts a script in front of live traffic.
|
|
/// </remarks>
|
|
/// <param name="zone">Zone is the 32-hex Cloudflare zone id, from the path.</param>
|
|
/// <param name="routeCreateIn"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflareWorkersZonesByZoneRoutes(
|
|
utility::string_t zone,
|
|
std::shared_ptr<RouteCreateIn> routeCreateIn
|
|
) const;
|
|
/// <summary>
|
|
/// Drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Drops a zone's Cloudflare edge cache — either the whole zone (purge_everything) or exactly the listed file URLs. Requires org admin. Purging is the one zone-scoped WRITE this plane owns. It is not DNS — no record changes — so it does not belong on /v1/dns, and it is not a connection, so it does not belong on the integrations plane. It is a cache operation on a zone, which is what this asset plane is for. It takes the admin gate because dropping a zone's cache sends every subsequent request to the origin: on a site fronting a small origin that is a self-inflicted load spike, so it is a change, not a look. Exactly one selector is required. Cloudflare treats a body with neither as a no-op and answers 200, which reads as \"purged\" to a caller that never purged anything — the failure we refuse to pass through.
|
|
/// </remarks>
|
|
/// <param name="zone">Zone is the 32-hex Cloudflare zone id, from the path.</param>
|
|
/// <param name="purgeIn"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> postCloudflareZonesByZonePurge(
|
|
utility::string_t zone,
|
|
std::shared_ptr<PurgeIn> purgeIn
|
|
) const;
|
|
/// <summary>
|
|
/// Write a Workers KV value from the request body
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Stores one KV key on the org's OWN Cloudflare account. The REQUEST BODY IS THE VALUE, forwarded verbatim under the caller's own Content-Type (`text/plain` when none is sent), so a value is never re-encoded on the way in — which is why this is not a typed op. `expiration` and `expiration_ttl` may ride the query string and are passed through to Cloudflare. Requires ORG ADMIN (403 otherwise); the same namespace and key validation as the read answers 400; 503 if the org has never connected a Cloudflare token.
|
|
/// </remarks>
|
|
/// <param name="r_namespace"></param>
|
|
/// <param name="key"></param>
|
|
pplx::task<void> putCloudflareKvNamespacesByNamespaceValuesByKey(
|
|
utility::string_t r_namespace,
|
|
utility::string_t key
|
|
) const;
|
|
/// <summary>
|
|
/// Uploads or replaces a module Worker script.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Uploads or replaces a module Worker script. It publishes to the org's OWN Cloudflare account under the name in the path, replacing whatever was there, and relays Cloudflare's result. The compatibility date, compatibility flags and bindings are packed into the multipart upload Cloudflare expects, beside the module source. Requires ORG ADMIN — a Worker is arbitrary code on the org's own account and domains — so a caller who is only an org member is refused 403. An empty source is 400, as is a `mainModule` that is not a plain file name; 503 if the org has never connected a Cloudflare token.
|
|
/// </remarks>
|
|
/// <param name="script">Script means two things on this route, and the document says so in both places it appears: the PATH segment names the Worker to publish, and the BODY field carries that Worker's ES-module source — the code itself, never a name or a URL. A blank or absent source is refused; there is no empty Worker.</param>
|
|
/// <param name="workerScriptPut"></param>
|
|
pplx::task<std::shared_ptr<AnyType>> putCloudflareWorkersScriptsByScript(
|
|
utility::string_t script,
|
|
std::shared_ptr<WorkerScriptPut> workerScriptPut
|
|
) const;
|
|
|
|
protected:
|
|
std::shared_ptr<const ApiClient> m_ApiClient;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* HANZO_API_CloudflareApi_H_ */
|
|
|