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.
131 lines
7.5 KiB
Swift
131 lines
7.5 KiB
Swift
//
|
|
// Wire.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Wire: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Action is the verb that was performed. It is the event's name, not the HTTP method — a request-sourced record carries both, and the pair is what makes a row readable (\"grant.create\" at POST /v1/admin/grants). */
|
|
public var action: String?
|
|
/** Auth is the credential the actor presented: \"jwt\", \"api-key\", or \"none\". */
|
|
public var authMethod: String?
|
|
/** Email is the actor's validated address, absent when the credential carried none. It comes from the verified token, never from a client header. */
|
|
public var email: String?
|
|
/** Hash is this record's SHA-256 over its own canonical JSON with both hash fields cleared, folded with prevHash. Recomputing it from the row's other fields is what proves the row has not been edited. */
|
|
public var hash: String?
|
|
/** Home is present ONLY on a cross-org action: the org the actor came FROM, while Org is the org they acted IN. A console row carrying `home` is a platform-admin impersonation and should be rendered as one. */
|
|
public var home: String?
|
|
/** IsAdmin is the VALIDATED platform-SuperAdmin bit at decision time (membership of the reserved admin org), never the client's own claim to be one. */
|
|
public var isAdmin: Bool?
|
|
/** Method is the HTTP verb, on a record a request produced. Absent on an event emitted from inside the binary with no request behind it. */
|
|
public var method: String?
|
|
/** Org is the tenant the action was taken IN — the effective org, which for everyone but an impersonating SuperAdmin is also the actor's own. Empty on an unauthenticated request. */
|
|
public var org: String?
|
|
/** Path is the request's route. Any segment shaped like a credential is replaced before the record is written, so a key that rides in a path is not preserved here by the very control meant to watch it. */
|
|
public var path: String?
|
|
/** PrevHash is the hash of record seq-1, which is what links the rows into a chain: a deleted or reordered record breaks the recomputation at that point. The first record of a chain carries 64 zeros rather than an empty string, so \"start of chain\" and \"field missing\" cannot look alike. */
|
|
public var prevHash: String?
|
|
/** Reason is a short explanation for a deny or an error (\"SuperAdmin required\", \"insufficient_balance\"). It is never a secret and never a raw upstream error body; absent on a success. */
|
|
public var reason: String?
|
|
/** RequestID ties this row to the request-line log and any downstream trace — the X-Request-Id the pipeline minted for that request. */
|
|
public var requestId: String?
|
|
/** Resource is the KIND of thing acted upon (\"org\", \"role\", \"secret\", \"provider-config\", \"credit\"). Where a mutation has no finer semantics than its route, this is the route family and resourceId is empty — the action and the path already pin the object. */
|
|
public var resource: String?
|
|
/** ResourceID is the specific instance, absent when the kind alone identifies it. */
|
|
public var resourceId: String?
|
|
/** Result is how the action ended: \"success\", \"deny\" or \"error\". A deny is a decision this binary made and is as much evidence as a success. */
|
|
public var result: String?
|
|
/** Seq is the record's position in the chain, 0-based and gapless. The Recorder assigns it under its own lock, so it is a true total order: seq n+1 was written after seq n, and a missing number is a missing record. */
|
|
public var seq: Int?
|
|
/** SourceIP is the client address the edge resolved for the request, after the proxy chain — the address a responder would act on, not the socket peer. */
|
|
public var sourceIp: String?
|
|
/** Status is the HTTP status the caller received. It is the outcome as the client saw it, so a 200 carrying a domain refusal still reads 200 here. */
|
|
public var status: Int64?
|
|
/** Sub is the acting user (the IAM subject). Empty for a machine principal or an anonymous request, which is how a service action is told from a person's. */
|
|
public var sub: String?
|
|
/** Time is when the action happened, RFC3339Nano in UTC. The stored column has the same precision and sorts the same way, so a client can range and order on this string verbatim. */
|
|
public var time: String?
|
|
/** UserAgent is the client the request announced itself as. Client-supplied, so it is evidence about what claimed to act, not proof of it. */
|
|
public var userAgent: String?
|
|
|
|
public init(action: String? = nil, authMethod: String? = nil, email: String? = nil, hash: String? = nil, home: String? = nil, isAdmin: Bool? = nil, method: String? = nil, org: String? = nil, path: String? = nil, prevHash: String? = nil, reason: String? = nil, requestId: String? = nil, resource: String? = nil, resourceId: String? = nil, result: String? = nil, seq: Int? = nil, sourceIp: String? = nil, status: Int64? = nil, sub: String? = nil, time: String? = nil, userAgent: String? = nil) {
|
|
self.action = action
|
|
self.authMethod = authMethod
|
|
self.email = email
|
|
self.hash = hash
|
|
self.home = home
|
|
self.isAdmin = isAdmin
|
|
self.method = method
|
|
self.org = org
|
|
self.path = path
|
|
self.prevHash = prevHash
|
|
self.reason = reason
|
|
self.requestId = requestId
|
|
self.resource = resource
|
|
self.resourceId = resourceId
|
|
self.result = result
|
|
self.seq = seq
|
|
self.sourceIp = sourceIp
|
|
self.status = status
|
|
self.sub = sub
|
|
self.time = time
|
|
self.userAgent = userAgent
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case action
|
|
case authMethod
|
|
case email
|
|
case hash
|
|
case home
|
|
case isAdmin
|
|
case method
|
|
case org
|
|
case path
|
|
case prevHash
|
|
case reason
|
|
case requestId
|
|
case resource
|
|
case resourceId
|
|
case result
|
|
case seq
|
|
case sourceIp
|
|
case status
|
|
case sub
|
|
case time
|
|
case userAgent
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(action, forKey: .action)
|
|
try container.encodeIfPresent(authMethod, forKey: .authMethod)
|
|
try container.encodeIfPresent(email, forKey: .email)
|
|
try container.encodeIfPresent(hash, forKey: .hash)
|
|
try container.encodeIfPresent(home, forKey: .home)
|
|
try container.encodeIfPresent(isAdmin, forKey: .isAdmin)
|
|
try container.encodeIfPresent(method, forKey: .method)
|
|
try container.encodeIfPresent(org, forKey: .org)
|
|
try container.encodeIfPresent(path, forKey: .path)
|
|
try container.encodeIfPresent(prevHash, forKey: .prevHash)
|
|
try container.encodeIfPresent(reason, forKey: .reason)
|
|
try container.encodeIfPresent(requestId, forKey: .requestId)
|
|
try container.encodeIfPresent(resource, forKey: .resource)
|
|
try container.encodeIfPresent(resourceId, forKey: .resourceId)
|
|
try container.encodeIfPresent(result, forKey: .result)
|
|
try container.encodeIfPresent(seq, forKey: .seq)
|
|
try container.encodeIfPresent(sourceIp, forKey: .sourceIp)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(sub, forKey: .sub)
|
|
try container.encodeIfPresent(time, forKey: .time)
|
|
try container.encodeIfPresent(userAgent, forKey: .userAgent)
|
|
}
|
|
}
|
|
|