mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
71 lines
3.1 KiB
Swift
71 lines
3.1 KiB
Swift
//
|
|
// PromptDetail.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct PromptDetail: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** CreatedAt is when version 1 was written, RFC 3339 UTC. Appending a version does not move it. */
|
|
public var createdAt: String?
|
|
/** Labels is the current version's free-form taxonomy. `[]` when none, never null. */
|
|
public var labels: [String]?
|
|
/** UpdatedAt is when the current version was appended, RFC 3339 UTC. Equal to createdAt for a prompt that has only ever had one version. */
|
|
public var lastUpdatedAt: String?
|
|
/** Name is the prompt's org-unique handle and the URL segment it is addressed by. */
|
|
public var name: String?
|
|
/** Prompt is the CURRENT version's template body — the only content this service returns. Earlier versions are listed in versionHistory by number and date, and their bodies are not served in bulk. */
|
|
public var prompt: String?
|
|
/** Tags is the second free-form taxonomy, same rules as Labels. */
|
|
public var tags: [String]?
|
|
/** Type labels the current version's kind; \"text\" unless the creator said otherwise. */
|
|
public var type: String?
|
|
/** Version is the current version number, starting at 1 and incremented by one on every create against an existing name. */
|
|
public var version: Int64?
|
|
/** Versions is the history METADATA, newest first, capped at the last 100 — no bodies, so a long history cannot inflate this response. It always includes the current version as its first entry. */
|
|
public var versionHistory: [VersionView]?
|
|
|
|
public init(createdAt: String? = nil, labels: [String]? = nil, lastUpdatedAt: String? = nil, name: String? = nil, prompt: String? = nil, tags: [String]? = nil, type: String? = nil, version: Int64? = nil, versionHistory: [VersionView]? = nil) {
|
|
self.createdAt = createdAt
|
|
self.labels = labels
|
|
self.lastUpdatedAt = lastUpdatedAt
|
|
self.name = name
|
|
self.prompt = prompt
|
|
self.tags = tags
|
|
self.type = type
|
|
self.version = version
|
|
self.versionHistory = versionHistory
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case createdAt
|
|
case labels
|
|
case lastUpdatedAt
|
|
case name
|
|
case prompt
|
|
case tags
|
|
case type
|
|
case version
|
|
case versionHistory
|
|
}
|
|
|
|
// 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(labels, forKey: .labels)
|
|
try container.encodeIfPresent(lastUpdatedAt, forKey: .lastUpdatedAt)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(prompt, forKey: .prompt)
|
|
try container.encodeIfPresent(tags, forKey: .tags)
|
|
try container.encodeIfPresent(type, forKey: .type)
|
|
try container.encodeIfPresent(version, forKey: .version)
|
|
try container.encodeIfPresent(versionHistory, forKey: .versionHistory)
|
|
}
|
|
}
|
|
|