diff --git a/docs/openapi/monitoring-api.json b/docs/openapi/monitoring-api.json index ccd3413..d25734a 100644 --- a/docs/openapi/monitoring-api.json +++ b/docs/openapi/monitoring-api.json @@ -24474,14 +24474,12 @@ ] }, "timing": { - "type": "object", - "additionalProperties": { - "type": "object", - "description": "Request phase timing breakdown", - "nullable": true - }, - "description": "Request phase timing breakdown", - "nullable": true + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/TimingPhasesDto" + } + ] }, "bodyTruncated": { "type": "boolean", @@ -31653,6 +31651,54 @@ }, "description": "Event type to use for a test webhook delivery" }, + "TimingPhasesDto": { + "type": "object", + "properties": { + "dns_ms": { + "type": "integer", + "description": "DNS resolution time in milliseconds", + "format": "int32", + "nullable": true, + "example": 12 + }, + "tcp_ms": { + "type": "integer", + "description": "TCP connect time in milliseconds", + "format": "int32", + "nullable": true, + "example": 18 + }, + "tls_ms": { + "type": "integer", + "description": "TLS handshake time in milliseconds (null for plain HTTP)", + "format": "int32", + "nullable": true, + "example": 34 + }, + "ttfb_ms": { + "type": "integer", + "description": "Time to first response byte in milliseconds", + "format": "int32", + "nullable": true, + "example": 42 + }, + "download_ms": { + "type": "integer", + "description": "Response body download time in milliseconds", + "format": "int32", + "nullable": true, + "example": 8 + }, + "total_ms": { + "type": "integer", + "description": "Total wall-clock request time in milliseconds", + "format": "int32", + "nullable": true, + "example": 114 + } + }, + "description": "Per-phase HTTP request timing breakdown (milliseconds)" + }, "TlsInfoDto": { "type": "object", "properties": { diff --git a/src/devhelm/_generated.py b/src/devhelm/_generated.py index 0495bf8..6f5bd77 100644 --- a/src/devhelm/_generated.py +++ b/src/devhelm/_generated.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: .openapi-preprocessed.json -# timestamp: 2026-04-23T14:44:11+00:00 +# timestamp: 2026-04-23T17:38:04+00:00 from __future__ import annotations from typing import Annotated, Any, Literal @@ -2006,22 +2006,6 @@ class CheckType1(StrEnum): http = "http" -class Http(BaseModel): - model_config = ConfigDict(extra="forbid") - check_type: Literal["http"] - timing: Annotated[ - dict[str, dict[str, Any]] | None, - Field(description="Request phase timing breakdown"), - ] = None - body_truncated: Annotated[ - bool | None, - Field( - alias="bodyTruncated", - description="Whether the response body was truncated before storage", - ), - ] = None - - class Method(StrEnum): get = "GET" post = "POST" @@ -5231,6 +5215,38 @@ class TestWebhookEndpointRequest(BaseModel): ] = None +class TimingPhasesDto(BaseModel): + model_config = ConfigDict(extra="forbid") + dns_ms: Annotated[ + int | None, + Field(description="DNS resolution time in milliseconds", examples=[12]), + ] = None + tcp_ms: Annotated[ + int | None, Field(description="TCP connect time in milliseconds", examples=[18]) + ] = None + tls_ms: Annotated[ + int | None, + Field( + description="TLS handshake time in milliseconds (null for plain HTTP)", + examples=[34], + ), + ] = None + ttfb_ms: Annotated[ + int | None, + Field(description="Time to first response byte in milliseconds", examples=[42]), + ] = None + download_ms: Annotated[ + int | None, + Field(description="Response body download time in milliseconds", examples=[8]), + ] = None + total_ms: Annotated[ + int | None, + Field( + description="Total wall-clock request time in milliseconds", examples=[114] + ), + ] = None + + class TlsInfoDto(BaseModel): model_config = ConfigDict(extra="forbid") subject_cn: Annotated[ @@ -6181,16 +6197,6 @@ class BulkMonitorActionResult(BaseModel): ] -class CheckTypeDetailsDto(RootModel[Http | Tcp | Icmp | Dns | McpServer]): - root: Annotated[ - Http | Tcp | Icmp | Dns | McpServer, - Field( - description="Check-type-specific details — polymorphic by check_type discriminator", - discriminator="check_type", - ), - ] - - class ComponentUptimeDayDto(BaseModel): model_config = ConfigDict(extra="forbid") date: Annotated[ @@ -6636,6 +6642,19 @@ class GlobalStatusSummaryDto(BaseModel): ] +class Http(BaseModel): + model_config = ConfigDict(extra="forbid") + check_type: Literal["http"] + timing: TimingPhasesDto | None = None + body_truncated: Annotated[ + bool | None, + Field( + alias="bodyTruncated", + description="Whether the response body was truncated before storage", + ), + ] = None + + class IncidentDetailDto(BaseModel): model_config = ConfigDict(extra="forbid") incident: IncidentDto @@ -7514,6 +7533,55 @@ class BatchComponentUptimeDto(BaseModel): ] +class CheckTypeDetailsDto(RootModel[Http | Tcp | Icmp | Dns | McpServer]): + root: Annotated[ + Http | Tcp | Icmp | Dns | McpServer, + Field( + description="Check-type-specific details — polymorphic by check_type discriminator", + discriminator="check_type", + ), + ] + + +class CreateNotificationPolicyRequest(BaseModel): + model_config = ConfigDict(extra="forbid") + name: Annotated[ + str, + Field( + description="Human-readable name for this policy", + max_length=255, + min_length=0, + ), + ] + match_rules: Annotated[ + list[MatchRule] | None, + Field( + alias="matchRules", + description="Match rules to evaluate (all must pass; omit or empty for catch-all)", + ), + ] = None + escalation: EscalationChain + enabled: Annotated[ + bool | None, Field(description="Whether this policy is enabled (default true)") + ] = True + priority: Annotated[ + int | None, + Field( + description="Evaluation priority; higher value = evaluated first (default 0)" + ), + ] = 0 + + +class SingleValueResponseBatchComponentUptimeDto(BaseModel): + model_config = ConfigDict(extra="forbid") + data: BatchComponentUptimeDto + + +class SingleValueResponseStatusPageIncidentDto(BaseModel): + model_config = ConfigDict(extra="forbid") + data: StatusPageIncidentDto + + class CheckResultDetailsDto(BaseModel): model_config = ConfigDict(extra="forbid") status_code: Annotated[ @@ -7613,35 +7681,6 @@ class CheckResultDto(BaseModel): ] = None -class CreateNotificationPolicyRequest(BaseModel): - model_config = ConfigDict(extra="forbid") - name: Annotated[ - str, - Field( - description="Human-readable name for this policy", - max_length=255, - min_length=0, - ), - ] - match_rules: Annotated[ - list[MatchRule] | None, - Field( - alias="matchRules", - description="Match rules to evaluate (all must pass; omit or empty for catch-all)", - ), - ] = None - escalation: EscalationChain - enabled: Annotated[ - bool | None, Field(description="Whether this policy is enabled (default true)") - ] = True - priority: Annotated[ - int | None, - Field( - description="Evaluation priority; higher value = evaluated first (default 0)" - ), - ] = 0 - - class CursorPageCheckResultDto(BaseModel): model_config = ConfigDict(extra="forbid") data: Annotated[list[CheckResultDto], Field(description="Items on this page")] @@ -7658,13 +7697,3 @@ class CursorPageCheckResultDto(BaseModel): alias="hasMore", description="Whether more results exist beyond this page" ), ] - - -class SingleValueResponseBatchComponentUptimeDto(BaseModel): - model_config = ConfigDict(extra="forbid") - data: BatchComponentUptimeDto - - -class SingleValueResponseStatusPageIncidentDto(BaseModel): - model_config = ConfigDict(extra="forbid") - data: StatusPageIncidentDto