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

771 lines
46 KiB
Swift

//
// AutoAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class AutoAPI {
/**
Deletes one automation, its versions and its run history.
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func deleteAutoFlowsById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await deleteAutoFlowsByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Deletes one automation, its versions and its run history.
- DELETE /v1/auto/flows/{id}
- Deletes one automation, its versions and its run history. It answers no content, and a flow of another org answers not-found.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func deleteAutoFlowsByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/auto/flows/{id}"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Connectors returns the connector catalogue.
- parameter apiConfiguration: The configuration for the http request.
- returns: Catalog
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getAutoConnectors(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Catalog {
return try await getAutoConnectorsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Connectors returns the connector catalogue.
- GET /v1/auto/connectors
- Connectors returns the connector catalogue. Each entry is an external service a flow step can invoke, carrying its auth descriptor and the input properties of its actions and triggers. The catalogue is the same for every tenant, so the gate is a validated principal rather than a per-org view.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Catalog>
*/
open class func getAutoConnectorsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Catalog> {
let localVariablePath = "/v1/auto/connectors"
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<Catalog>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns the caller org's automations, most-recently-updated first.
- parameter limit: (query) Limit bounds the page (default 200, maximum 1000). (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: FlowPage
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getAutoFlows(limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FlowPage {
return try await getAutoFlowsWithRequestBuilder(limit: limit, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns the caller org's automations, most-recently-updated first.
- GET /v1/auto/flows
- Returns the caller org's automations, most-recently-updated first. The optional `limit` query bounds the page.
- Bearer Token:
- type: http
- name: bearer
- parameter limit: (query) Limit bounds the page (default 200, maximum 1000). (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<FlowPage>
*/
open class func getAutoFlowsWithRequestBuilder(limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FlowPage> {
let localVariablePath = "/v1/auto/flows"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<FlowPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns one automation and its latest version.
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: PopulatedFlow
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getAutoFlowsById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PopulatedFlow {
return try await getAutoFlowsByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns one automation and its latest version.
- GET /v1/auto/flows/{id}
- Returns one automation and its latest version. That is the flow record plus the step tree the builder edits; a flow of another org answers not-found.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PopulatedFlow>
*/
open class func getAutoFlowsByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PopulatedFlow> {
var localVariablePath = "/v1/auto/flows/{id}"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<PopulatedFlow>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns one flow's versions, newest first.
- parameter id: (path) ID is the flow whose versions to list, from the path.
- parameter limit: (query) Limit bounds the page (default 200, maximum 1000). (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: VersionPage
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getAutoFlowsByIdVersions(id: String, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> VersionPage {
return try await getAutoFlowsByIdVersionsWithRequestBuilder(id: id, limit: limit, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns one flow's versions, newest first.
- GET /v1/auto/flows/{id}/versions
- Returns one flow's versions, newest first. The optional `limit` query bounds the page.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow whose versions to list, from the path.
- parameter limit: (query) Limit bounds the page (default 200, maximum 1000). (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<VersionPage>
*/
open class func getAutoFlowsByIdVersionsWithRequestBuilder(id: String, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<VersionPage> {
var localVariablePath = "/v1/auto/flows/{id}/versions"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<VersionPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns the caller org's run history, newest first.
- parameter flowId: (query) FlowID narrows the history to one flow. Omit it for the whole org&#39;s runs. (optional)
- parameter limit: (query) Limit bounds the page (default 200, maximum 1000). (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RunPage
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getAutoRuns(flowId: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RunPage {
return try await getAutoRunsWithRequestBuilder(flowId: flowId, limit: limit, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns the caller org's run history, newest first.
- GET /v1/auto/runs
- Returns the caller org's run history, newest first. The optional `flowId` query narrows it to one flow and `limit` bounds the page.
- Bearer Token:
- type: http
- name: bearer
- parameter flowId: (query) FlowID narrows the history to one flow. Omit it for the whole org&#39;s runs. (optional)
- parameter limit: (query) Limit bounds the page (default 200, maximum 1000). (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RunPage>
*/
open class func getAutoRunsWithRequestBuilder(flowId: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RunPage> {
let localVariablePath = "/v1/auto/runs"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"flowId": (wrappedValue: flowId?.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<RunPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Returns one run.
- parameter id: (path) ID is the run to read, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: FlowRun
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getAutoRunsById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FlowRun {
return try await getAutoRunsByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Returns one run.
- GET /v1/auto/runs/{id}
- Returns one run. A run that has not reached a terminal status is refreshed from the durable engine first — scoped to the org's own namespace — so the caller sees live progress rather than the last status that happened to be persisted.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the run to read, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<FlowRun>
*/
open class func getAutoRunsByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FlowRun> {
var localVariablePath = "/v1/auto/runs/{id}"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<FlowRun>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Updates one automation's metadata in place.
- parameter id: (path) ID is the flow to update, from the path.
- parameter patchFlowIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: Flow
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func patchAutoFlowsById(id: String, patchFlowIn: PatchFlowIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Flow {
return try await patchAutoFlowsByIdWithRequestBuilder(id: id, patchFlowIn: patchFlowIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Updates one automation's metadata in place.
- PATCH /v1/auto/flows/{id}
- Updates one automation's metadata in place. Every field is optional; a field the request omits is left alone. Publishing a version pins which one runs, and is refused unless that version belongs to this flow.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow to update, from the path.
- parameter patchFlowIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Flow>
*/
open class func patchAutoFlowsByIdWithRequestBuilder(id: String, patchFlowIn: PatchFlowIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Flow> {
var localVariablePath = "/v1/auto/flows/{id}"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: patchFlowIn, 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<Flow>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Run executes one connector action in-process and answers the outcome.
- parameter id: (path) ID is the connector to run, from the path.
- parameter runIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RunResp
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoConnectorsByIdRun(id: String, runIn: RunIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RunResp {
return try await postAutoConnectorsByIdRunWithRequestBuilder(id: id, runIn: runIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Run executes one connector action in-process and answers the outcome.
- POST /v1/auto/connectors/{id}/run
- Run executes one connector action in-process and answers the outcome. The caller's resolved credential travels in `auth`, delivered to the action verbatim — the runtime resolves no credential itself. An action that ran and failed (or an action name the connector does not have) answers ok:false with the failure message, not an HTTP error; an unknown connector is 404 and a missing action 422.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the connector to run, from the path.
- parameter runIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<RunResp>
*/
open class func postAutoConnectorsByIdRunWithRequestBuilder(id: String, runIn: RunIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RunResp> {
var localVariablePath = "/v1/auto/connectors/{id}/run"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: runIn, 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<RunResp>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Creates an automation and its initial DRAFT version in one call.
- parameter createFlowReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: PopulatedFlow
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoFlows(createFlowReq: CreateFlowReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PopulatedFlow {
return try await postAutoFlowsWithRequestBuilder(createFlowReq: createFlowReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Creates an automation and its initial DRAFT version in one call.
- POST /v1/auto/flows
- Creates an automation and its initial DRAFT version in one call. The new flow is DISABLED — creating it does not arm its trigger; POST /v1/auto/flows/{id}/enable does that.
- Bearer Token:
- type: http
- name: bearer
- parameter createFlowReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PopulatedFlow>
*/
open class func postAutoFlowsWithRequestBuilder(createFlowReq: CreateFlowReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PopulatedFlow> {
let localVariablePath = "/v1/auto/flows"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createFlowReq, 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<PopulatedFlow>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Disarms a flow's trigger and marks it DISABLED.
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: Flow
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoFlowsByIdDisable(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Flow {
return try await postAutoFlowsByIdDisableWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Disarms a flow's trigger and marks it DISABLED.
- POST /v1/auto/flows/{id}/disable
- Disarms a flow's trigger and marks it DISABLED. Its schedule and its event subscriptions are dropped, so a disabled flow is never a live target; runs already in flight are unaffected, and it can still be started on demand.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Flow>
*/
open class func postAutoFlowsByIdDisableWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Flow> {
var localVariablePath = "/v1/auto/flows/{id}/disable"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<Flow>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Arms a flow's trigger and marks it ENABLED.
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: Flow
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoFlowsByIdEnable(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Flow {
return try await postAutoFlowsByIdEnableWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Arms a flow's trigger and marks it ENABLED.
- POST /v1/auto/flows/{id}/enable
- Arms a flow's trigger and marks it ENABLED. A POLLING trigger gets a cron schedule on the durable engine; a WEBHOOK trigger gets a subscription in the routing index, so an inbound event starts it; a MANUAL trigger arms nothing and still runs on demand.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Flow>
*/
open class func postAutoFlowsByIdEnableWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Flow> {
var localVariablePath = "/v1/auto/flows/{id}/enable"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<Flow>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Edit a flow — rename it, retarget its trigger, or add, move and delete steps
- parameter id: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoFlowsByIdOperations(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postAutoFlowsByIdOperationsWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Edit a flow — rename it, retarget its trigger, or add, move and delete steps
- POST /v1/auto/flows/{id}/operations
- Applies ONE flow operation and answers the thing it changed. The operation is named by `type`, with its arguments under `request`: `CHANGE_NAME`, `UPDATE_TRIGGER`, `ADD_ACTION`, `UPDATE_ACTION`, `MOVE_ACTION`, `DELETE_ACTION` edit the flow's LATEST version and answer with that version, and `CHANGE_STATUS` instead enables or disables the flow and answers with the FLOW. Two response shapes on one address is the rule a reader would otherwise get wrong, and it is why this route is not a typed op. Edits land on the latest version only — the published version a run executes is untouched until it is republished — and the whole resulting step tree is re-validated against the step-count and size caps after every operation, so a long sequence of `ADD_ACTION` calls cannot grow a flow past a bound one step at a time (422 when it would). Org-scoped and fails closed: a validated principal is required (403 without one), the flow and its version are read under the caller's OWN org so another tenant's id is a 404, and an operation whose `request` does not decode is a 400.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postAutoFlowsByIdOperationsWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/auto/flows/{id}/operations"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Starts one durable run of a flow now.
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: FlowRun
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoFlowsByIdRun(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FlowRun {
return try await postAutoFlowsByIdRunWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Starts one durable run of a flow now.
- POST /v1/auto/flows/{id}/run
- Starts one durable run of a flow now. It runs the flow's published version if one is pinned, else its latest, and answers the run record it created. The run is bounded by the org's per-minute run-start budget and its in-flight concurrency ceiling; over either, or with the engine not ready, no run is started and no run id is burned.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<FlowRun>
*/
open class func postAutoFlowsByIdRunWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FlowRun> {
var localVariablePath = "/v1/auto/flows/{id}/run"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<FlowRun>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Adds a new DRAFT version to a flow.
- parameter id: (path) ID is the flow to add a version to, from the path.
- parameter createVersionIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: FlowVersion
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoFlowsByIdVersions(id: String, createVersionIn: CreateVersionIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FlowVersion {
return try await postAutoFlowsByIdVersionsWithRequestBuilder(id: id, createVersionIn: createVersionIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Adds a new DRAFT version to a flow.
- POST /v1/auto/flows/{id}/versions
- Adds a new DRAFT version to a flow. The version is created invalid unless it carries a trigger, and it does not become the running version until it is published (PATCH the flow's publishedVersionId) or becomes the latest.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the flow to add a version to, from the path.
- parameter createVersionIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<FlowVersion>
*/
open class func postAutoFlowsByIdVersionsWithRequestBuilder(id: String, createVersionIn: CreateVersionIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FlowVersion> {
var localVariablePath = "/v1/auto/flows/{id}/versions"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: createVersionIn, 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<FlowVersion>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Fire an event that starts every enabled flow subscribed to it
- parameter source: (path)
- parameter event: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoHooksBySourceByEvent(source: String, event: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postAutoHooksBySourceByEventWithRequestBuilder(source: source, event: event, apiConfiguration: apiConfiguration).execute().body
}
/**
Fire an event that starts every enabled flow subscribed to it
- POST /v1/auto/hooks/{source}/{event}
- Delivers one event to the org's automation triggers and answers `{matched:n}` — how many enabled flows had a webhook trigger on this `(source, event)` key and were started by it. A zero match is a success, not an error: nothing was subscribed. The path is the trigger key and the JSON object body is the event payload, threaded into each started run as `{{trigger.*}}` with all of its keys intact — which is why this is not a typed op, since a declared input struct would silently DISCARD every payload key it had no field for. Re-delivery is a no-op: an `X-Idempotency-Key` header dedupes, and with none the body is content-hashed instead, so a hammer of identical posts collapses to ONE run rather than minting a fresh one per post. An in-platform producer may propagate `X-Causation-Depth` so a firing that a flow caused is bounded against a loop; an absent or invalid header reads as depth 0, an external origin. Authenticated and org-scoped, unlike a provider's public webhook URL: a validated principal is required (403 without one) and the org is that principal's, never the body's, so a producer can only fire into its own tenant's flows. Both path segments are required (400) and a payload over the size limit is a 413.
- Bearer Token:
- type: http
- name: bearer
- parameter source: (path)
- parameter event: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postAutoHooksBySourceByEventWithRequestBuilder(source: String, event: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/auto/hooks/{source}/{event}"
let sourcePreEscape = "\(APIHelper.mapValueToPathItem(source))"
let sourcePostEscape = sourcePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{source}", with: sourcePostEscape, options: .literal, range: nil)
let eventPreEscape = "\(APIHelper.mapValueToPathItem(event))"
let eventPostEscape = eventPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{event}", with: eventPostEscape, options: .literal, range: nil)
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<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Release a run waiting at an approval step, with the approval payload
- parameter id: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: Void
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postAutoRunsByIdResume(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await postAutoRunsByIdResumeWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Release a run waiting at an approval step, with the approval payload
- POST /v1/auto/runs/{id}/resume
- Delivers the durable `resume` signal to a run parked on a `wait_for_approval` waitpoint and answers `{resumed:true}` once the engine has taken it. The body is an ARBITRARY JSON value — object, array, string, number — delivered VERBATIM into the workflow as that waitpoint's output, so it is what the steps after the approval read as their input. An empty body resumes with no payload. That open shape is why this route is not a typed op: an operation's input can carry the payload or the run address, never both. Org-scoped and fails closed: a validated principal is required (403 without one), the run is read under the caller's OWN org so another tenant's run id is a 404, a body that is not JSON is a 400, and a payload over the size limit is a 413 — it becomes durable engine state, so it is bounded here rather than after it lands. The resume is audited as `automations.run.resume`.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func postAutoRunsByIdResumeWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/auto/runs/{id}/resume"
let idPreEscape = "\(APIHelper.mapValueToPathItem(id))"
let idPostEscape = idPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{id}", with: idPostEscape, options: .literal, range: nil)
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<Void>.Type = apiConfiguration.requestBuilderFactory.getNonDecodableBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
}