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.
87 lines
3.4 KiB
Swift
87 lines
3.4 KiB
Swift
//
|
|
// CapturedError.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct CapturedError: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** DistinctID is the person/visitor the error is attributed to. Omitted when the row carries none. */
|
|
public var distinctId: String?
|
|
/** Event is the event name the error was stored under, e.g. $error. */
|
|
public var event: String?
|
|
public var exception: JSONValue?
|
|
/** ID is the row's stable event id — the client's own idempotency id when it sent one, else the server-minted one. */
|
|
public var id: String?
|
|
/** Library is the client SDK that reported the error. Omitted when absent. */
|
|
public var library: String?
|
|
/** LibraryVer is that SDK's version. Omitted when absent. */
|
|
public var libraryVersion: String?
|
|
/** Path is the URL's path component. Omitted when absent. */
|
|
public var path: String?
|
|
/** Product is the surface that emitted the error. Omitted when absent. */
|
|
public var product: String?
|
|
public var properties: JSONValue?
|
|
/** SessionID groups the events of one visit. Omitted when the client sent none. */
|
|
public var sessionId: String?
|
|
/** Timestamp is when the error was captured, RFC3339 UTC. */
|
|
public var timestamp: String?
|
|
/** URL is the full page address the error fired on. Omitted when absent. */
|
|
public var url: String?
|
|
|
|
public init(distinctId: String? = nil, event: String? = nil, exception: JSONValue? = nil, id: String? = nil, library: String? = nil, libraryVersion: String? = nil, path: String? = nil, product: String? = nil, properties: JSONValue? = nil, sessionId: String? = nil, timestamp: String? = nil, url: String? = nil) {
|
|
self.distinctId = distinctId
|
|
self.event = event
|
|
self.exception = exception
|
|
self.id = id
|
|
self.library = library
|
|
self.libraryVersion = libraryVersion
|
|
self.path = path
|
|
self.product = product
|
|
self.properties = properties
|
|
self.sessionId = sessionId
|
|
self.timestamp = timestamp
|
|
self.url = url
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case distinctId
|
|
case event
|
|
case exception
|
|
case id
|
|
case library
|
|
case libraryVersion
|
|
case path
|
|
case product
|
|
case properties
|
|
case sessionId
|
|
case timestamp
|
|
case url
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(distinctId, forKey: .distinctId)
|
|
try container.encodeIfPresent(event, forKey: .event)
|
|
try container.encodeIfPresent(exception, forKey: .exception)
|
|
try container.encodeIfPresent(id, forKey: .id)
|
|
try container.encodeIfPresent(library, forKey: .library)
|
|
try container.encodeIfPresent(libraryVersion, forKey: .libraryVersion)
|
|
try container.encodeIfPresent(path, forKey: .path)
|
|
try container.encodeIfPresent(product, forKey: .product)
|
|
try container.encodeIfPresent(properties, forKey: .properties)
|
|
try container.encodeIfPresent(sessionId, forKey: .sessionId)
|
|
try container.encodeIfPresent(timestamp, forKey: .timestamp)
|
|
try container.encodeIfPresent(url, forKey: .url)
|
|
}
|
|
}
|
|
|
|
|
|
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
|
|
extension CapturedError: Identifiable {}
|