mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
358 lines
21 KiB
Swift
358 lines
21 KiB
Swift
//
|
|
// FlowAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class FlowAPI {
|
|
|
|
/**
|
|
Deletes one of the caller's workflows and its runs.
|
|
|
|
- parameter workflow: (path) Workflow is the workflow's UUID, taken from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func deleteFlowWorkflowsByWorkflow(workflow: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await deleteFlowWorkflowsByWorkflowWithRequestBuilder(workflow: workflow, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Deletes one of the caller's workflows and its runs.
|
|
- DELETE /v1/flow/workflows/{workflow}
|
|
- Deletes one of the caller's workflows and its runs. Ownership is verified first; a foreign id answers 404 and deletes nothing.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter workflow: (path) Workflow is the workflow's UUID, taken from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func deleteFlowWorkflowsByWorkflowWithRequestBuilder(workflow: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/flow/workflows/{workflow}"
|
|
let workflowPreEscape = "\(APIHelper.mapValueToPathItem(workflow))"
|
|
let workflowPostEscape = workflowPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{workflow}", with: workflowPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Runs reads one workflow's recorded runs: every component build with its result, keyed by component.
|
|
|
|
- parameter workflow: (query) Workflow is the UUID of the workflow whose run records to read. It rides the query string. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFlowRuns(workflow: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getFlowRunsWithRequestBuilder(workflow: workflow, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Runs reads one workflow's recorded runs: every component build with its result, keyed by component.
|
|
- GET /v1/flow/runs
|
|
- Runs reads one workflow's recorded runs: every component build with its result, keyed by component. Ownership is verified first — run records never cross the org boundary.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter workflow: (query) Workflow is the UUID of the workflow whose run records to read. It rides the query string. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getFlowRunsWithRequestBuilder(workflow: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/flow/runs"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"workflow": (wrappedValue: workflow?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Status reports whether the flow service is reachable and which version it runs.
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: FlowStatus
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFlowStatus(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> FlowStatus {
|
|
return try await getFlowStatusWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Status reports whether the flow service is reachable and which version it runs.
|
|
- GET /v1/flow/status
|
|
- Status reports whether the flow service is reachable and which version it runs. It is the product's own /health and /v1/version composed — an honest lens for \"is the workflow plane up\", never a fabricated ok.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<FlowStatus>
|
|
*/
|
|
open class func getFlowStatusWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<FlowStatus> {
|
|
let localVariablePath = "/v1/flow/status"
|
|
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<FlowStatus>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Workflows lists the caller's workflows, paged.
|
|
|
|
- parameter page: (query) Page is the 1-based page of workflows to return. (optional)
|
|
- parameter size: (query) Size is how many workflows one page holds (the product caps it at 100). (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFlowWorkflows(page: String? = nil, size: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getFlowWorkflowsWithRequestBuilder(page: page, size: size, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Workflows lists the caller's workflows, paged.
|
|
- GET /v1/flow/workflows
|
|
- Workflows lists the caller's workflows, paged. The list is scoped server-side to the org's project — the page can only ever hold the caller's own workflows.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter page: (query) Page is the 1-based page of workflows to return. (optional)
|
|
- parameter size: (query) Size is how many workflows one page holds (the product caps it at 100). (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getFlowWorkflowsWithRequestBuilder(page: String? = nil, size: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/flow/workflows"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"page": (wrappedValue: page?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"size": (wrappedValue: size?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Workflow reads one of the caller's workflows — the full record, graph included.
|
|
|
|
- parameter workflow: (path) Workflow is the workflow's UUID, taken from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getFlowWorkflowsByWorkflow(workflow: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await getFlowWorkflowsByWorkflowWithRequestBuilder(workflow: workflow, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Workflow reads one of the caller's workflows — the full record, graph included.
|
|
- GET /v1/flow/workflows/{workflow}
|
|
- Workflow reads one of the caller's workflows — the full record, graph included. A workflow outside the caller's org answers 404, indistinguishable from one that does not exist.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter workflow: (path) Workflow is the workflow's UUID, taken from the path.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func getFlowWorkflowsByWorkflowWithRequestBuilder(workflow: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/flow/workflows/{workflow}"
|
|
let workflowPreEscape = "\(APIHelper.mapValueToPathItem(workflow))"
|
|
let workflowPostEscape = workflowPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{workflow}", with: workflowPostEscape, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Patches one of the caller's workflows: name, description, graph, or the locked flag — only the stated fields move.
|
|
|
|
- parameter workflow: (path) Workflow is the workflow's UUID, taken from the path.
|
|
- parameter flowUpdate: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func patchFlowWorkflowsByWorkflow(workflow: String, flowUpdate: FlowUpdate, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await patchFlowWorkflowsByWorkflowWithRequestBuilder(workflow: workflow, flowUpdate: flowUpdate, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Patches one of the caller's workflows: name, description, graph, or the locked flag — only the stated fields move.
|
|
- PATCH /v1/flow/workflows/{workflow}
|
|
- Patches one of the caller's workflows: name, description, graph, or the locked flag — only the stated fields move. Ownership is verified before the patch reaches the product.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter workflow: (path) Workflow is the workflow's UUID, taken from the path.
|
|
- parameter flowUpdate: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func patchFlowWorkflowsByWorkflowWithRequestBuilder(workflow: String, flowUpdate: FlowUpdate, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
var localVariablePath = "/v1/flow/workflows/{workflow}"
|
|
let workflowPreEscape = "\(APIHelper.mapValueToPathItem(workflow))"
|
|
let workflowPostEscape = workflowPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{workflow}", with: workflowPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: flowUpdate, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PATCH", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Run executes one of the caller's workflows synchronously: the graph runs in the flow service and the response carries the run's session and outputs.
|
|
|
|
- parameter flowRun: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postFlowRuns(flowRun: FlowRun, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postFlowRunsWithRequestBuilder(flowRun: flowRun, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Run executes one of the caller's workflows synchronously: the graph runs in the flow service and the response carries the run's session and outputs.
|
|
- POST /v1/flow/runs
|
|
- Run executes one of the caller's workflows synchronously: the graph runs in the flow service and the response carries the run's session and outputs. A graph whose components fail reports the product's own error. Runs are bounded by the product's five-minute sync ceiling.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter flowRun: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postFlowRunsWithRequestBuilder(flowRun: FlowRun, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/flow/runs"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: flowRun, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Creates a workflow in the caller's org.
|
|
|
|
- parameter flowCreate: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: JSONValue
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func postFlowWorkflows(flowCreate: FlowCreate, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> JSONValue {
|
|
return try await postFlowWorkflowsWithRequestBuilder(flowCreate: flowCreate, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Creates a workflow in the caller's org.
|
|
- POST /v1/flow/workflows
|
|
- Creates a workflow in the caller's org. The org's project id is pinned server-side from the validated principal — there is no field by which a caller could place a workflow in another org.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter flowCreate: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<JSONValue>
|
|
*/
|
|
open class func postFlowWorkflowsWithRequestBuilder(flowCreate: FlowCreate, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<JSONValue> {
|
|
let localVariablePath = "/v1/flow/workflows"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: flowCreate, 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<JSONValue>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|