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.
46 lines
1.6 KiB
Swift
46 lines
1.6 KiB
Swift
//
|
|
// PostEventRequest.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public enum PostEventRequest: Sendable, Codable, ParameterConvertible, Hashable {
|
|
case typeCaptureBatch(CaptureBatch)
|
|
case typeCaptureEvent(CaptureEvent)
|
|
case typeInsightsBody(InsightsBody)
|
|
case typeArrayOfCaptureEvent([CaptureEvent])
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.singleValueContainer()
|
|
switch self {
|
|
case .typeCaptureBatch(let value):
|
|
try container.encode(value)
|
|
case .typeCaptureEvent(let value):
|
|
try container.encode(value)
|
|
case .typeInsightsBody(let value):
|
|
try container.encode(value)
|
|
case .typeArrayOfCaptureEvent(let value):
|
|
try container.encode(value)
|
|
}
|
|
}
|
|
|
|
public init(from decoder: Decoder) throws {
|
|
let container = try decoder.singleValueContainer()
|
|
if let value = try? container.decode(CaptureBatch.self) {
|
|
self = .typeCaptureBatch(value)
|
|
} else if let value = try? container.decode(CaptureEvent.self) {
|
|
self = .typeCaptureEvent(value)
|
|
} else if let value = try? container.decode(InsightsBody.self) {
|
|
self = .typeInsightsBody(value)
|
|
} else if let value = try? container.decode([CaptureEvent].self) {
|
|
self = .typeArrayOfCaptureEvent(value)
|
|
} else {
|
|
throw DecodingError.typeMismatch(Self.Type.self, .init(codingPath: decoder.codingPath, debugDescription: "Unable to decode instance of PostEventRequest"))
|
|
}
|
|
}
|
|
}
|
|
|