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

141 lines
8.5 KiB
Swift

//
// EntitlementAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class EntitlementAPI {
/**
Projection reports which console apps the CALLER's org may open, and the plan slug that decides it.
- parameter apiConfiguration: The configuration for the http request.
- returns: ProjectionView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getEntitlement(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> ProjectionView {
return try await getEntitlementWithRequestBuilder(apiConfiguration: apiConfiguration).execute().body
}
/**
Projection reports which console apps the CALLER's org may open, and the plan slug that decides it.
- GET /v1/entitlement
- Projection reports which console apps the CALLER's org may open, and the plan slug that decides it. It is the READ side of the unified paywall: the org's plan tier resolved from commerce, which is a different authority from the enablement store behind GET /v1/entitlement/orgs/{org} (that one is the org's own on/off intent). It fails SAFE-TO-LOCKED, never 500: an unvalidated principal is a 403, but a commerce outage reports every app locked at 200 rather than breaking the shell. The ENFORCEMENT path still fails open, so functionality survives the same outage even while the UI conservatively shows locked.
- Bearer Token:
- type: http
- name: bearer
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<ProjectionView>
*/
open class func getEntitlementWithRequestBuilder(apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<ProjectionView> {
let localVariablePath = "/v1/entitlement"
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<ProjectionView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Get lists the products an org has ENABLED — its own intent, which the console's paid-product sidebar reads to decide what to show.
- parameter org: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: EntitlementsView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getEntitlementOrgsByOrg(org: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> EntitlementsView {
return try await getEntitlementOrgsByOrgWithRequestBuilder(org: org, apiConfiguration: apiConfiguration).execute().body
}
/**
Get lists the products an org has ENABLED — its own intent, which the console's paid-product sidebar reads to decide what to show.
- GET /v1/entitlement/orgs/{org}
- Get lists the products an org has ENABLED — its own intent, which the console's paid-product sidebar reads to decide what to show. It is distinct from what the org's plan ENTITLES it to (that is GET /v1/entitlement, resolved from commerce). A caller may only read its OWN org's row; a platform super admin may read any.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<EntitlementsView>
*/
open class func getEntitlementOrgsByOrgWithRequestBuilder(org: String, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<EntitlementsView> {
var localVariablePath = "/v1/entitlement/orgs/{org}"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, 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<EntitlementsView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
/**
Post turns products on or off for an org and returns the enabled set afterwards.
- parameter org: (path)
- parameter mutateReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: EntitlementsView
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func postEntitlementOrgsByOrg(org: String, mutateReq: MutateReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> EntitlementsView {
return try await postEntitlementOrgsByOrgWithRequestBuilder(org: org, mutateReq: mutateReq, apiConfiguration: apiConfiguration).execute().body
}
/**
Post turns products on or off for an org and returns the enabled set afterwards.
- POST /v1/entitlement/orgs/{org}
- Post turns products on or off for an org and returns the enabled set afterwards. A product may only be ENABLED if the org's plan already ENTITLES it, so enabling never spends new money — a product the plan does not grant answers 402 and the console routes that to an upgrade prompt. DISABLING is never gated. A platform super admin bypasses the plan check (operator comp/grant) and may target any org; everyone else may only change their own. Commerce unreachable is a 503, never an implicit yes.
- Bearer Token:
- type: http
- name: bearer
- parameter org: (path)
- parameter mutateReq: (body)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<EntitlementsView>
*/
open class func postEntitlementOrgsByOrgWithRequestBuilder(org: String, mutateReq: MutateReq, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<EntitlementsView> {
var localVariablePath = "/v1/entitlement/orgs/{org}"
let orgPreEscape = "\(APIHelper.mapValueToPathItem(org))"
let orgPostEscape = orgPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? ""
localVariablePath = localVariablePath.replacingOccurrences(of: "{org}", with: orgPostEscape, options: .literal, range: nil)
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters = JSONEncodingHelper.encodingParameters(forEncodableObject: mutateReq, 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<EntitlementsView>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "POST", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
}