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.
66 lines
2.7 KiB
Swift
66 lines
2.7 KiB
Swift
//
|
|
// UsageAnalyticsView.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct UsageAnalyticsView: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** End is the window's exclusive end, RFC3339 UTC. */
|
|
public var end: String?
|
|
/** Export is whether the resolved plan allows exporting these rows. */
|
|
public var export: Bool?
|
|
/** Plan echoes the plan id the entitlement was resolved from. */
|
|
public var plan: String?
|
|
/** Providers is the per-provider roll-up over the window. */
|
|
public var providers: ProviderBreakdown?
|
|
/** Range is the label that was ASKED for. A plan whose retention is shorter than that window is served the retention instead, so read start and end for the window the rows actually cover and retentionDays for the reason — on a clamped read the label is longer than what was served. */
|
|
public var range: String?
|
|
/** RetentionDays is how far back the resolved plan allows reading. */
|
|
public var retentionDays: Int64?
|
|
/** Scope is the tenant the rows were read under — the validated principal's org. */
|
|
public var scope: UsageScope?
|
|
/** Start is the window's inclusive start, RFC3339 UTC, AFTER the retention clamp — so it may be later than the start that was asked for. */
|
|
public var start: String?
|
|
|
|
public init(end: String? = nil, export: Bool? = nil, plan: String? = nil, providers: ProviderBreakdown? = nil, range: String? = nil, retentionDays: Int64? = nil, scope: UsageScope? = nil, start: String? = nil) {
|
|
self.end = end
|
|
self.export = export
|
|
self.plan = plan
|
|
self.providers = providers
|
|
self.range = range
|
|
self.retentionDays = retentionDays
|
|
self.scope = scope
|
|
self.start = start
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case end
|
|
case export
|
|
case plan
|
|
case providers
|
|
case range
|
|
case retentionDays
|
|
case scope
|
|
case start
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(end, forKey: .end)
|
|
try container.encodeIfPresent(export, forKey: .export)
|
|
try container.encodeIfPresent(plan, forKey: .plan)
|
|
try container.encodeIfPresent(providers, forKey: .providers)
|
|
try container.encodeIfPresent(range, forKey: .range)
|
|
try container.encodeIfPresent(retentionDays, forKey: .retentionDays)
|
|
try container.encodeIfPresent(scope, forKey: .scope)
|
|
try container.encodeIfPresent(start, forKey: .start)
|
|
}
|
|
}
|
|
|