Files
zeekay 1df3ddf6bd Regenerate against the document the deployment answers for
The projection these were generated from predated the compute migration, so
they described /v1/visor — which the API serves at zero paths now.

No /v1/visor path survives here.
2026-09-05 18:55:38 -07:00

276 lines
20 KiB
Swift

//
// ContentAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class ContentAPI {
/**
Aggregates the caller org's marketing content across every publishable content type into ONE queue board — the cross-type read the framework's per-DocType list cannot give.
- parameter status: (query) Status keeps only items in one lifecycle state (draft, in_review, approved, queued, published, archived). An undefined state is refused. (optional)
- parameter project: (query) Project keeps only items in one brand/site sub-scope. (optional)
- parameter doctype: (query) DocType keeps only one content type; omitted, the board spans every publishable type. An unknown type is refused. (optional)
- parameter limit: (query) Limit caps the rows returned, clamped to 1000. Defaults to 200, which is also what a non-positive or unparseable value takes. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: BoardPage
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getContentBoard(status: String? = nil, project: String? = nil, doctype: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> BoardPage {
return try await getContentBoardWithRequestBuilder(status: status, project: project, doctype: doctype, limit: limit, apiConfiguration: apiConfiguration).execute().body
}
/**
Aggregates the caller org's marketing content across every publishable content type into ONE queue board — the cross-type read the framework's per-DocType list cannot give.
- GET /v1/content/board
- Aggregates the caller org's marketing content across every publishable content type into ONE queue board — the cross-type read the framework's per-DocType list cannot give. It never fails on a partial outage: a content type the org has not installed, or one whose search errors, is skipped and logged rather than failing the whole board.
- Bearer Token:
- type: http
- name: bearer
- parameter status: (query) Status keeps only items in one lifecycle state (draft, in_review, approved, queued, published, archived). An undefined state is refused. (optional)
- parameter project: (query) Project keeps only items in one brand/site sub-scope. (optional)
- parameter doctype: (query) DocType keeps only one content type; omitted, the board spans every publishable type. An unknown type is refused. (optional)
- parameter limit: (query) Limit caps the rows returned, clamped to 1000. Defaults to 200, which is also what a non-positive or unparseable value takes. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<BoardPage>
*/
open class func getContentBoardWithRequestBuilder(status: String? = nil, project: String? = nil, doctype: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<BoardPage> {
let localVariablePath = "/v1/content/board"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"status": (wrappedValue: status?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"project": (wrappedValue: project?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"doctype": (wrappedValue: doctype?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<BoardPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Lists the distribution channels the caller's org has connected — the social integrations a publish can target.
- parameter apiConfiguration: The configuration for the http request.
- returns: ChannelList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getContentChannels(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> ChannelList {
return try await getContentChannelsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Lists the distribution channels the caller's org has connected — the social integrations a publish can target.
- GET /v1/content/channels
- Lists the distribution channels the caller's org has connected — the social integrations a publish can target. A deployment with no distribution edge wired answers 503 rather than an empty list that would read as \"no channels\".
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<ChannelList>
*/
open class func getContentChannelsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<ChannelList> {
let localVariablePath = "/v1/content/channels"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<ChannelList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns the ONE marketing-content state machine: the ordered lifecycle states, which state a fresh document starts in, which one is publicly live, and the legal successors of every state.
- parameter apiConfiguration: The configuration for the http request.
- returns: StateGraph
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getContentLifecycle(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> StateGraph {
return try await getContentLifecycleWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Returns the ONE marketing-content state machine: the ordered lifecycle states, which state a fresh document starts in, which one is publicly live, and the legal successors of every state.
- GET /v1/content/lifecycle
- Returns the ONE marketing-content state machine: the ordered lifecycle states, which state a fresh document starts in, which one is publicly live, and the legal successors of every state. The console builds its board columns and its per-item action buttons from this single answer, so the UI and the write-time enforcement hook can never disagree about what is legal.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<StateGraph>
*/
open class func getContentLifecycleWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<StateGraph> {
let localVariablePath = "/v1/content/lifecycle"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<StateGraph>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Moves one content item to a new lifecycle state and, on the move to published, fans it out to the item's channels.
- parameter doctype: (path) DocType is the content type to act on, from the path.
- parameter name: (path) Name is the document to act on, from the path.
- parameter transitionIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: TransitionResult
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postContentByDoctypeByNameTransition(doctype: String, name: String, transitionIn: TransitionIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> TransitionResult {
return try await postContentByDoctypeByNameTransitionWithRequestBuilder(doctype: doctype, name: name, transitionIn: transitionIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Moves one content item to a new lifecycle state and, on the move to published, fans it out to the item's channels.
- POST /v1/content/{doctype}/{name}/transition
- Moves one content item to a new lifecycle state and, on the move to published, fans it out to the item's channels. The edge must be legal for the item's current state — an illegal move is refused with 409 — and the status write re-validates it at the storage boundary. Distribution is best effort: its honest state is reported on the result and a distribution failure never rolls the status change back.
- Bearer Token:
- type: http
- name: bearer
- parameter doctype: (path) DocType is the content type to act on, from the path.
- parameter name: (path) Name is the document to act on, from the path.
- parameter transitionIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<TransitionResult>
*/
open class func postContentByDoctypeByNameTransitionWithRequestBuilder(doctype: String, name: String, transitionIn: TransitionIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<TransitionResult> {
var localVariablePath = "/v1/content/{doctype}/{name}/transition"
let doctypePreEscape = "\(APIHelper.mapValueToPathItem(doctype))"
let doctypePostEscape = doctypePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{doctype}", with: doctypePostEscape, options: .literal, range: nil)
let namePreEscape = "\(APIHelper.mapValueToPathItem(name))"
let namePostEscape = namePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{name}", with: namePostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: transitionIn, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<TransitionResult>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Draft a piece of marketing content and file it in the CMS as a draft.
- parameter generateInput: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: GenerateResult
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postContentGenerate(generateInput: GenerateInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> GenerateResult {
return try await postContentGenerateWithRequestBuilder(generateInput: generateInput, apiConfiguration: apiConfiguration).execute().body
}
/**
Draft a piece of marketing content and file it in the CMS as a draft.
- POST /v1/content/generate
- Draft a piece of marketing content and file it in the CMS as a draft. Answers 201 with the created draft's identity — {doctype, name, status} — and the document itself lands in the CMS through the SAME validate and lifecycle-hook pipeline an ordinary create runs. This is a WRITE, not a preview: there is no dry-run, and every call that succeeds leaves a document behind. `doctype` picks which of two generation planes runs, and they are the only two. Campaign and SocialPost are drafted as brand COPY on the platform AI plane (zen5 by default, overridable per request with `model` or per deployment); Asset is a studio image render the AI plane never sees. Everything else about the call is identical. MONEY, metered in exactly one place per mode and never both. Copy rides the platform's own inference meter — the org's balance is authorised before the model call and debited at the exact token cost after — so content never re-bills it. A studio render is invisible to that meter, so content is the sole meter for it: the org is gated BEFORE the GPU compute and refused 402 when out of funds or over its spend cap, and the debit is recorded only once the render actually returns, because the billable event is the consumed compute and not the CMS row. `project` rides the BODY rather than a server-minted identity claim, so it attributes spend but a project-scoped cap stays soft on it — the org is the value that is enforced. The org is the caller's own, resolved once from the validated principal and never read from the body; a caller without one is refused 403. Status is not the generator's to choose: a generated item is ALWAYS a draft, and the storage-boundary hook enforces that a second time. It fails closed rather than inventing anything. An unknown content type is 404 and a deployment whose marketing module is not installed is 409 naming the install call. An AI plane or studio that is unconfigured or unreachable, a graph the studio rejects, and a render that does not return in time all degrade to 503 — never fabricated copy, never a fake render. A `source_media` that fails the SSRF and traversal validator is 400 raised before the billing gate and before the studio is contacted, so a hostile source never costs the caller anything.
- Bearer Token:
- type: http
- name: bearer
- parameter generateInput: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<GenerateResult>
*/
open class func postContentGenerateWithRequestBuilder(generateInput: GenerateInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<GenerateResult> {
let localVariablePath = "/v1/content/generate"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: generateInput, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<GenerateResult>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome.
- parameter publishInput: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: PublishResult
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postContentPublish(publishInput: PublishInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PublishResult {
return try await postContentPublishWithRequestBuilder(publishInput: publishInput, apiConfiguration: apiConfiguration).execute().body
}
/**
Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome.
- POST /v1/content/publish
- Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome. The item names itself — its caption, media and channel list are read from the stored document, not from this request. It is idempotent per channel (a channel already posted for this item is skipped), and a publish that loses the per-item lease to a live publisher answers status \"in_progress\" having posted nothing.
- Bearer Token:
- type: http
- name: bearer
- parameter publishInput: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PublishResult>
*/
open class func postContentPublishWithRequestBuilder(publishInput: PublishInput, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PublishResult> {
let localVariablePath = "/v1/content/publish"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: publishInput, codableHelper: apiConfiguration.codableHelper)
let localVariableUrlComponents = URLComponents(string: localVariableURLString)
let localVariableNillableHeaders: [String: (any Sendable)?] = [
"Content-Type": "application/json",
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<PublishResult>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
}