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

464 lines
26 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.
*/
/*
* MarketingApi.h
*
*
*/
#ifndef HANZO_API_MarketingApi_H_
#define HANZO_API_MarketingApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/Audience.h"
#include "hanzo/model/AudienceList.h"
#include "hanzo/model/AudiencePreview.h"
#include "hanzo/model/CalendarPost.h"
#include "hanzo/model/Campaign.h"
#include "hanzo/model/CampaignList.h"
#include "hanzo/model/EnrollInput.h"
#include "hanzo/model/EnrollResult.h"
#include "hanzo/model/EnrollmentList.h"
#include "hanzo/model/PostList.h"
#include "hanzo/model/PromoList.h"
#include "hanzo/model/Quote.h"
#include "hanzo/model/RedeemInput.h"
#include "hanzo/model/RedeemResult.h"
#include "hanzo/model/Redemption.h"
#include "hanzo/model/ScheduleInput.h"
#include "hanzo/model/Sequence.h"
#include "hanzo/model/SequenceList.h"
#include "hanzo/model/SequenceStatus.h"
#include "hanzo/model/SequenceView.h"
#include "hanzo/model/Step.h"
#include "hanzo/model/StepInput.h"
#include "hanzo/model/StepList.h"
#include "hanzo/model/Summary.h"
#include "hanzo/model/Suppression.h"
#include "hanzo/model/SuppressionList.h"
#include "hanzo/model/Unsubscribed.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class MarketingApi
{
public:
explicit MarketingApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~MarketingApi();
/// <summary>
/// Removes one of the caller org&#39;s audiences and answers 204.
/// </summary>
/// <remarks>
/// Removes one of the caller org&#39;s audiences and answers 204. It deletes the saved filter only — no customer, event or enrollment is touched.
/// </remarks>
/// <param name="id">ID is the audience id from the path, as returned by create.</param>
pplx::task<void> deleteMarketingAudiencesById(
utility::string_t id
) const;
/// <summary>
/// Removes one of the caller org&#39;s posts and answers 204.
/// </summary>
/// <remarks>
/// Removes one of the caller org&#39;s posts and answers 204. A post already published is deleted from the calendar only — nothing is retracted from the network it went out on.
/// </remarks>
/// <param name="id">ID is the post id from the path, as returned by create.</param>
pplx::task<void> deleteMarketingCalendarById(
utility::string_t id
) const;
/// <summary>
/// Removes one of the caller org&#39;s campaigns and answers 204.
/// </summary>
/// <remarks>
/// Removes one of the caller org&#39;s campaigns and answers 204. A campaign belonging to another org reads as not found and is left untouched.
/// </remarks>
/// <param name="id">ID is the campaign id from the path, as returned by create.</param>
pplx::task<void> deleteMarketingCampaignsById(
utility::string_t id
) const;
/// <summary>
/// Re-subscribes an address on one channel and answers 204.
/// </summary>
/// <remarks>
/// Re-subscribes an address on one channel and answers 204. An address that is not on the list reads as not found.
/// </remarks>
/// <param name="channel">Channel is the surface opted out of: email, sms, social, meta, google or tiktok. Empty means email. Opting out of one leaves the others reachable. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="address">Address is the recipient, normalized (lower-cased, trimmed) so an opt-out cannot be slipped past on a case or whitespace difference. Required. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="reason">Reason is a free-text note, capped at 1024 bytes. The public one-click endpoint records \&quot;one-click unsubscribe\&quot;. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="createdAt">CreatedAt is unix seconds, server-assigned. (optional, default to 0L)</param>
pplx::task<void> deleteMarketingSuppressions(
boost::optional<utility::string_t> channel,
boost::optional<utility::string_t> address,
boost::optional<utility::string_t> reason,
boost::optional<int64_t> createdAt
) const;
/// <summary>
/// Returns the org&#39;s saved audiences, most recently updated first.
/// </summary>
/// <remarks>
/// Returns the org&#39;s saved audiences, most recently updated first.
/// </remarks>
/// <param name="limit">Limit caps the rows returned; 0 means 200 and nothing above 1000 is honoured. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<AudienceList>> getMarketingAudiences(
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one of the caller org&#39;s saved audiences.
/// </summary>
/// <remarks>
/// Returns one of the caller org&#39;s saved audiences. An audience belonging to another org reads as not found.
/// </remarks>
/// <param name="id">ID is the audience id from the path, as returned by create.</param>
pplx::task<std::shared_ptr<Audience>> getMarketingAudiencesById(
utility::string_t id
) const;
/// <summary>
/// Evaluates the cohort LIVE — the same resolution an enrollment would run — and reports how big it is and how many real mailboxes it reaches.
/// </summary>
/// <remarks>
/// Evaluates the cohort LIVE — the same resolution an enrollment would run — and reports how big it is and how many real mailboxes it reaches. It is the honest answer to \&quot;is this send worth making\&quot;: a cohort of 500 that mails 3 says so, in deliverable and unmatched. Nothing is sent.
/// </remarks>
/// <param name="id">ID is the audience id from the path, as returned by create.</param>
pplx::task<std::shared_ptr<AudiencePreview>> getMarketingAudiencesByIdPreview(
utility::string_t id
) const;
/// <summary>
/// Returns the org&#39;s calendar, latest scheduled first, optionally narrowed to one status.
/// </summary>
/// <remarks>
/// Returns the org&#39;s calendar, latest scheduled first, optionally narrowed to one status.
/// </remarks>
/// <param name="status">Status keeps only posts in that state (draft, scheduled, published, failed, canceled). Empty means every post. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="limit">Limit caps the rows returned; 0 means 200 and nothing above 1000 is honoured. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<PostList>> getMarketingCalendar(
boost::optional<utility::string_t> status,
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one of the caller org&#39;s posts, including the exact error behind a failed publish.
/// </summary>
/// <remarks>
/// Returns one of the caller org&#39;s posts, including the exact error behind a failed publish. A post belonging to another org reads as not found.
/// </remarks>
/// <param name="id">ID is the post id from the path, as returned by create.</param>
pplx::task<std::shared_ptr<CalendarPost>> getMarketingCalendarById(
utility::string_t id
) const;
/// <summary>
/// Returns the org&#39;s campaigns, most recently updated first, optionally narrowed to one lifecycle status.
/// </summary>
/// <remarks>
/// Returns the org&#39;s campaigns, most recently updated first, optionally narrowed to one lifecycle status.
/// </remarks>
/// <param name="status">Status keeps only campaigns in that lifecycle state (draft, scheduled, active, paused, completed). Empty means every campaign. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="limit">Limit caps the rows returned; 0 means 200 and nothing above 1000 is honoured. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<CampaignList>> getMarketingCampaigns(
boost::optional<utility::string_t> status,
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one of the caller org&#39;s campaigns.
/// </summary>
/// <remarks>
/// Returns one of the caller org&#39;s campaigns. A campaign belonging to another org reads as not found.
/// </remarks>
/// <param name="id">ID is the campaign id from the path, as returned by create.</param>
pplx::task<std::shared_ptr<Campaign>> getMarketingCampaignsById(
utility::string_t id
) const;
/// <summary>
/// Returns every promo the deployment offers with its live counters: how many orgs have redeemed it and how many redemptions remain under the cap.
/// </summary>
/// <remarks>
/// Returns every promo the deployment offers with its live counters: how many orgs have redeemed it and how many redemptions remain under the cap. The promos are fleet-wide, not per-org — only the counters move.
/// </remarks>
pplx::task<std::shared_ptr<PromoList>> getMarketingPromos(
) const;
/// <summary>
/// Prices a promo against a plan and seat count.
/// </summary>
/// <remarks>
/// Prices a promo against a plan and seat count. It is PURE: nothing is redeemed, credited or counted, so it is safe to call from a pricing page on every keystroke. An inactive promo or an exhausted cap quotes ineligible with the reason rather than erroring.
/// </remarks>
/// <param name="code">Code is the promo code from the path.</param>
/// <param name="plan">Plan is the plan being priced: pro, max or team. Anything else (including the free Developer plan) has no list price and so nothing to discount. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="seats">Seats is the Team seat count; 0 means 1, and it is ignored for the single-seat plans. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<Quote>> getMarketingPromosByCodeEligibility(
utility::string_t code,
boost::optional<utility::string_t> plan,
boost::optional<int64_t> seats
) const;
/// <summary>
/// Returns the caller org&#39;s OWN redemption of a promo — an org-scoped read, so it can never surface another tenant&#39;s.
/// </summary>
/// <remarks>
/// Returns the caller org&#39;s OWN redemption of a promo — an org-scoped read, so it can never surface another tenant&#39;s. Not found when this org has not redeemed it.
/// </remarks>
/// <param name="code">Code is the promo code from the path, e.g. \&quot;first1000\&quot;.</param>
pplx::task<std::shared_ptr<Redemption>> getMarketingPromosByCodeRedemption(
utility::string_t code
) const;
/// <summary>
/// Returns the org&#39;s drip sequences, most recently updated first.
/// </summary>
/// <remarks>
/// Returns the org&#39;s drip sequences, most recently updated first.
/// </remarks>
/// <param name="limit">Limit caps the rows returned; 0 means 200 and nothing above 1000 is honoured. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<SequenceList>> getMarketingSequences(
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one of the caller org&#39;s sequences together with its steps in send order.
/// </summary>
/// <remarks>
/// Returns one of the caller org&#39;s sequences together with its steps in send order. A sequence belonging to another org reads as not found.
/// </remarks>
/// <param name="id">ID is the sequence id from the path, as returned by create.</param>
pplx::task<std::shared_ptr<SequenceView>> getMarketingSequencesById(
utility::string_t id
) const;
/// <summary>
/// Returns who is walking one sequence, most recently enrolled first, with each walk&#39;s current step and next due time.
/// </summary>
/// <remarks>
/// Returns who is walking one sequence, most recently enrolled first, with each walk&#39;s current step and next due time.
/// </remarks>
/// <param name="id">ID is the sequence id from the path.</param>
/// <param name="limit">Limit caps the rows returned; 0 means 200 and nothing above 1000 is honoured. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<EnrollmentList>> getMarketingSequencesByIdEnrollments(
utility::string_t id,
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one sequence&#39;s steps in send order.
/// </summary>
/// <remarks>
/// Returns one sequence&#39;s steps in send order.
/// </remarks>
/// <param name="id">ID is the sequence id from the path, as returned by create.</param>
pplx::task<std::shared_ptr<StepList>> getMarketingSequencesByIdSteps(
utility::string_t id
) const;
/// <summary>
/// Rolls up the caller org&#39;s campaigns: how many there are, how many are active, and the summed budget and spend in cents.
/// </summary>
/// <remarks>
/// Rolls up the caller org&#39;s campaigns: how many there are, how many are active, and the summed budget and spend in cents.
/// </remarks>
pplx::task<std::shared_ptr<Summary>> getMarketingSummary(
) const;
/// <summary>
/// Returns the org&#39;s opt-out list, newest first — everyone the send gate will refuse to deliver to.
/// </summary>
/// <remarks>
/// Returns the org&#39;s opt-out list, newest first — everyone the send gate will refuse to deliver to.
/// </remarks>
/// <param name="limit">Limit caps the rows returned; 0 means 200 and nothing above 1000 is honoured. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<SuppressionList>> getMarketingSuppressions(
boost::optional<int64_t> limit
) const;
/// <summary>
/// Is the PUBLIC one-click endpoint (no principal): a recipient clicks the signed link in an email footer.
/// </summary>
/// <remarks>
/// Is the PUBLIC one-click endpoint (no principal): a recipient clicks the signed link in an email footer. The token binds (org, channel, address), so a caller can only opt OUT exactly the tuple it was minted for — never another address and never another org. An invalid token is refused, and a deployment with no KMS-sealed key refuses rather than accepting anything.
/// </remarks>
/// <param name="org">Org is the org the link was minted for. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="channel">Channel is the surface to opt out of. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="address">Address is the recipient to opt out. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="token">Token is the HMAC over (org, channel, address). It is the ONLY authority here — there is no principal — so it binds the request to one tuple and nothing else. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
pplx::task<std::shared_ptr<Unsubscribed>> getMarketingUnsubscribe(
boost::optional<utility::string_t> org,
boost::optional<utility::string_t> channel,
boost::optional<utility::string_t> address,
boost::optional<utility::string_t> token
) const;
/// <summary>
/// Saves a cohort filter for the caller&#39;s org.
/// </summary>
/// <remarks>
/// Saves a cohort filter for the caller&#39;s org. Name is required. Omitting event saves the WHOLE-ORG audience — every mailable customer — which needs no analytics warehouse; naming one narrows that roster to the customers who fired it within windowDays.
/// </remarks>
/// <param name="audience"></param>
pplx::task<std::shared_ptr<Audience>> postMarketingAudiences(
std::shared_ptr<Audience> audience
) const;
/// <summary>
/// Adds a post to the content calendar.
/// </summary>
/// <remarks>
/// Adds a post to the content calendar. Channel and body are required. A scheduledAt in the future makes the post \&quot;scheduled\&quot; and the durable sweep publishes it when it comes due — claimed once, so a post publishes at most once; without one it stays a draft.
/// </remarks>
/// <param name="calendarPost"></param>
pplx::task<std::shared_ptr<CalendarPost>> postMarketingCalendar(
std::shared_ptr<CalendarPost> calendarPost
) const;
/// <summary>
/// Publishes a post NOW, synchronously, whatever its schedule.
/// </summary>
/// <remarks>
/// Publishes a post NOW, synchronously, whatever its schedule. No social connector is wired today, so every channel answers an honest 501 naming the client a real one would plug into, and the post is recorded failed with that exact reason — never a faked \&quot;published\&quot;.
/// </remarks>
/// <param name="id">ID is the post id from the path, as returned by create.</param>
pplx::task<std::shared_ptr<CalendarPost>> postMarketingCalendarByIdPublish(
utility::string_t id
) const;
/// <summary>
/// Registers a campaign in the caller&#39;s org.
/// </summary>
/// <remarks>
/// Registers a campaign in the caller&#39;s org. Name is required; channel defaults to email and status to draft, and a future scheduledAt with no explicit status makes the campaign \&quot;scheduled\&quot;. Budget and spend are cents and are clamped to &gt;&#x3D; 0. The id, createdAt and updatedAt of the input are ignored — the server assigns them.
/// </remarks>
/// <param name="campaign"></param>
pplx::task<std::shared_ptr<Campaign>> postMarketingCampaigns(
std::shared_ptr<Campaign> campaign
) const;
/// <summary>
/// Sets a campaign&#39;s send time and moves it to \&quot;scheduled\&quot;.
/// </summary>
/// <remarks>
/// Sets a campaign&#39;s send time and moves it to \&quot;scheduled\&quot;. A scheduledAt of 0 clears the schedule and returns it to \&quot;draft\&quot;.
/// </remarks>
/// <param name="id">ID is the campaign id from the path.</param>
/// <param name="scheduleInput"></param>
pplx::task<std::shared_ptr<Campaign>> postMarketingCampaignsByIdSchedule(
utility::string_t id,
std::shared_ptr<ScheduleInput> scheduleInput
) const;
/// <summary>
/// Records the caller org&#39;s claim on a promo.
/// </summary>
/// <remarks>
/// Records the caller org&#39;s claim on a promo. NOTHING IS CREDITED: the redemption is a row, and credit into an org is an admin decision made on the admin surface against an auditable ledger. The plan is DERIVED from the org&#39;s live ACTIVE/TRIALING paid subscription and can never be named by the caller — an org with no qualifying subscription is refused, and so is one whose subscription cannot be read. The seat count is the single-seat floor (claimSeats), so the recorded figure has no input that can inflate it. Guards run under one lock so the cap cannot be raced past: the fleet-wide redemption cap, one redemption per org, one per payment instrument (REQUIRED), and the per-redemption ceiling. It is IDEMPOTENT: an org that already redeemed gets its original redemption back with alreadyRedeemed true.
/// </remarks>
/// <param name="code">Code is the promo code from the path.</param>
/// <param name="redeemInput"></param>
pplx::task<std::shared_ptr<RedeemResult>> postMarketingPromosByCodeRedeem(
utility::string_t code,
std::shared_ptr<RedeemInput> redeemInput
) const;
/// <summary>
/// Registers a drip sequence in the caller&#39;s org.
/// </summary>
/// <remarks>
/// Registers a drip sequence in the caller&#39;s org. Name is required; status defaults to draft, and a sequence must be ACTIVE before it will accept enrollments. The id, createdAt and updatedAt of the input are ignored — the server assigns them.
/// </remarks>
/// <param name="sequence"></param>
pplx::task<std::shared_ptr<Sequence>> postMarketingSequences(
std::shared_ptr<Sequence> sequence
) const;
/// <summary>
/// Adds one contact or a whole audience to a sequence and schedules the first step for each.
/// </summary>
/// <remarks>
/// Adds one contact or a whole audience to a sequence and schedules the first step for each. The sequence must be ACTIVE (a draft sends nothing), and the request must name exactly one of address or audienceId. Enrolling is ALL this does: the message itself is sent later by the drip engine, through the suppression gate, so an opted-out customer can be enrolled here and still never be mailed. Re-posting is safe — an address this sequence already took is counted in alreadyEnrolled and never double-dripped — which is what makes retrying a partially-applied announcement a resume rather than a second send.
/// </remarks>
/// <param name="id">ID is the sequence id from the path.</param>
/// <param name="enrollInput"></param>
pplx::task<std::shared_ptr<EnrollResult>> postMarketingSequencesByIdEnroll(
utility::string_t id,
std::shared_ptr<EnrollInput> enrollInput
) const;
/// <summary>
/// Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled.
/// </summary>
/// <remarks>
/// Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled. Only an ACTIVE enrollment can be canceled — one already completed or canceled reads as not found.
/// </remarks>
/// <param name="id">ID is the sequence id from the path.</param>
/// <param name="eid">EID is the enrollment id from the path, as returned by a single-address enroll.</param>
pplx::task<void> postMarketingSequencesByIdEnrollmentsByEidCancel(
utility::string_t id,
utility::string_t eid
) const;
/// <summary>
/// Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments.
/// </summary>
/// <remarks>
/// Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments. It does not touch enrollments already walking: archiving stops new ones, not in-flight ones.
/// </remarks>
/// <param name="id">ID is the sequence id from the path.</param>
/// <param name="sequenceStatus"></param>
pplx::task<std::shared_ptr<SequenceStatus>> postMarketingSequencesByIdStatus(
utility::string_t id,
std::shared_ptr<SequenceStatus> sequenceStatus
) const;
/// <summary>
/// Appends a message to the END of a sequence: the new step&#39;s idx is one past the last, so steps arrive in the order they are added.
/// </summary>
/// <remarks>
/// Appends a message to the END of a sequence: the new step&#39;s idx is one past the last, so steps arrive in the order they are added. Body is required and delaySeconds must be &gt;&#x3D; 0. Adding a step does not disturb enrollments already walking — one that has passed this index simply never sees it.
/// </remarks>
/// <param name="id">SequenceID is the sequence id from the path (the route&#39;s :id).</param>
/// <param name="stepInput"></param>
pplx::task<std::shared_ptr<Step>> postMarketingSequencesByIdSteps(
utility::string_t id,
std::shared_ptr<StepInput> stepInput
) const;
/// <summary>
/// Records an opt-out for the org (admin / self-service management).
/// </summary>
/// <remarks>
/// Records an opt-out for the org (admin / self-service management). Address is required; channel defaults to email. It is idempotent: re-suppressing the same tuple keeps the original record rather than erroring. From here on the ONE send gate refuses that recipient on that channel.
/// </remarks>
/// <param name="suppression"></param>
pplx::task<std::shared_ptr<Suppression>> postMarketingSuppressions(
std::shared_ptr<Suppression> suppression
) const;
/// <summary>
/// Replaces a post&#39;s editable fields.
/// </summary>
/// <remarks>
/// Replaces a post&#39;s editable fields. It is a full write, not a patch, and it RESETS the lifecycle from the schedule: a scheduledAt makes the post \&quot;scheduled\&quot; again and none makes it a draft — so editing a failed post requeues it rather than leaving it stuck.
/// </remarks>
/// <param name="id">ID is the server-assigned post id (\&quot;cal_\&quot; + 128 random bits).</param>
/// <param name="calendarPost"></param>
pplx::task<std::shared_ptr<CalendarPost>> putMarketingCalendarById(
utility::string_t id,
std::shared_ptr<CalendarPost> calendarPost
) const;
/// <summary>
/// Replaces a campaign&#39;s editable fields.
/// </summary>
/// <remarks>
/// Replaces a campaign&#39;s editable fields. It is a full write, not a patch: every field takes the value in the body, and an omitted one is cleared. The id comes from the path — the body cannot retarget another campaign — and createdAt is never rewritten.
/// </remarks>
/// <param name="id">ID is the server-assigned campaign id (\&quot;camp_\&quot; + 128 random bits).</param>
/// <param name="campaign"></param>
pplx::task<std::shared_ptr<Campaign>> putMarketingCampaignsById(
utility::string_t id,
std::shared_ptr<Campaign> campaign
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_MarketingApi_H_ */