From df4d0804b7d2a60de598a7abae2656eaec0f9efd Mon Sep 17 00:00:00 2001 From: caballeto Date: Fri, 1 May 2026 15:11:30 +0200 Subject: [PATCH] chore(spec): refresh spec + regenerate types for forensic endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Catches up the bundled OpenAPI copy to mono main (adds the 5 forensic read endpoints: timeline, trace, rule-evaluations, transitions, policy snapshot). No resources or data sources wire these yet — forensic reads are diagnostic-only and don't map to Terraform resources — but keeping the generated types current lets a future plan/apply flow surface them via a data source if we ever want to. Also fixes the spec-check workflow: `gh api ... -o ` has never worked (gh api has no -o flag), so every auto-dispatch would have failed on the download step. Switched to a `> ` redirect. Made-with: Cursor --- .github/workflows/spec-check.yml | 2 +- docs/openapi/monitoring-api.json | 1313 +++++++++++++++++++++++++++--- internal/generated/types.go | 366 ++++++++- 3 files changed, 1583 insertions(+), 98 deletions(-) diff --git a/.github/workflows/spec-check.yml b/.github/workflows/spec-check.yml index 2676d89..17ab785 100644 --- a/.github/workflows/spec-check.yml +++ b/.github/workflows/spec-check.yml @@ -22,7 +22,7 @@ jobs: run: | gh api repos/devhelmhq/mono/contents/docs/openapi/monitoring-api.json \ -H "Accept: application/vnd.github.raw+json" \ - -o docs/openapi/monitoring-api.json + > docs/openapi/monitoring-api.json env: GH_TOKEN: ${{ secrets.MONOREPO_DISPATCH_TOKEN }} diff --git a/docs/openapi/monitoring-api.json b/docs/openapi/monitoring-api.json index d25734a..41903c1 100644 --- a/docs/openapi/monitoring-api.json +++ b/docs/openapi/monitoring-api.json @@ -58,6 +58,10 @@ "name": "Environments", "description": "Variable namespace management for monitors" }, + { + "name": "Forensics", + "description": "Detection engine event-sourced history (policy snapshots, rule evaluations, state transitions)" + }, { "name": "Heartbeat", "description": "Public ping endpoint for heartbeat monitors" @@ -2910,41 +2914,649 @@ } } }, - "503": { - "description": "Service unavailable — try again shortly", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } + "503": { + "description": "Service unavailable — try again shortly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Environments" + ], + "summary": "Create environment", + "operationId": "create_13", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEnvironmentRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SingleValueResponseEnvironmentDto" + } + } + } + }, + "400": { + "description": "Bad request — the payload failed validation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden — the actor lacks permission for this resource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found — the requested resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict — the request collides with current resource state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error — see the message field for details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "502": { + "description": "Bad gateway — an upstream provider returned an error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Service unavailable — try again shortly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/v1/environments/{slug}": { + "get": { + "tags": [ + "Environments" + ], + "summary": "Get environment by slug", + "operationId": "get_7", + "parameters": [ + { + "name": "slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SingleValueResponseEnvironmentDto" + } + } + } + }, + "400": { + "description": "Bad request — the payload failed validation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden — the actor lacks permission for this resource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found — the requested resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict — the request collides with current resource state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error — see the message field for details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "502": { + "description": "Bad gateway — an upstream provider returned an error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Service unavailable — try again shortly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "put": { + "tags": [ + "Environments" + ], + "summary": "Update environment", + "operationId": "update_13", + "parameters": [ + { + "name": "slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateEnvironmentRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SingleValueResponseEnvironmentDto" + } + } + } + }, + "400": { + "description": "Bad request — the payload failed validation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden — the actor lacks permission for this resource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found — the requested resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict — the request collides with current resource state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error — see the message field for details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "502": { + "description": "Bad gateway — an upstream provider returned an error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Service unavailable — try again shortly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Environments" + ], + "summary": "Delete environment", + "operationId": "delete_9", + "parameters": [ + { + "name": "slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad request — the payload failed validation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden — the actor lacks permission for this resource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found — the requested resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict — the request collides with current resource state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error — see the message field for details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "502": { + "description": "Bad gateway — an upstream provider returned an error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Service unavailable — try again shortly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/v1/forensics/incidents/{id}/timeline": { + "get": { + "tags": [ + "Forensics" + ], + "summary": "Full forensic timeline for an incident", + "description": "Returns every state-machine transition for this incident plus the rule evaluations that caused each transition, plus the policy snapshot that triggered confirmation. Correlate evaluations to transitions via evaluation.triggeringTransitionId == transition.id.", + "operationId": "getTimeline", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SingleValueResponseIncidentTimelineDto" + } + } + } + }, + "400": { + "description": "Bad request — the payload failed validation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized — missing or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "403": { + "description": "Forbidden — the actor lacks permission for this resource", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "404": { + "description": "Not found — the requested resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "409": { + "description": "Conflict — the request collides with current resource state", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error — see the message field for details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "502": { + "description": "Bad gateway — an upstream provider returned an error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "503": { + "description": "Service unavailable — try again shortly", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + } + } + }, + "/api/v1/forensics/monitors/{id}/rule-evaluations": { + "get": { + "tags": [ + "Forensics" + ], + "summary": "Paged list of rule evaluations for a monitor", + "description": "Filter by ruleType (e.g. consecutive_failures), region, onlyMatched=true to narrow to firing evaluations, and occurredAt window.", + "operationId": "listMonitorRuleEvaluations", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "ruleType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "region", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "onlyMatched", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "to", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Pageable" } } - } - }, - "post": { - "tags": [ - "Environments" ], - "summary": "Create environment", - "operationId": "create_13", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateEnvironmentRequest" - } - } - }, - "required": true - }, "responses": { - "201": { - "description": "Created", + "200": { + "description": "OK", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/SingleValueResponseEnvironmentDto" + "$ref": "#/components/schemas/TableValueResultRuleEvaluationDto" } } } @@ -3032,20 +3644,47 @@ } } }, - "/api/v1/environments/{slug}": { + "/api/v1/forensics/monitors/{id}/transitions": { "get": { "tags": [ - "Environments" + "Forensics" ], - "summary": "Get environment by slug", - "operationId": "get_7", + "summary": "Paged list of state transitions for a monitor (optionally time-bounded)", + "operationId": "listMonitorTransitions", "parameters": [ { - "name": "slug", + "name": "id", "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" + } + }, + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "to", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "$ref": "#/components/schemas/Pageable" } } ], @@ -3055,7 +3694,7 @@ "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/SingleValueResponseEnvironmentDto" + "$ref": "#/components/schemas/TableValueResultIncidentStateTransitionDto" } } } @@ -3141,16 +3780,19 @@ } } } - }, - "put": { + } + }, + "/api/v1/forensics/policy-snapshots/{hashHex}": { + "get": { "tags": [ - "Environments" + "Forensics" ], - "summary": "Update environment", - "operationId": "update_13", + "summary": "Fetch a policy snapshot by its content hash", + "description": "Hash is SHA-256 over canonical policy JSON, hex-encoded. Access is gated: caller's org must have evaluated against this hash at least once.", + "operationId": "getPolicySnapshot", "parameters": [ { - "name": "slug", + "name": "hashHex", "in": "path", "required": true, "schema": { @@ -3158,23 +3800,13 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateEnvironmentRequest" - } - } - }, - "required": true - }, "responses": { "200": { "description": "OK", "content": { "*/*": { "schema": { - "$ref": "#/components/schemas/SingleValueResponseEnvironmentDto" + "$ref": "#/components/schemas/SingleValueResponsePolicySnapshotDto" } } } @@ -3260,26 +3892,37 @@ } } } - }, - "delete": { + } + }, + "/api/v1/forensics/traces/{checkId}": { + "get": { "tags": [ - "Environments" + "Forensics" ], - "summary": "Delete environment", - "operationId": "delete_9", + "summary": "Replay a single check execution", + "description": "Returns every rule evaluation and state transition emitted for this scheduler-minted check_id (V92), plus the policy snapshot that governed them.", + "operationId": "getTrace", "parameters": [ { - "name": "slug", + "name": "checkId", "in": "path", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], "responses": { - "204": { - "description": "No Content" + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/SingleValueResponseCheckTraceDto" + } + } + } }, "400": { "description": "Bad request — the payload failed validation", @@ -21502,14 +22145,12 @@ "nullable": true }, "metadata": { - "type": "object", - "additionalProperties": { - "type": "object", - "description": "Additional context about the action", - "nullable": true - }, - "description": "Additional context about the action", - "nullable": true + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/AuditMetadata" + } + ] }, "createdAt": { "type": "string", @@ -21518,6 +22159,21 @@ } } }, + "AuditMetadata": { + "description": "Typed metadata payload attached to an audit event; null for actions that carry no extra context.", + "nullable": true, + "discriminator": { + "propertyName": "kind", + "mapping": { + "member_role_changed": "#/components/schemas/MemberRoleChangedMetadata" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/MemberRoleChangedMetadata" + } + ] + }, "AuthMeResponse": { "required": [ "key", @@ -21938,6 +22594,43 @@ }, "description": "A single check result from a monitor run" }, + "CheckTraceDto": { + "required": [ + "checkId", + "evaluations", + "transitions" + ], + "type": "object", + "properties": { + "checkId": { + "type": "string", + "description": "The check execution ID this trace is keyed by", + "format": "uuid" + }, + "evaluations": { + "type": "array", + "description": "All rule evaluations that ran for this check", + "items": { + "$ref": "#/components/schemas/RuleEvaluationDto" + } + }, + "transitions": { + "type": "array", + "description": "State-machine transitions this check caused (may be empty if nothing fired)", + "items": { + "$ref": "#/components/schemas/IncidentStateTransitionDto" + } + }, + "policySnapshot": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/PolicySnapshotDto" + } + ] + } + } + }, "CheckTypeDetailsDto": { "description": "Check-type-specific details — polymorphic by check_type discriminator", "discriminator": { @@ -24935,6 +25628,28 @@ "type": "string", "description": "Name of the resource group; populated on list responses. Omitted from JSON (undefined to SDKs) on detail responses, treat missing as null.", "nullable": true + }, + "triggeringCheckId": { + "type": "string", + "description": "Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions. Omitted from JSON (undefined to SDKs) when null, treat missing as null.", + "format": "uuid", + "nullable": true + }, + "triggeredByRuleSnapshotHashHex": { + "type": "string", + "description": "Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule. Omitted from JSON when null, treat missing as null.", + "nullable": true + }, + "triggeredByRuleIndex": { + "type": "integer", + "description": "Index of the fired rule inside the policy's trigger_rules array. Omitted from JSON when null, treat missing as null.", + "format": "int32", + "nullable": true + }, + "engineVersion": { + "type": "string", + "description": "Detection engine semver that evaluated the rule. Omitted from JSON when null, treat missing as null.", + "nullable": true } }, "description": "Incident triggered by a monitor check failure or manual creation" @@ -25108,42 +25823,164 @@ "properties": { "id": { "type": "string", - "description": "Internal incident ID — UUID for status-page incidents, service incident UUID for catalog", - "format": "uuid" + "description": "Internal incident ID — UUID for status-page incidents, service incident UUID for catalog", + "format": "uuid" + }, + "title": { + "type": "string", + "description": "Incident title at the time of the overlap" + }, + "impact": { + "type": "string", + "description": "Incident impact level (e.g. minor, major, critical for catalog; NONE/MINOR/MAJOR/CRITICAL for status pages)" + } + }, + "description": "Lightweight reference to an incident overlapping a given uptime day" + }, + "IncidentsSummaryDto": { + "type": "object", + "properties": { + "active": { + "type": "integer", + "format": "int64" + }, + "resolvedToday": { + "type": "integer", + "format": "int64" + }, + "mttr30d": { + "type": "number", + "format": "double", + "nullable": true + } + }, + "description": "Incident summary counters", + "required": [ + "active", + "resolvedToday" + ] + }, + "IncidentStateTransitionDto": { + "required": [ + "affectedRegions", + "checkId", + "details", + "engineVersion", + "fromStatus", + "id", + "monitorId", + "occurredAt", + "policySnapshotHashHex", + "reason", + "toStatus", + "triggeringEvaluationIds" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Forensic row UUID", + "format": "uuid" + }, + "occurredAt": { + "type": "string", + "description": "When the state transition occurred", + "format": "date-time" + }, + "monitorId": { + "type": "string", + "description": "Monitor this transition pertains to", + "format": "uuid" + }, + "incidentId": { + "type": "string", + "description": "Incident this transition belongs to; null for pre-incident (auto-cleared) transitions", + "format": "uuid", + "nullable": true + }, + "fromStatus": { + "minLength": 1, + "type": "string", + "description": "Previous status (WATCHING | TRIGGERED | CONFIRMED | RESOLVED)" + }, + "toStatus": { + "minLength": 1, + "type": "string", + "description": "New status (WATCHING | TRIGGERED | CONFIRMED | RESOLVED)" + }, + "reason": { + "minLength": 1, + "type": "string", + "description": "Why the transition fired (trigger | confirm | resolve | auto_clear | reopen)" + }, + "triggeringEvaluationIds": { + "type": "array", + "description": "rule_evaluation ids that caused this transition (may be empty for timeout-driven edges)", + "items": { + "type": "string", + "description": "rule_evaluation ids that caused this transition (may be empty for timeout-driven edges)", + "format": "uuid" + } + }, + "affectedRegions": { + "type": "array", + "description": "Regions whose evaluations contributed to this transition", + "items": { + "type": "string", + "description": "Regions whose evaluations contributed to this transition" + } + }, + "policySnapshotHashHex": { + "minLength": 1, + "type": "string", + "description": "Hex-encoded hash of the policy snapshot that governed this transition" }, - "title": { + "engineVersion": { + "minLength": 1, "type": "string", - "description": "Incident title at the time of the overlap" + "description": "Detection engine version that emitted this transition" }, - "impact": { + "checkId": { "type": "string", - "description": "Incident impact level (e.g. minor, major, critical for catalog; NONE/MINOR/MAJOR/CRITICAL for status pages)" + "description": "Scheduler-minted check execution ID (V92) of the triggering result", + "format": "uuid" + }, + "details": { + "$ref": "#/components/schemas/StateTransitionDetails" } }, - "description": "Lightweight reference to an incident overlapping a given uptime day" + "description": "State-machine transitions this check caused (may be empty if nothing fired)" }, - "IncidentsSummaryDto": { + "IncidentTimelineDto": { + "required": [ + "transitions", + "triggeringEvaluations" + ], "type": "object", "properties": { - "active": { - "type": "integer", - "format": "int64" + "transitions": { + "type": "array", + "description": "State-machine transitions in chronological order", + "items": { + "$ref": "#/components/schemas/IncidentStateTransitionDto" + } }, - "resolvedToday": { - "type": "integer", - "format": "int64" + "triggeringEvaluations": { + "type": "array", + "description": "Rule evaluations that caused any of the transitions above. Correlate via evaluation.triggeringTransitionId == transition.id", + "items": { + "$ref": "#/components/schemas/RuleEvaluationDto" + } }, - "mttr30d": { - "type": "number", - "format": "double", - "nullable": true + "policySnapshot": { + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/PolicySnapshotDto" + } + ] } - }, - "description": "Incident summary counters", - "required": [ - "active", - "resolvedToday" - ] + } }, "IncidentUpdateDto": { "required": [ @@ -25965,6 +26802,41 @@ }, "description": "Organization member with role and status" }, + "MemberRoleChangedMetadata": { + "required": [ + "kind", + "oldRole", + "newRole" + ], + "type": "object", + "description": "Role transition recorded when an organization member's role changes.", + "properties": { + "kind": { + "type": "string", + "enum": [ + "member_role_changed" + ] + }, + "oldRole": { + "type": "string", + "description": "Role the member held before the change", + "enum": [ + "OWNER", + "ADMIN", + "MEMBER" + ] + }, + "newRole": { + "type": "string", + "description": "Role the member holds after the change", + "enum": [ + "OWNER", + "ADMIN", + "MEMBER" + ] + } + } + }, "MonitorAssertionDto": { "required": [ "assertionType", @@ -27096,6 +27968,48 @@ }, "description": "Billing plan and entitlement state" }, + "PolicySnapshotDto": { + "required": [ + "engineVersion", + "firstSeenAt", + "hashHex", + "lastSeenAt", + "policy" + ], + "type": "object", + "properties": { + "hashHex": { + "minLength": 1, + "type": "string", + "description": "Hex-encoded SHA-256 of the canonical policy JSON" + }, + "policy": { + "type": "object", + "additionalProperties": { + "type": "object", + "description": "Canonical policy document (snake_case, sorted keys)" + }, + "description": "Canonical policy document (snake_case, sorted keys)" + }, + "engineVersion": { + "minLength": 1, + "type": "string", + "description": "Detection engine version that observed this policy" + }, + "firstSeenAt": { + "type": "string", + "description": "First time the detection engine evaluated against this policy bytes", + "format": "date-time" + }, + "lastSeenAt": { + "type": "string", + "description": "Most recent time the engine evaluated against this policy bytes", + "format": "date-time" + } + }, + "description": "Policy snapshot used during this check (all evaluations of a single check are against one policy)", + "nullable": true + }, "PollChartBucketDto": { "required": [ "bucket", @@ -27860,6 +28774,105 @@ }, "description": "Default retry strategy for member monitors; null clears" }, + "RuleEvaluationDto": { + "required": [ + "checkId", + "engineVersion", + "evaluationDetails", + "id", + "inputResultIds", + "monitorId", + "occurredAt", + "policySnapshotHashHex", + "region", + "ruleScope", + "ruleType", + "ruleIndex", + "outputMatched" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Forensic row UUID", + "format": "uuid" + }, + "occurredAt": { + "type": "string", + "description": "When the evaluation ran", + "format": "date-time" + }, + "monitorId": { + "type": "string", + "description": "Monitor that produced the input check result", + "format": "uuid" + }, + "region": { + "minLength": 1, + "type": "string", + "description": "Probe region of the input check result" + }, + "policySnapshotHashHex": { + "minLength": 1, + "type": "string", + "description": "Hex-encoded hash of the policy snapshot this rule came from" + }, + "ruleIndex": { + "type": "integer", + "description": "Index into the policy's triggerRules array (0-based)", + "format": "int32" + }, + "ruleType": { + "minLength": 1, + "type": "string", + "description": "Rule type (e.g. consecutive_failures, failures_in_window)" + }, + "ruleScope": { + "minLength": 1, + "type": "string", + "description": "Rule scope (per_region | multi_region)" + }, + "inputResultIds": { + "minItems": 1, + "type": "array", + "description": "check_results IDs that were inputs to this evaluation (newest first)", + "items": { + "type": "string", + "description": "check_results IDs that were inputs to this evaluation (newest first)", + "format": "uuid" + } + }, + "outputMatched": { + "type": "boolean", + "description": "Whether the rule fired on this evaluation" + }, + "evaluationDetails": { + "type": "object", + "additionalProperties": { + "type": "object", + "description": "Structured details (e.g. failure counts, response-time aggregates)" + }, + "description": "Structured details (e.g. failure counts, response-time aggregates)" + }, + "engineVersion": { + "minLength": 1, + "type": "string", + "description": "Detection engine version that ran this evaluation" + }, + "checkId": { + "type": "string", + "description": "Scheduler-minted check execution ID (V92) — the causal chain identifier", + "format": "uuid" + }, + "triggeringTransitionId": { + "type": "string", + "description": "If this evaluation caused a state transition, points to that transition's id", + "format": "uuid", + "nullable": true + } + }, + "description": "All rule evaluations that ran for this check" + }, "ScheduledMaintenanceDto": { "required": [ "affectedComponents", @@ -28981,6 +29994,17 @@ } } }, + "SingleValueResponseCheckTraceDto": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/CheckTraceDto" + } + } + }, "SingleValueResponseDashboardOverviewDto": { "required": [ "data" @@ -29058,6 +30082,17 @@ } } }, + "SingleValueResponseIncidentTimelineDto": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/IncidentTimelineDto" + } + } + }, "SingleValueResponseInviteDto": { "required": [ "data" @@ -29195,6 +30230,17 @@ } } }, + "SingleValueResponsePolicySnapshotDto": { + "required": [ + "data" + ], + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/PolicySnapshotDto" + } + } + }, "SingleValueResponseResourceGroupDto": { "required": [ "data" @@ -29537,6 +30583,23 @@ "minDaysRemaining" ] }, + "StateTransitionDetails": { + "required": [ + "source" + ], + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Actor that produced this transition (pipeline | public-api)", + "enum": [ + "pipeline", + "public-api" + ] + } + }, + "description": "Typed metadata about this transition (currently: actor source)" + }, "StatusCodeAssertion": { "required": [ "type", @@ -30525,6 +31588,38 @@ } } }, + "TableValueResultIncidentStateTransitionDto": { + "required": [ + "data", + "hasNext", + "hasPrev" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IncidentStateTransitionDto" + } + }, + "hasNext": { + "type": "boolean" + }, + "hasPrev": { + "type": "boolean" + }, + "totalElements": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "totalPages": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + }, "TableValueResultIntegrationDto": { "required": [ "data", @@ -30845,6 +31940,38 @@ } } }, + "TableValueResultRuleEvaluationDto": { + "required": [ + "data", + "hasNext", + "hasPrev" + ], + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RuleEvaluationDto" + } + }, + "hasNext": { + "type": "boolean" + }, + "hasPrev": { + "type": "boolean" + }, + "totalElements": { + "type": "integer", + "format": "int64", + "nullable": true + }, + "totalPages": { + "type": "integer", + "format": "int32", + "nullable": true + } + } + }, "TableValueResultScheduledMaintenanceDto": { "required": [ "data", diff --git a/internal/generated/types.go b/internal/generated/types.go index 9eadd41..cf4af53 100644 --- a/internal/generated/types.go +++ b/internal/generated/types.go @@ -1939,6 +1939,63 @@ func (e MemberDtoStatus) Valid() bool { } } +// Defines values for MemberRoleChangedMetadataKind. +const ( + MemberRoleChanged MemberRoleChangedMetadataKind = "member_role_changed" +) + +// Valid indicates whether the value is a known member of the MemberRoleChangedMetadataKind enum. +func (e MemberRoleChangedMetadataKind) Valid() bool { + switch e { + case MemberRoleChanged: + return true + default: + return false + } +} + +// Defines values for MemberRoleChangedMetadataNewRole. +const ( + MemberRoleChangedMetadataNewRoleADMIN MemberRoleChangedMetadataNewRole = "ADMIN" + MemberRoleChangedMetadataNewRoleMEMBER MemberRoleChangedMetadataNewRole = "MEMBER" + MemberRoleChangedMetadataNewRoleOWNER MemberRoleChangedMetadataNewRole = "OWNER" +) + +// Valid indicates whether the value is a known member of the MemberRoleChangedMetadataNewRole enum. +func (e MemberRoleChangedMetadataNewRole) Valid() bool { + switch e { + case MemberRoleChangedMetadataNewRoleADMIN: + return true + case MemberRoleChangedMetadataNewRoleMEMBER: + return true + case MemberRoleChangedMetadataNewRoleOWNER: + return true + default: + return false + } +} + +// Defines values for MemberRoleChangedMetadataOldRole. +const ( + MemberRoleChangedMetadataOldRoleADMIN MemberRoleChangedMetadataOldRole = "ADMIN" + MemberRoleChangedMetadataOldRoleMEMBER MemberRoleChangedMetadataOldRole = "MEMBER" + MemberRoleChangedMetadataOldRoleOWNER MemberRoleChangedMetadataOldRole = "OWNER" +) + +// Valid indicates whether the value is a known member of the MemberRoleChangedMetadataOldRole enum. +func (e MemberRoleChangedMetadataOldRole) Valid() bool { + switch e { + case MemberRoleChangedMetadataOldRoleADMIN: + return true + case MemberRoleChangedMetadataOldRoleMEMBER: + return true + case MemberRoleChangedMetadataOldRoleOWNER: + return true + default: + return false + } +} + // Defines values for MonitorAssertionDtoAssertionType. const ( MonitorAssertionDtoAssertionTypeBodyContains MonitorAssertionDtoAssertionType = "body_contains" @@ -2665,6 +2722,24 @@ func (e SslExpiryAssertionType) Valid() bool { } } +// Defines values for StateTransitionDetailsSource. +const ( + Pipeline StateTransitionDetailsSource = "pipeline" + PublicApi StateTransitionDetailsSource = "public-api" +) + +// Valid indicates whether the value is a known member of the StateTransitionDetailsSource enum. +func (e StateTransitionDetailsSource) Valid() bool { + switch e { + case Pipeline: + return true + case PublicApi: + return true + default: + return false + } +} + // Defines values for StatusCodeAssertionOperator. const ( StatusCodeAssertionOperatorContains StatusCodeAssertionOperator = "contains" @@ -3932,10 +4007,8 @@ type AuditEventDto struct { CreatedAt time.Time `json:"createdAt"` // Id Unique audit event identifier - Id int64 `json:"id"` - - // Metadata Additional context about the action - Metadata *map[string]*map[string]interface{} `json:"metadata,omitempty"` + Id int64 `json:"id"` + Metadata *AuditMetadata `json:"metadata,omitempty"` // ResourceId ID of the affected resource ResourceId *string `json:"resourceId,omitempty"` @@ -3947,6 +4020,11 @@ type AuditEventDto struct { ResourceType *string `json:"resourceType,omitempty"` } +// AuditMetadata Typed metadata payload attached to an audit event; null for actions that carry no extra context. +type AuditMetadata struct { + union json.RawMessage +} + // AuthMeResponse Identity, organization, plan, and rate-limit info for the authenticated API key type AuthMeResponse struct { // Key API key metadata @@ -4126,6 +4204,19 @@ type CheckResultDto struct { Timestamp time.Time `json:"timestamp"` } +// CheckTraceDto defines model for CheckTraceDto. +type CheckTraceDto struct { + // CheckId The check execution ID this trace is keyed by + CheckId openapi_types.UUID `json:"checkId"` + + // Evaluations All rule evaluations that ran for this check + Evaluations []RuleEvaluationDto `json:"evaluations"` + PolicySnapshot *PolicySnapshotDto `json:"policySnapshot,omitempty"` + + // Transitions State-machine transitions this check caused (may be empty if nothing fired) + Transitions []IncidentStateTransitionDto `json:"transitions"` +} + // CheckTypeDetailsDto Check-type-specific details — polymorphic by check_type discriminator type CheckTypeDetailsDto struct { union json.RawMessage @@ -5352,6 +5443,9 @@ type IncidentDto struct { // CreatedByUserId User who created the incident (manual incidents only) CreatedByUserId *int32 `json:"createdByUserId,omitempty"` + // EngineVersion Detection engine semver that evaluated the rule. Omitted from JSON when null, treat missing as null. + EngineVersion *string `json:"engineVersion,omitempty"` + // ExternalRef External reference ID (e.g. PagerDuty incident ID) ExternalRef *string `json:"externalRef,omitempty"` @@ -5421,6 +5515,15 @@ type IncidentDto struct { // TriggeredByRule Human-readable description of the trigger rule that fired TriggeredByRule *string `json:"triggeredByRule,omitempty"` + // TriggeredByRuleIndex Index of the fired rule inside the policy's trigger_rules array. Omitted from JSON when null, treat missing as null. + TriggeredByRuleIndex *int32 `json:"triggeredByRuleIndex,omitempty"` + + // TriggeredByRuleSnapshotHashHex Hex SHA-256 of the canonical policy snapshot that fired; combined with triggeredByRuleIndex points to the exact TriggerRule. Omitted from JSON when null, treat missing as null. + TriggeredByRuleSnapshotHashHex *string `json:"triggeredByRuleSnapshotHashHex,omitempty"` + + // TriggeringCheckId Scheduler-minted check execution ID whose result confirmed this incident; joins to check_results, rule_evaluations, and incident_state_transitions. Omitted from JSON (undefined to SDKs) when null, treat missing as null. + TriggeringCheckId *openapi_types.UUID `json:"triggeringCheckId,omitempty"` + // UpdatedAt Timestamp when the incident was last updated UpdatedAt time.Time `json:"updatedAt"` } @@ -5527,6 +5630,59 @@ type IncidentRef struct { Title string `json:"title"` } +// IncidentStateTransitionDto State-machine transitions this check caused (may be empty if nothing fired) +type IncidentStateTransitionDto struct { + // AffectedRegions Regions whose evaluations contributed to this transition + AffectedRegions []string `json:"affectedRegions"` + + // CheckId Scheduler-minted check execution ID (V92) of the triggering result + CheckId openapi_types.UUID `json:"checkId"` + + // Details Typed metadata about this transition (currently: actor source) + Details StateTransitionDetails `json:"details"` + + // EngineVersion Detection engine version that emitted this transition + EngineVersion string `json:"engineVersion"` + + // FromStatus Previous status (WATCHING | TRIGGERED | CONFIRMED | RESOLVED) + FromStatus string `json:"fromStatus"` + + // Id Forensic row UUID + Id openapi_types.UUID `json:"id"` + + // IncidentId Incident this transition belongs to; null for pre-incident (auto-cleared) transitions + IncidentId *openapi_types.UUID `json:"incidentId,omitempty"` + + // MonitorId Monitor this transition pertains to + MonitorId openapi_types.UUID `json:"monitorId"` + + // OccurredAt When the state transition occurred + OccurredAt time.Time `json:"occurredAt"` + + // PolicySnapshotHashHex Hex-encoded hash of the policy snapshot that governed this transition + PolicySnapshotHashHex string `json:"policySnapshotHashHex"` + + // Reason Why the transition fired (trigger | confirm | resolve | auto_clear | reopen) + Reason string `json:"reason"` + + // ToStatus New status (WATCHING | TRIGGERED | CONFIRMED | RESOLVED) + ToStatus string `json:"toStatus"` + + // TriggeringEvaluationIds rule_evaluation ids that caused this transition (may be empty for timeout-driven edges) + TriggeringEvaluationIds []openapi_types.UUID `json:"triggeringEvaluationIds"` +} + +// IncidentTimelineDto defines model for IncidentTimelineDto. +type IncidentTimelineDto struct { + PolicySnapshot *PolicySnapshotDto `json:"policySnapshot,omitempty"` + + // Transitions State-machine transitions in chronological order + Transitions []IncidentStateTransitionDto `json:"transitions"` + + // TriggeringEvaluations Rule evaluations that caused any of the transitions above. Correlate via evaluation.triggeringTransitionId == transition.id + TriggeringEvaluations []RuleEvaluationDto `json:"triggeringEvaluations"` +} + // IncidentUpdateDto defines model for IncidentUpdateDto. type IncidentUpdateDto struct { Body *string `json:"body,omitempty"` @@ -5893,6 +6049,26 @@ type MemberDtoOrgRole string // MemberDtoStatus Membership status (ACTIVE, PENDING, SUSPENDED) type MemberDtoStatus string +// MemberRoleChangedMetadata Role transition recorded when an organization member's role changes. +type MemberRoleChangedMetadata struct { + Kind MemberRoleChangedMetadataKind `json:"kind"` + + // NewRole Role the member holds after the change + NewRole MemberRoleChangedMetadataNewRole `json:"newRole"` + + // OldRole Role the member held before the change + OldRole MemberRoleChangedMetadataOldRole `json:"oldRole"` +} + +// MemberRoleChangedMetadataKind defines model for MemberRoleChangedMetadata.Kind. +type MemberRoleChangedMetadataKind string + +// MemberRoleChangedMetadataNewRole Role the member holds after the change +type MemberRoleChangedMetadataNewRole string + +// MemberRoleChangedMetadataOldRole Role the member held before the change +type MemberRoleChangedMetadataOldRole string + // MonitorAssertionDto defines model for MonitorAssertionDto. type MonitorAssertionDto struct { AssertionType MonitorAssertionDtoAssertionType `json:"assertionType"` @@ -6305,6 +6481,24 @@ type PlanInfo struct { // PlanInfoTier Resolved plan tier type PlanInfoTier string +// PolicySnapshotDto Policy snapshot used during this check (all evaluations of a single check are against one policy) +type PolicySnapshotDto struct { + // EngineVersion Detection engine version that observed this policy + EngineVersion string `json:"engineVersion"` + + // FirstSeenAt First time the detection engine evaluated against this policy bytes + FirstSeenAt time.Time `json:"firstSeenAt"` + + // HashHex Hex-encoded SHA-256 of the canonical policy JSON + HashHex string `json:"hashHex"` + + // LastSeenAt Most recent time the engine evaluated against this policy bytes + LastSeenAt time.Time `json:"lastSeenAt"` + + // Policy Canonical policy document (snake_case, sorted keys) + Policy map[string]map[string]interface{} `json:"policy"` +} + // PollChartBucketDto Aggregated poll metrics for a time bucket type PollChartBucketDto struct { // AvgResponseTimeMs Average response time in milliseconds for this bucket @@ -6667,6 +6861,51 @@ type RetryStrategy struct { Type string `json:"type"` } +// RuleEvaluationDto All rule evaluations that ran for this check +type RuleEvaluationDto struct { + // CheckId Scheduler-minted check execution ID (V92) — the causal chain identifier + CheckId openapi_types.UUID `json:"checkId"` + + // EngineVersion Detection engine version that ran this evaluation + EngineVersion string `json:"engineVersion"` + + // EvaluationDetails Structured details (e.g. failure counts, response-time aggregates) + EvaluationDetails map[string]map[string]interface{} `json:"evaluationDetails"` + + // Id Forensic row UUID + Id openapi_types.UUID `json:"id"` + + // InputResultIds check_results IDs that were inputs to this evaluation (newest first) + InputResultIds []openapi_types.UUID `json:"inputResultIds"` + + // MonitorId Monitor that produced the input check result + MonitorId openapi_types.UUID `json:"monitorId"` + + // OccurredAt When the evaluation ran + OccurredAt time.Time `json:"occurredAt"` + + // OutputMatched Whether the rule fired on this evaluation + OutputMatched bool `json:"outputMatched"` + + // PolicySnapshotHashHex Hex-encoded hash of the policy snapshot this rule came from + PolicySnapshotHashHex string `json:"policySnapshotHashHex"` + + // Region Probe region of the input check result + Region string `json:"region"` + + // RuleIndex Index into the policy's triggerRules array (0-based) + RuleIndex int32 `json:"ruleIndex"` + + // RuleScope Rule scope (per_region | multi_region) + RuleScope string `json:"ruleScope"` + + // RuleType Rule type (e.g. consecutive_failures, failures_in_window) + RuleType string `json:"ruleType"` + + // TriggeringTransitionId If this evaluation caused a state transition, points to that transition's id + TriggeringTransitionId *openapi_types.UUID `json:"triggeringTransitionId,omitempty"` +} + // ScheduledMaintenanceDto A scheduled maintenance window from a vendor status page type ScheduledMaintenanceDto struct { // AffectedComponents Components affected by this maintenance @@ -7088,6 +7327,11 @@ type SingleValueResponseBulkMonitorActionResult struct { Data BulkMonitorActionResult `json:"data"` } +// SingleValueResponseCheckTraceDto defines model for SingleValueResponseCheckTraceDto. +type SingleValueResponseCheckTraceDto struct { + Data CheckTraceDto `json:"data"` +} + // SingleValueResponseDashboardOverviewDto defines model for SingleValueResponseDashboardOverviewDto. type SingleValueResponseDashboardOverviewDto struct { // Data Combined dashboard overview for monitors and incidents @@ -7129,6 +7373,11 @@ type SingleValueResponseIncidentPolicyDto struct { Data IncidentPolicyDto `json:"data"` } +// SingleValueResponseIncidentTimelineDto defines model for SingleValueResponseIncidentTimelineDto. +type SingleValueResponseIncidentTimelineDto struct { + Data IncidentTimelineDto `json:"data"` +} + // SingleValueResponseInviteDto defines model for SingleValueResponseInviteDto. type SingleValueResponseInviteDto struct { // Data Organization invite sent to an email address @@ -7196,6 +7445,12 @@ type SingleValueResponseOrganizationDto struct { Data OrganizationDto `json:"data"` } +// SingleValueResponsePolicySnapshotDto defines model for SingleValueResponsePolicySnapshotDto. +type SingleValueResponsePolicySnapshotDto struct { + // Data Policy snapshot used during this check (all evaluations of a single check are against one policy) + Data *PolicySnapshotDto `json:"data"` +} + // SingleValueResponseResourceGroupDto defines model for SingleValueResponseResourceGroupDto. type SingleValueResponseResourceGroupDto struct { // Data Resource group with health summary and optional member details @@ -7369,6 +7624,15 @@ type SslExpiryAssertion struct { // SslExpiryAssertionType defines model for SslExpiryAssertion.Type. type SslExpiryAssertionType string +// StateTransitionDetails Typed metadata about this transition (currently: actor source) +type StateTransitionDetails struct { + // Source Actor that produced this transition (pipeline | public-api) + Source StateTransitionDetailsSource `json:"source"` +} + +// StateTransitionDetailsSource Actor that produced this transition (pipeline | public-api) +type StateTransitionDetailsSource string + // StatusCodeAssertion defines model for StatusCodeAssertion. type StatusCodeAssertion struct { // Expected Expected status code, range pattern, or wildcard such as 2xx @@ -7673,6 +7937,15 @@ type TableValueResultIncidentDto struct { TotalPages *int32 `json:"totalPages,omitempty"` } +// TableValueResultIncidentStateTransitionDto defines model for TableValueResultIncidentStateTransitionDto. +type TableValueResultIncidentStateTransitionDto struct { + Data []IncidentStateTransitionDto `json:"data"` + HasNext bool `json:"hasNext"` + HasPrev bool `json:"hasPrev"` + TotalElements *int64 `json:"totalElements,omitempty"` + TotalPages *int32 `json:"totalPages,omitempty"` +} + // TableValueResultIntegrationDto defines model for TableValueResultIntegrationDto. type TableValueResultIntegrationDto struct { Data []IntegrationDto `json:"data"` @@ -7763,6 +8036,15 @@ type TableValueResultResourceGroupDto struct { TotalPages *int32 `json:"totalPages,omitempty"` } +// TableValueResultRuleEvaluationDto defines model for TableValueResultRuleEvaluationDto. +type TableValueResultRuleEvaluationDto struct { + Data []RuleEvaluationDto `json:"data"` + HasNext bool `json:"hasNext"` + HasPrev bool `json:"hasPrev"` + TotalElements *int64 `json:"totalElements,omitempty"` + TotalPages *int32 `json:"totalPages,omitempty"` +} + // TableValueResultScheduledMaintenanceDto defines model for TableValueResultScheduledMaintenanceDto. type TableValueResultScheduledMaintenanceDto struct { Data []ScheduledMaintenanceDto `json:"data"` @@ -8655,6 +8937,23 @@ type List19Params struct { Size *int32 `form:"size,omitempty" json:"size,omitempty"` } +// ListMonitorRuleEvaluationsParams defines parameters for ListMonitorRuleEvaluations. +type ListMonitorRuleEvaluationsParams struct { + RuleType *string `form:"ruleType,omitempty" json:"ruleType,omitempty"` + Region *string `form:"region,omitempty" json:"region,omitempty"` + OnlyMatched *bool `form:"onlyMatched,omitempty" json:"onlyMatched,omitempty"` + From *time.Time `form:"from,omitempty" json:"from,omitempty"` + To *time.Time `form:"to,omitempty" json:"to,omitempty"` + Pageable Pageable `form:"pageable" json:"pageable"` +} + +// ListMonitorTransitionsParams defines parameters for ListMonitorTransitions. +type ListMonitorTransitionsParams struct { + From *time.Time `form:"from,omitempty" json:"from,omitempty"` + To *time.Time `form:"to,omitempty" json:"to,omitempty"` + Pageable Pageable `form:"pageable" json:"pageable"` +} + // PingPostJSONBody defines parameters for PingPost. type PingPostJSONBody = string @@ -9123,6 +9422,65 @@ type Create2JSONRequestBody = CreateWorkspaceRequest // UpdateJSONRequestBody defines body for Update for application/json ContentType. type UpdateJSONRequestBody = UpdateWorkspaceRequest +// AsMemberRoleChangedMetadata returns the union data inside the AuditMetadata as a MemberRoleChangedMetadata +func (t AuditMetadata) AsMemberRoleChangedMetadata() (MemberRoleChangedMetadata, error) { + var body MemberRoleChangedMetadata + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromMemberRoleChangedMetadata overwrites any union data inside the AuditMetadata as the provided MemberRoleChangedMetadata +func (t *AuditMetadata) FromMemberRoleChangedMetadata(v MemberRoleChangedMetadata) error { + v.Kind = "member_role_changed" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeMemberRoleChangedMetadata performs a merge with any union data inside the AuditMetadata, using the provided MemberRoleChangedMetadata +func (t *AuditMetadata) MergeMemberRoleChangedMetadata(v MemberRoleChangedMetadata) error { + v.Kind = "member_role_changed" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t AuditMetadata) Discriminator() (string, error) { + var discriminator struct { + Discriminator string `json:"kind"` + } + err := json.Unmarshal(t.union, &discriminator) + return discriminator.Discriminator, err +} + +func (t AuditMetadata) ValueByDiscriminator() (interface{}, error) { + discriminator, err := t.Discriminator() + if err != nil { + return nil, err + } + switch discriminator { + case "member_role_changed": + return t.AsMemberRoleChangedMetadata() + default: + return nil, errors.New("unknown discriminator value: " + discriminator) + } +} + +func (t AuditMetadata) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AuditMetadata) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + // AsHttp returns the union data inside the CheckTypeDetailsDto as a Http func (t CheckTypeDetailsDto) AsHttp() (Http, error) { var body Http