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.
51 lines
1.9 KiB
Swift
51 lines
1.9 KiB
Swift
//
|
|
// ApiKey.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct ApiKey: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** CreatedAt is when the key last changed, as IAM records it. */
|
|
public var createdAt: String?
|
|
/** Key is the FULL value, and is present for a publishable key only: it is public by construction and useless to its holder if it cannot be read back. */
|
|
public var key: String?
|
|
/** Limit is what this key may reach, as `kind:name` entries — `model:zen5`, `project:acme`, `product:commerce`. Absent means the key reaches whatever its holder does, which is what every key minted before limits existed does and must keep doing. */
|
|
public var limit: [String]?
|
|
/** Prefix is the recognizable, non-secret head of the key — enough to tell two keys apart, never enough to use one. */
|
|
public var _prefix: String?
|
|
/** Type is the key class: secret (sk-) or publishable (pk-). */
|
|
public var type: String?
|
|
|
|
public init(createdAt: String? = nil, key: String? = nil, limit: [String]? = nil, _prefix: String? = nil, type: String? = nil) {
|
|
self.createdAt = createdAt
|
|
self.key = key
|
|
self.limit = limit
|
|
self._prefix = _prefix
|
|
self.type = type
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case createdAt
|
|
case key
|
|
case limit
|
|
case _prefix = "prefix"
|
|
case type
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(createdAt, forKey: .createdAt)
|
|
try container.encodeIfPresent(key, forKey: .key)
|
|
try container.encodeIfPresent(limit, forKey: .limit)
|
|
try container.encodeIfPresent(_prefix, forKey: ._prefix)
|
|
try container.encodeIfPresent(type, forKey: .type)
|
|
}
|
|
}
|
|
|