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.
80 lines
6.6 KiB
Swift
80 lines
6.6 KiB
Swift
//
|
|
// AuditAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class AuditAPI {
|
|
|
|
/**
|
|
List reads the caller's OWN org audit trail, newest first, with the total the filter matched so a console can page it.
|
|
|
|
- parameter sub: (query) Sub narrows the trail to one actor — the validated subject that made the request. Blank means every actor in the org. (optional)
|
|
- parameter action: (query) Action narrows it to one action name, e.g. \"machine.create\". (optional)
|
|
- parameter resource: (query) Resource narrows it to one resource TYPE, e.g. \"apikey\". (optional)
|
|
- parameter resourceId: (query) ResourceID narrows it to one resource instance. (optional)
|
|
- parameter result: (query) Result narrows it to one outcome: \"success\", \"deny\" or \"error\". (optional)
|
|
- parameter since: (query) Since is the inclusive lower time bound, RFC3339. An unparseable value is ignored rather than refused — one malformed filter must not hide the trail. (optional)
|
|
- parameter until: (query) Until is the upper time bound, RFC3339, with the same tolerance. (optional)
|
|
- parameter pageSize: (query) PageSize is rows per page, default 100. A value that is not a positive integer falls back to the default. (optional)
|
|
- parameter p: (query) Page is the 1-based page number, driving the offset. Anything below 2 reads the first page. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: TrailPage
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getAudit(sub: String? = nil, action: String? = nil, resource: String? = nil, resourceId: String? = nil, result: String? = nil, since: String? = nil, until: String? = nil, pageSize: String? = nil, p: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> TrailPage {
|
|
return try await getAuditWithRequestBuilder(sub: sub, action: action, resource: resource, resourceId: resourceId, result: result, since: since, until: until, pageSize: pageSize, p: p, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
List reads the caller's OWN org audit trail, newest first, with the total the filter matched so a console can page it.
|
|
- GET /v1/audit
|
|
- List reads the caller's OWN org audit trail, newest first, with the total the filter matched so a console can page it. Every filter is optional and applies WITHIN the caller's org — the org itself is the validated principal's and can never be widened by a request. Fails closed: an absent principal is a true \"not signed in\" (401), and a deployment with no local tamper-evident store answers an honest 501 rather than silently serving somebody else's trail.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter sub: (query) Sub narrows the trail to one actor — the validated subject that made the request. Blank means every actor in the org. (optional)
|
|
- parameter action: (query) Action narrows it to one action name, e.g. \"machine.create\". (optional)
|
|
- parameter resource: (query) Resource narrows it to one resource TYPE, e.g. \"apikey\". (optional)
|
|
- parameter resourceId: (query) ResourceID narrows it to one resource instance. (optional)
|
|
- parameter result: (query) Result narrows it to one outcome: \"success\", \"deny\" or \"error\". (optional)
|
|
- parameter since: (query) Since is the inclusive lower time bound, RFC3339. An unparseable value is ignored rather than refused — one malformed filter must not hide the trail. (optional)
|
|
- parameter until: (query) Until is the upper time bound, RFC3339, with the same tolerance. (optional)
|
|
- parameter pageSize: (query) PageSize is rows per page, default 100. A value that is not a positive integer falls back to the default. (optional)
|
|
- parameter p: (query) Page is the 1-based page number, driving the offset. Anything below 2 reads the first page. (optional)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<TrailPage>
|
|
*/
|
|
open class func getAuditWithRequestBuilder(sub: String? = nil, action: String? = nil, resource: String? = nil, resourceId: String? = nil, result: String? = nil, since: String? = nil, until: String? = nil, pageSize: String? = nil, p: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<TrailPage> {
|
|
let localVariablePath = "/v1/audit"
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters: [String: any Sendable]? = nil
|
|
|
|
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
|
|
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
|
|
"sub": (wrappedValue: sub?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"action": (wrappedValue: action?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"resource": (wrappedValue: resource?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"resourceId": (wrappedValue: resourceId?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"result": (wrappedValue: result?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"since": (wrappedValue: since?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"until": (wrappedValue: until?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"pageSize": (wrappedValue: pageSize?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
"p": (wrappedValue: p?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
|
|
])
|
|
|
|
let localVariableNillableHeaders: [String: (any Sendable)?] = [
|
|
:
|
|
]
|
|
|
|
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
|
|
|
|
let localVariableRequestBuilder: RequestBuilder<TrailPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|