/* Options: Date: 2026-06-12 23:08:36 SwiftVersion: 6.0 Version: 10.05 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://api.bookmore.com //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: RecordAiChatUsage.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/assistant/ai-chat/usage", "POST") // @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401) // @ValidateRequest(Validator="IsAuthenticated") public class RecordAiChatUsage : IReturn, ICompany, Codable { public typealias Return = AiChatUsageResponse /** * The company id. Defaults to the logged-in user's company when omitted. */ // @ApiMember(DataType="string", Description="The company id. Defaults to the logged-in user's company when omitted.", ParameterType="query") public var companyId:String? /** * Number of tokens consumed by the chat turn (input + output). */ // @ApiMember(DataType="integer", Description="Number of tokens consumed by the chat turn (input + output).", IsRequired=true) public var tokensUsed:Int? required public init(){} } public class AiChatUsageResponse : Codable { /** * The company the usage applies to. */ // @ApiMember(Description="The company the usage applies to.") public var companyId:String? /** * Tokens consumed within the current rolling window. */ // @ApiMember(Description="Tokens consumed within the current rolling window.") public var tokensUsed:Int? /** * The company's token limit for the window. */ // @ApiMember(Description="The company's token limit for the window.") public var tokenLimit:Int? /** * Tokens remaining before the limit is reached (never negative). */ // @ApiMember(Description="Tokens remaining before the limit is reached (never negative).") public var tokensRemaining:Int? /** * True while the company is still below its token limit. */ // @ApiMember(Description="True while the company is still below its token limit.") public var isWithinBudget:Bool? /** * Length of the rolling usage window, in days. */ // @ApiMember(Description="Length of the rolling usage window, in days.") public var windowDays:Int? public var responseStatus:ResponseStatus? required public init(){} } public protocol ICompany { var companyId:String? { get set } }