""" Options: Date: 2024-11-21 03:16:43 Version: 6.00 Tip: To override a DTO option, remove "#" prefix before updating BaseUrl: https://resourcelibrary.api.ashcompanies.com #GlobalNamespace: #AddServiceStackTypes: True #AddResponseStatus: False #AddImplicitVersion: #AddDescriptionAsComments: True IncludeTypes: HealthCheckRequest.* #ExcludeTypes: #DefaultImports: datetime,decimal,marshmallow.fields:*,servicestack:*,typing:*,dataclasses:dataclass/field,dataclasses_json:dataclass_json/LetterCase/Undefined/config,enum:Enum/IntEnum #DataClass: #DataClassJson: """ import datetime import decimal from marshmallow.fields import * from servicestack import * from typing import * from dataclasses import dataclass, field from dataclasses_json import dataclass_json, LetterCase, Undefined, config from enum import Enum, IntEnum # @Flags() class HealthStatus(IntEnum): HEALTHY = 0 DEGRADED = 4 UNHEALTHY = 8 @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class HealthReportEntry: status: Optional[HealthStatus] = None description: Optional[str] = None duration: datetime.timedelta = datetime.timedelta() exception: Optional[Exception] = None data: Optional[IReadOnlyDictionary[str, Object]] = None @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class HealthReport: entries: Optional[IReadOnlyDictionary[str, HealthReportEntry]] = None application_status: Optional[HealthStatus] = None duration: datetime.timedelta = datetime.timedelta() # @Route("/health") @dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE) @dataclass class HealthCheckRequest(IReturn[HealthReport]): pass