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.
102 lines
6.6 KiB
Swift
102 lines
6.6 KiB
Swift
//
|
|
// SettingsAPI.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
open class SettingsAPI {
|
|
|
|
/**
|
|
Reads the caller org's configuration for one product, with every secret field MASKED — only the names of the set secrets come back, never their values, which live in KMS.
|
|
|
|
- parameter product: (path) Product is the catalog slug, from the path. Must match ^[a-z0-9][a-z0-9._-]{0,62}$.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: SettingsView
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func getSettingsByProduct(product: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> SettingsView {
|
|
return try await getSettingsByProductWithRequestBuilder(product: product, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Reads the caller org's configuration for one product, with every secret field MASKED — only the names of the set secrets come back, never their values, which live in KMS.
|
|
- GET /v1/settings/{product}
|
|
- Reads the caller org's configuration for one product, with every secret field MASKED — only the names of the set secrets come back, never their values, which live in KMS. A product the org has never configured is not a 404: it answers 200 with an empty config object, so the console's Settings tab always renders and merges its own display defaults on top.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter product: (path) Product is the catalog slug, from the path. Must match ^[a-z0-9][a-z0-9._-]{0,62}$.
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<SettingsView>
|
|
*/
|
|
open class func getSettingsByProductWithRequestBuilder(product: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<SettingsView> {
|
|
var localVariablePath = "/v1/settings/{product}"
|
|
let productPreEscape = "\(APIHelper.mapValueToPathItem(product))"
|
|
let productPostEscape = productPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{product}", with: productPostEscape, 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<SettingsView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
|
|
/**
|
|
Writes the caller org's configuration for one product and answers the stored result, secrets masked.
|
|
|
|
- parameter product: (path) Product is the catalog slug, from the PATH. zip binds the path last, so the URL names the product being written whatever a body field claims.
|
|
- parameter settingsReq: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: SettingsView
|
|
*/
|
|
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
|
|
open class func putSettingsByProduct(product: String, settingsReq: SettingsReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> SettingsView {
|
|
return try await putSettingsByProductWithRequestBuilder(product: product, settingsReq: settingsReq, apiConfiguration: apiConfiguration).execute().body
|
|
}
|
|
|
|
/**
|
|
Writes the caller org's configuration for one product and answers the stored result, secrets masked.
|
|
- PUT /v1/settings/{product}
|
|
- Writes the caller org's configuration for one product and answers the stored result, secrets masked. Secret VALUES are sealed into KMS under orgs/{org}/settings/{product}/{key} and never touch this deployment's database; with no KMS configured a write that carries any secret is refused whole (503) rather than dropping it or persisting it in the clear. A secret the body omits keeps its stored value, so a partial write never silently clears one.
|
|
- Bearer Token:
|
|
- type: http
|
|
- name: bearer
|
|
- parameter product: (path) Product is the catalog slug, from the PATH. zip binds the path last, so the URL names the product being written whatever a body field claims.
|
|
- parameter settingsReq: (body)
|
|
- parameter apiConfiguration: The configuration for the http request.
|
|
- returns: RequestBuilder<SettingsView>
|
|
*/
|
|
open class func putSettingsByProductWithRequestBuilder(product: String, settingsReq: SettingsReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<SettingsView> {
|
|
var localVariablePath = "/v1/settings/{product}"
|
|
let productPreEscape = "\(APIHelper.mapValueToPathItem(product))"
|
|
let productPostEscape = productPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
|
|
localVariablePath = localVariablePath.replacingOccurrences(of: "{product}", with: productPostEscape, options: .literal, range: nil)
|
|
let localVariableURLString = apiConfiguration.basePath + localVariablePath
|
|
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: settingsReq, 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<SettingsView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
|
|
|
|
return localVariableRequestBuilder.init(method: "PUT", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
|
|
}
|
|
}
|