Files
zeekay b0db427c79 regenerate from cloud 939b09d4
The projection was 113 commits behind the document it claims to describe, and
`generate.py --all --check` reported every one of the thirteen clients DRIFTED —
the same +19 models in each, because they all fell behind the same emission.

Regenerated in place from hanzo-inc/cloud openapi.yaml at 939b09d4
(sha256 087024f6…), which is the only description of this API that cannot name a
route the binary does not serve. `--check` is clean across all thirteen after.

.spec-lock moved with the code. The generator READS that file and never writes
it — hanzoai/ci`s lane does — so a hand run leaves every lock naming the previous
document. A lock that disagrees with the tree beside it is worse than no lock:
the next `--check` without `--spec` fetches what production serves, compares it
to a digest that was already wrong, and reports drift that is really staleness.
2026-08-24 23:32:45 -07:00

273 lines
17 KiB
Swift

//
// S3API.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class S3API {
/**
Removes an EMPTY bucket and answers 204.
- parameter bucket: (path) Bucket is the bucket's friendly name, 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 deleteS3BucketsByBucket(bucket: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) {
return try await deleteS3BucketsByBucketWithRequestBuilder(bucket: bucket, apiConfiguration: apiConfiguration).execute().body
}
/**
Removes an EMPTY bucket and answers 204.
- DELETE /v1/s3/buckets/{bucket}
- Removes an EMPTY bucket and answers 204. A non-empty bucket is 409 rather than a cascade: deleting a tenant's objects behind a single bucket call is not a thing this surface will do silently. A bucket the caller's org does not own is the same 404 an unknown name gives. Billed per call: the balance is checked BEFORE anything is touched, so an unfunded org is refused with nothing deleted, and the debit lands only once the bucket is gone.
- Bearer Token:
- type: http
- name: bearer
- parameter bucket: (path) Bucket is the bucket's friendly name, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Void>
*/
open class func deleteS3BucketsByBucketWithRequestBuilder(bucket: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Void> {
var localVariablePath = "/v1/s3/buckets/{bucket}"
let bucketPreEscape = "\(APIHelper.mapValueToPathItem(bucket))"
let bucketPostEscape = bucketPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{bucket}", with: bucketPostEscape, 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)
}
/**
Lists the caller org's own buckets.
- parameter apiConfiguration: The configuration for the http request.
- returns: BucketList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getS3Buckets(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> BucketList {
return try await getS3BucketsWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Lists the caller org's own buckets.
- GET /v1/s3/buckets
- Lists the caller org's own buckets. Only the caller's: every bucket is physically named under a per-org prefix and the listing strips that prefix, so a tenant sees friendly names and another tenant's buckets are not in the answer at all. Another org's bucket is not refused but INVISIBLE, so this cannot be used to learn that a name is taken elsewhere. Billed per call: the balance is checked BEFORE anything is touched, so an unfunded org is refused with nothing done, and the debit lands only once the work has succeeded.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<BucketList>
*/
open class func getS3BucketsWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<BucketList> {
let localVariablePath = "/v1/s3/buckets"
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<BucketList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Lists one folder level of a bucket.
- parameter bucket: (path) Bucket is the bucket to list, from the path.
- parameter _prefix: (query) (optional)
- parameter recursive: (query) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: ObjectList
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getS3BucketsByBucketObjects(bucket: String, _prefix: String? = nil, recursive: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> ObjectList {
return try await getS3BucketsByBucketObjectsWithRequestBuilder(bucket: bucket, _prefix: _prefix, recursive: recursive, apiConfiguration: apiConfiguration).execute().body
}
/**
Lists one folder level of a bucket.
- GET /v1/s3/buckets/{bucket}/objects
- Lists one folder level of a bucket. Folder-style by default: sub-prefixes come back as directory entries, which is the file-manager view. `?recursive=true` lists every key flat under the prefix instead. Keys are RELATIVE to `?prefix=`, and the listing is bounded so a huge bucket cannot exhaust memory — Total is what came back, not what the bucket holds. Billed per call: the balance is checked BEFORE anything is touched, so an unfunded org is refused with nothing read, and the debit lands only once the listing has succeeded.
- Bearer Token:
- type: http
- name: bearer
- parameter bucket: (path) Bucket is the bucket to list, from the path.
- parameter _prefix: (query) (optional)
- parameter recursive: (query) (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<ObjectList>
*/
open class func getS3BucketsByBucketObjectsWithRequestBuilder(bucket: String, _prefix: String? = nil, recursive: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<ObjectList> {
var localVariablePath = "/v1/s3/buckets/{bucket}/objects"
let bucketPreEscape = "\(APIHelper.mapValueToPathItem(bucket))"
let bucketPostEscape = bucketPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{bucket}", with: bucketPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"prefix": (wrappedValue: _prefix?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"recursive": (wrappedValue: recursive?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<ObjectList>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Health reports whether this deployment can serve object storage.
- parameter apiConfiguration: The configuration for the http request.
- returns: S3Health
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getS3Health(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> S3Health {
return try await getS3HealthWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Health reports whether this deployment can serve object storage.
- GET /v1/s3/health
- Health reports whether this deployment can serve object storage. It is a REAL probe rather than a constant: 200 when admin credentials are present, so the store is reachable in principle, and 503 with the reason when they are not. It is deliberately NOT gated — liveness has to be probe-able without a token — so it is the one operation here that names no bucket and bills nothing.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<S3Health>
*/
open class func getS3HealthWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<S3Health> {
let localVariablePath = "/v1/s3/health"
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<S3Health>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Makes a new bucket for the caller's org and answers 201 with it.
- parameter bucketIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: BucketItem
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postS3Buckets(bucketIn: BucketIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> BucketItem {
return try await postS3BucketsWithRequestBuilder(bucketIn: bucketIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Makes a new bucket for the caller's org and answers 201 with it.
- POST /v1/s3/buckets
- Makes a new bucket for the caller's org and answers 201 with it. The physical name is derived from the caller's validated org, so a tenant can only ever create inside its own namespace and no request field can redirect that. A name already taken in the org is 409. Billed per call: the balance is checked BEFORE anything is touched, so an unfunded org is refused with nothing created, and the debit lands only once the bucket exists.
- Bearer Token:
- type: http
- name: bearer
- parameter bucketIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<BucketItem>
*/
open class func postS3BucketsWithRequestBuilder(bucketIn: BucketIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<BucketItem> {
let localVariablePath = "/v1/s3/buckets"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: bucketIn, 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<BucketItem>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Mints a presigned PUT URL the caller uploads to DIRECTLY.
- parameter bucket: (path) Bucket is the bucket to upload into, from the path.
- parameter uploadIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: PresignResponse
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postS3BucketsByBucketObjects(bucket: String, uploadIn: UploadIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> PresignResponse {
return try await postS3BucketsByBucketObjectsWithRequestBuilder(bucket: bucket, uploadIn: uploadIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Mints a presigned PUT URL the caller uploads to DIRECTLY.
- POST /v1/s3/buckets/{bucket}/objects
- Mints a presigned PUT URL the caller uploads to DIRECTLY. The bytes never pass through this binary and the admin credential never leaves the server: the URL is signed against the PUBLIC host, scoped to exactly this bucket and key, and expires. A deployment with no public endpoint configured cannot mint one and answers 503 rather than a URL that will not work. Billed per call — for MINTING the URL, which is the work this operation does; the upload that follows it goes straight to the store and is not seen here. The balance is checked BEFORE anything is touched, so an unfunded org is refused with no URL issued.
- Bearer Token:
- type: http
- name: bearer
- parameter bucket: (path) Bucket is the bucket to upload into, from the path.
- parameter uploadIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<PresignResponse>
*/
open class func postS3BucketsByBucketObjectsWithRequestBuilder(bucket: String, uploadIn: UploadIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<PresignResponse> {
var localVariablePath = "/v1/s3/buckets/{bucket}/objects"
let bucketPreEscape = "\(APIHelper.mapValueToPathItem(bucket))"
let bucketPostEscape = bucketPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{bucket}", with: bucketPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: uploadIn, 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<PresignResponse>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
}