Files
zeekay 0c2f028a8c Generate the Swift client, which this copy did not carry
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.
2026-08-23 10:04:41 -07:00

236 lines
15 KiB
Swift

//
// TaxonomyAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class TaxonomyAPI {
/**
Removes one empty category.
- parameter id: (path) ID is the slug to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: Deleted
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func deleteTaxonomyCategoriesById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Deleted {
return try await deleteTaxonomyCategoriesByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Removes one empty category.
- DELETE /v1/taxonomy/categories/{id}
- Removes one empty category. A category that still has taxa filed under it is refused with 409 and a count: deleting the label off a group must never silently take the products wearing it, and the alternative — orphan rows naming a category that no longer exists — is a catalogue that cannot be rendered. Move or delete its taxa first. An id no category holds is a 404.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the slug to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Deleted>
*/
open class func deleteTaxonomyCategoriesByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Deleted> {
var localVariablePath = "/v1/taxonomy/categories/{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<Deleted>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Removes one product from the catalogue.
- parameter id: (path) ID is the slug to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: Deleted
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func deleteTaxonomyTaxaById(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Deleted {
return try await deleteTaxonomyTaxaByIdWithRequestBuilder(id: id, apiConfiguration: apiConfiguration).execute().body
}
/**
Removes one product from the catalogue.
- DELETE /v1/taxonomy/taxa/{id}
- Removes one product from the catalogue. An id no taxon holds is a 404. To take a product out of view without losing what was written about it, set `published` to false instead.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the slug to act on, from the path.
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Deleted>
*/
open class func deleteTaxonomyTaxaByIdWithRequestBuilder(id: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Deleted> {
var localVariablePath = "/v1/taxonomy/taxa/{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<Deleted>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "DELETE", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Read returns the product catalogue as this caller sees it: the PLATFORM catalogue — Hanzo's own products, the part that is true for everyone — plus the caller's own org's rows, every category in display order and each carrying the products filed under it in theirs.
- parameter brand: (query) Brand returns only what that brand&#39;s console shows — the categories it admits, and within them the taxa scoped to it. Empty returns everything. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: Taxonomy
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getTaxonomy(brand: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Taxonomy {
return try await getTaxonomyWithRequestBuilder(brand: brand, apiConfiguration: apiConfiguration).execute().body
}
/**
Read returns the product catalogue as this caller sees it: the PLATFORM catalogue — Hanzo's own products, the part that is true for everyone — plus the caller's own org's rows, every category in display order and each carrying the products filed under it in theirs.
- GET /v1/taxonomy
- Read returns the product catalogue as this caller sees it: the PLATFORM catalogue — Hanzo's own products, the part that is true for everyone — plus the caller's own org's rows, every category in display order and each carrying the products filed under it in theirs. Another customer's rows are never in it. It is readable signed out, and a signed-out visitor gets the platform catalogue alone, which is what the marketing landing renders from. Where the caller's org and the platform hold the same id, the caller's own row is the one served. That rule exists because ids are unique per ORG and not globally — two customers may each have a \"crm\", and refusing the second would tell one of them the other exists — so a collision with the platform is possible by construction and something has to win deterministically. Yours does: your own catalogue is the one you edited. `?brand=` narrows it the way a brand's own console does: only the categories that brand admits, and within them only the taxa scoped to it. An unpublished row is served only to whoever may edit it — a SuperAdmin for the platform's, an org admin for their own — so a product can be staged before anyone sees it without becoming invisible to the person staging it.
- Bearer Token:
- type: http
- name: bearer
- parameter brand: (query) Brand returns only what that brand&#39;s console shows — the categories it admits, and within them the taxa scoped to it. Empty returns everything. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Taxonomy>
*/
open class func getTaxonomyWithRequestBuilder(brand: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Taxonomy> {
let localVariablePath = "/v1/taxonomy"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"brand": (wrappedValue: brand?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<Taxonomy>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Creates or replaces one category and returns it as stored.
- parameter id: (path) ID is the category slug to write, from the path.
- parameter categoryIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: Category
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func putTaxonomyCategoriesById(id: String, categoryIn: CategoryIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Category {
return try await putTaxonomyCategoriesByIdWithRequestBuilder(id: id, categoryIn: categoryIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Creates or replaces one category and returns it as stored.
- PUT /v1/taxonomy/categories/{id}
- Creates or replaces one category and returns it as stored. The id in the URL is the one it is filed under whatever the body says, so a category can never be written under a name it was not addressed by — which also makes create and replace the same act, and is why there is no POST beside this. Platform SuperAdmin only: one catalogue serves every tenant, so an org admin who could rename a category would rename it for all of them.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the category slug to write, from the path.
- parameter categoryIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Category>
*/
open class func putTaxonomyCategoriesByIdWithRequestBuilder(id: String, categoryIn: CategoryIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Category> {
var localVariablePath = "/v1/taxonomy/categories/{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: categoryIn, 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<Category>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Creates or replaces one product and returns it as stored.
- parameter id: (path) ID is the taxon slug to write, from the path.
- parameter taxonIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: Taxon
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func putTaxonomyTaxaById(id: String, taxonIn: TaxonIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> Taxon {
return try await putTaxonomyTaxaByIdWithRequestBuilder(id: id, taxonIn: taxonIn, apiConfiguration: apiConfiguration).execute().body
}
/**
Creates or replaces one product and returns it as stored.
- PUT /v1/taxonomy/taxa/{id}
- Creates or replaces one product and returns it as stored. The id in the URL is the one it is filed under whatever the body says. The category must already exist — a taxon naming a category that does not is refused with 400 rather than stored where nothing can render it. A taxon opens exactly one way: `route` for a product the console renders itself, or `href` for one that genuinely lives at its own domain. Giving both, or neither, is refused. Platform SuperAdmin only.
- Bearer Token:
- type: http
- name: bearer
- parameter id: (path) ID is the taxon slug to write, from the path.
- parameter taxonIn: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<Taxon>
*/
open class func putTaxonomyTaxaByIdWithRequestBuilder(id: String, taxonIn: TaxonIn, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<Taxon> {
var localVariablePath = "/v1/taxonomy/taxa/{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: taxonIn, 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<Taxon>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
}