mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
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.
324 lines
22 KiB
Swift
324 lines
22 KiB
Swift
//
|
|
// LabelAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class LabelAPI {
|
|
|
|
/**
|
|
Dispose of this tenant's expired assertions, whole records only
|
|
|
|
- parameter riskDisposeIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RiskDisposeOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func riskDisposeLabels(riskDisposeIn: RiskDisposeIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RiskDisposeOut {
|
|
return try await riskDisposeLabelsWithRequestBuilder(riskDisposeIn: riskDisposeIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Dispose of this tenant's expired assertions, whole records only
|
|
- POST /v1/label/dispose
|
|
- Applies this tenant's retention, and only this tenant's. It is bounded three ways, each a compliance property rather than a convenience. It refuses a boundary younger than the platform floor, because a label can be the input to an adverse action and five years is what the retention ledger holds such a record for. It never touches a record under litigation hold. And it disposes of whole records rather than redacting fields. It removes the derived columnar copy BEFORE the record, and refuses the whole disposal if the warehouse cannot be reached. The other order would leave rows in the warehouse that nothing can identify any more, which is a disposal that did not happen and says it did.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter riskDisposeIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<RiskDisposeOut>
|
|
*/
|
|
open class func riskDisposeLabelsWithRequestBuilder(riskDisposeIn: RiskDisposeIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RiskDisposeOut> {
|
|
let localVariablePath = "/v1/label/dispose"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: riskDisposeIn, 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<RiskDisposeOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Place or release a litigation hold on named records
|
|
|
|
- parameter riskHoldIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RiskHoldOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func riskHoldLabels(riskHoldIn: RiskHoldIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RiskHoldOut {
|
|
return try await riskHoldLabelsWithRequestBuilder(riskHoldIn: riskHoldIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Place or release a litigation hold on named records
|
|
- POST /v1/label/hold
|
|
- Places or releases a litigation hold on named records. A hold is a fact about the RECORD, not about the world: it says retention may not dispose of this row, and it asserts nothing about what happened. So it is not a field on an assertion and it is not folded into the content digest — carried there it was silently a no-op on any record that already existed, since re-filing the same assertion with a hold flag produced the same digest, the insert was ignored, and the caller was answered `duplicate` while the hold it asked for was never placed. This op is the one way a hold moves, in either direction, and the move is written to the audit log. Every named id is this tenant's or is nothing. The statement runs against the tenant's own file, which holds no other tenant's rows and has no column that could name one.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter riskHoldIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<RiskHoldOut>
|
|
*/
|
|
open class func riskHoldLabelsWithRequestBuilder(riskHoldIn: RiskHoldIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RiskHoldOut> {
|
|
let localVariablePath = "/v1/label/hold"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: riskHoldIn, 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<RiskHoldOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Assert ground truth about events
|
|
|
|
- parameter riskLabelIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RiskLabelOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func riskLabel(riskLabelIn: RiskLabelIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RiskLabelOut {
|
|
return try await riskLabelWithRequestBuilder(riskLabelIn: riskLabelIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Assert ground truth about events
|
|
- POST /v1/label
|
|
- Records a batch of ground truth against the entities it judges. Each assertion carries TWO times — when the judged event happened, and when the assertion became knowable — and both are required. The second is what keeps a chargeback that landed in June out of a model that had to decide in February. It is idempotent on the CONTENT of an assertion, so a webhook that redelivers is safe. It never overwrites: a source that corrects itself later files a NEW assertion, which wins from the moment it became knowable and leaves every earlier observation instant seeing exactly what it saw. The asserter is stamped from the validated credential and is not a body field.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter riskLabelIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<RiskLabelOut>
|
|
*/
|
|
open class func riskLabelWithRequestBuilder(riskLabelIn: RiskLabelIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RiskLabelOut> {
|
|
let localVariablePath = "/v1/label"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: riskLabelIn, 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<RiskLabelOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
How much of the window has matured, and how much of that is judged
|
|
|
|
- parameter from: (query) From and To bound the EVENT window, half-open, RFC 3339. Unstated, the window is the 90 days ENDING where maturity begins — `to` is the horizon ago, not now. A default window running to now under a default horizon could not contain one matured event, so every count below it would be zero however much ground truth the tenant held. (optional)
|
|
- parameter to: (query) (optional)
|
|
- parameter horizon: (query) Horizon is the maturity horizon in days the coverage is measured under. Unstated takes 120. It also moves the default window, which ends where maturity begins. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RiskLabelCoverage
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func riskLabelCoverage(from: String? = nil, to: String? = nil, horizon: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RiskLabelCoverage {
|
|
return try await riskLabelCoverageWithRequestBuilder(from: from, to: to, horizon: horizon, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
How much of the window has matured, and how much of that is judged
|
|
- GET /v1/label/coverage
|
|
- Reports how much of a window has matured and how much of that is judged, per source. It is the gate on training. A supervised fit over a window whose judged count is near zero produces a number, and the number is meaningless; this op is what lets that be stated before the fit rather than discovered after it. It reads the RECORD plane and folds every assertion at that event's OWN as-of, so the counts obey exactly the leakage rule a materialisation would. It counts only what was ASSERTED: what share of the whole event STREAM carries a label is a question about the feature plane's denominator and is not answerable here.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter from: (query) From and To bound the EVENT window, half-open, RFC 3339. Unstated, the window is the 90 days ENDING where maturity begins — `to` is the horizon ago, not now. A default window running to now under a default horizon could not contain one matured event, so every count below it would be zero however much ground truth the tenant held. (optional)
|
|
- parameter to: (query) (optional)
|
|
- parameter horizon: (query) Horizon is the maturity horizon in days the coverage is measured under. Unstated takes 120. It also moves the default window, which ends where maturity begins. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<RiskLabelCoverage>
|
|
*/
|
|
open class func riskLabelCoverageWithRequestBuilder(from: String? = nil, to: String? = nil, horizon: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RiskLabelCoverage> {
|
|
let localVariablePath = "/v1/label/coverage"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"from": (wrappedValue: from?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"to": (wrappedValue: to?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"horizon": (wrappedValue: horizon?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<RiskLabelCoverage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
The closed vocabularies and the precedence rule that resolves a conflict
|
|
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RiskLabelVocabulary
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func riskLabelVocabulary(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RiskLabelVocabulary {
|
|
return try await riskLabelVocabularyWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
The closed vocabularies and the precedence rule that resolves a conflict
|
|
- GET /v1/label/vocabulary
|
|
- Publishes the closed vocabularies and the precedence rule that resolves a conflict between two sources. A precedence rule nobody can read is a rule nobody can audit or dispute, and the whole defensibility of a contested label rests on being able to say why one assertion beat another. The order returned here is derived from the same declaration the resolver reads — it is not a description of it.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<RiskLabelVocabulary>
|
|
*/
|
|
open class func riskLabelVocabularyWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RiskLabelVocabulary> {
|
|
let localVariablePath = "/v1/label/vocabulary"
|
|
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<RiskLabelVocabulary>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Read the assertions this tenant has recorded
|
|
|
|
- parameter kind: (query) Kind and Subject narrow to one entity. (optional)
|
|
- parameter subject: (query) (optional)
|
|
- parameter source: (query) Source narrows to one asserter — the read that answers \"what has commerce told us\", separately from \"what has an analyst told us\". (optional)
|
|
- parameter from: (query) From and To bound the EVENT time, half-open, RFC 3339. (optional)
|
|
- parameter to: (query) (optional)
|
|
- parameter limit: (query) Limit caps the page. Out of range takes the plane's own bound. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RiskLabelsOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func riskLabels(kind: String? = nil, subject: String? = nil, source: String? = nil, from: String? = nil, to: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RiskLabelsOut {
|
|
return try await riskLabelsWithRequestBuilder(kind: kind, subject: subject, source: source, from: from, to: to, limit: limit, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Read the assertions this tenant has recorded
|
|
- GET /v1/label
|
|
- Reads the assertions this tenant has recorded, newest event first. It reads the RECORD — the tenant's own store — and not the columnar copy, so what it returns is what would be produced in an audit. Narrow it by entity, by asserter, or by event window.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter kind: (query) Kind and Subject narrow to one entity. (optional)
|
|
- parameter subject: (query) (optional)
|
|
- parameter source: (query) Source narrows to one asserter — the read that answers \"what has commerce told us\", separately from \"what has an analyst told us\". (optional)
|
|
- parameter from: (query) From and To bound the EVENT time, half-open, RFC 3339. (optional)
|
|
- parameter to: (query) (optional)
|
|
- parameter limit: (query) Limit caps the page. Out of range takes the plane's own bound. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<RiskLabelsOut>
|
|
*/
|
|
open class func riskLabelsWithRequestBuilder(kind: String? = nil, subject: String? = nil, source: String? = nil, from: String? = nil, to: String? = nil, limit: Int64? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RiskLabelsOut> {
|
|
let localVariablePath = "/v1/label"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"kind": (wrappedValue: kind?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"subject": (wrappedValue: subject?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"source": (wrappedValue: source?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"from": (wrappedValue: from?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"to": (wrappedValue: to?.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<RiskLabelsOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Resolve the label in force for named events, as of each event's own horizon
|
|
|
|
- parameter riskResolveIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RiskResolveOut
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func riskResolveLabels(riskResolveIn: RiskResolveIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> RiskResolveOut {
|
|
return try await riskResolveLabelsWithRequestBuilder(riskResolveIn: riskResolveIn, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Resolve the label in force for named events, as of each event's own horizon
|
|
- POST /v1/label/resolve
|
|
- Answers, for each named event, which assertion was in force AS OF that event's own horizon — and what disagreed with it. This is the join surface: the dataset materialiser calls it to attach ground truth to training rows, and the evaluator calls it to score a past decision against what was knowable when the decision had to be made. One mechanism for both, so a model can never be trained under one leakage rule and scored under another. Three answers are distinct and all three are honest: a resolved label, an event that has not matured, and a matured event nobody has judged. The last is never reported as unproductive.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter riskResolveIn: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<RiskResolveOut>
|
|
*/
|
|
open class func riskResolveLabelsWithRequestBuilder(riskResolveIn: RiskResolveIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<RiskResolveOut> {
|
|
let localVariablePath = "/v1/label/resolve"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: riskResolveIn, 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<RiskResolveOut>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|