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
2.9 KiB
Swift
71 lines
2.9 KiB
Swift
//
|
||
// Config.swift
|
||
//
|
||
// Generated by openapi-generator
|
||
// https://openapi-generator.tech
|
||
//
|
||
|
||
import Foundation
|
||
|
||
public struct Config: Sendable, Codable, ParameterConvertible, Hashable {
|
||
|
||
/** MaxAge caps message age, e.g. \"24h\" or \"7d\"; \"0\" (default) is unlimited. */
|
||
public var maxAge: String?
|
||
/** MaxBytes caps the stream's total stored bytes; -1 (default) is unlimited. */
|
||
public var maxBytes: Int64?
|
||
/** MaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit. */
|
||
public var maxMsgSize: Int?
|
||
/** MaxMsgs caps the number of stored messages; -1 (default) is unlimited. */
|
||
public var maxMsgs: Int64?
|
||
/** Name is the stream name, unique within the org (alphanumeric, hyphens, underscores). */
|
||
public var name: String?
|
||
/** Replicas is the number of stream replicas (1–5); this plane runs 1. */
|
||
public var numReplicas: Int64?
|
||
/** Retention is the retention policy: limits (default), interest, or workqueue. */
|
||
public var retention: String?
|
||
/** Storage is the storage backend: file (default) or memory. */
|
||
public var storage: String?
|
||
/** Subjects are the org-relative subjects bound to this stream (wildcards supported). Default: the stream name. */
|
||
public var subjects: [String]?
|
||
|
||
public init(maxAge: String? = nil, maxBytes: Int64? = nil, maxMsgSize: Int? = nil, maxMsgs: Int64? = nil, name: String? = nil, numReplicas: Int64? = nil, retention: String? = nil, storage: String? = nil, subjects: [String]? = nil) {
|
||
self.maxAge = maxAge
|
||
self.maxBytes = maxBytes
|
||
self.maxMsgSize = maxMsgSize
|
||
self.maxMsgs = maxMsgs
|
||
self.name = name
|
||
self.numReplicas = numReplicas
|
||
self.retention = retention
|
||
self.storage = storage
|
||
self.subjects = subjects
|
||
}
|
||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable {
|
||
case maxAge = "max_age"
|
||
case maxBytes = "max_bytes"
|
||
case maxMsgSize = "max_msg_size"
|
||
case maxMsgs = "max_msgs"
|
||
case name
|
||
case numReplicas = "num_replicas"
|
||
case retention
|
||
case storage
|
||
case subjects
|
||
}
|
||
|
||
// Encodable protocol methods
|
||
|
||
public func encode(to encoder: Encoder) throws {
|
||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||
try container.encodeIfPresent(maxAge, forKey: .maxAge)
|
||
try container.encodeIfPresent(maxBytes, forKey: .maxBytes)
|
||
try container.encodeIfPresent(maxMsgSize, forKey: .maxMsgSize)
|
||
try container.encodeIfPresent(maxMsgs, forKey: .maxMsgs)
|
||
try container.encodeIfPresent(name, forKey: .name)
|
||
try container.encodeIfPresent(numReplicas, forKey: .numReplicas)
|
||
try container.encodeIfPresent(retention, forKey: .retention)
|
||
try container.encodeIfPresent(storage, forKey: .storage)
|
||
try container.encodeIfPresent(subjects, forKey: .subjects)
|
||
}
|
||
}
|
||
|