From a639c588af56ec0de408d076f4382bfea58fd607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0v=C3=A1b=C3=ADk?= Date: Fri, 6 Nov 2026 14:36:48 +0100 Subject: [PATCH 1/7] chore(monitor): refresh the client for maintenance windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the maintenance window endpoints and the fields other responses gain from them, and the summary of each status page in the page list. Billing's spec has drifted on the backend too, unrelated to this; it is left out. Signed-off-by: Jan Švábík --- internal/api/monitor/monitor.gen.go | 5403 +++++++++++++++++--------- specs/monitor.openapi.json | 5515 +++++++++++++++++---------- 2 files changed, 7190 insertions(+), 3728 deletions(-) diff --git a/internal/api/monitor/monitor.gen.go b/internal/api/monitor/monitor.gen.go index 963eb47..9ae9161 100644 --- a/internal/api/monitor/monitor.gen.go +++ b/internal/api/monitor/monitor.gen.go @@ -34,6 +34,7 @@ const ( ErrorCodeTooManyRequests ConstantsErrorCode = "TOO_MANY_REQUESTS" ErrorCodeUnauthorized ConstantsErrorCode = "UNAUTHORIZED" ErrorCodeUnavailable ConstantsErrorCode = "UNAVAILABLE" + ErrorCodeUnprocessable ConstantsErrorCode = "UNPROCESSABLE" ErrorCodeValidationFailed ConstantsErrorCode = "VALIDATION_FAILED" ) @@ -68,6 +69,8 @@ func (e ConstantsErrorCode) Valid() bool { return true case ErrorCodeUnavailable: return true + case ErrorCodeUnprocessable: + return true case ErrorCodeValidationFailed: return true default: @@ -77,27 +80,30 @@ func (e ConstantsErrorCode) Valid() bool { // Defines values for ConstantsErrorReason. const ( - ErrorReasonAlertChannelLimit ConstantsErrorReason = "ALERT_CHANNEL_LIMIT" - ErrorReasonAlreadyVerified ConstantsErrorReason = "ALREADY_VERIFIED" - ErrorReasonCallerOutsideNamespace ConstantsErrorReason = "CALLER_OUTSIDE_NAMESPACE" - ErrorReasonChannelTypeUnavailable ConstantsErrorReason = "CHANNEL_TYPE_UNAVAILABLE" - ErrorReasonCodeExpired ConstantsErrorReason = "CODE_EXPIRED" - ErrorReasonCodeRecentlySent ConstantsErrorReason = "CODE_RECENTLY_SENT" - ErrorReasonContactUnverified ConstantsErrorReason = "CONTACT_UNVERIFIED" - ErrorReasonDeliveryRejected ConstantsErrorReason = "DELIVERY_REJECTED" - ErrorReasonDomainNotSet ConstantsErrorReason = "DOMAIN_NOT_SET" - ErrorReasonDomainTaken ConstantsErrorReason = "DOMAIN_TAKEN" - ErrorReasonDomainsDisabled ConstantsErrorReason = "DOMAINS_DISABLED" - ErrorReasonIncidentResolved ConstantsErrorReason = "INCIDENT_RESOLVED" - ErrorReasonInsufficientScope ConstantsErrorReason = "INSUFFICIENT_SCOPE" - ErrorReasonMissingOrganizationID ConstantsErrorReason = "MISSING_ORGANIZATION_ID" - ErrorReasonMonitorLimit ConstantsErrorReason = "MONITOR_LIMIT" - ErrorReasonNothingToVerify ConstantsErrorReason = "NOTHING_TO_VERIFY" - ErrorReasonSlugTaken ConstantsErrorReason = "SLUG_TAKEN" - ErrorReasonStatusPageDomainLimit ConstantsErrorReason = "STATUS_PAGE_DOMAIN_LIMIT" - ErrorReasonStatusPageLimit ConstantsErrorReason = "STATUS_PAGE_LIMIT" - ErrorReasonTooManyAttempts ConstantsErrorReason = "TOO_MANY_ATTEMPTS" - ErrorReasonUnverifiedChannelLimit ConstantsErrorReason = "UNVERIFIED_CHANNEL_LIMIT" + ErrorReasonAlertChannelLimit ConstantsErrorReason = "ALERT_CHANNEL_LIMIT" + ErrorReasonAlreadyVerified ConstantsErrorReason = "ALREADY_VERIFIED" + ErrorReasonCallerOutsideNamespace ConstantsErrorReason = "CALLER_OUTSIDE_NAMESPACE" + ErrorReasonChannelTypeUnavailable ConstantsErrorReason = "CHANNEL_TYPE_UNAVAILABLE" + ErrorReasonCodeExpired ConstantsErrorReason = "CODE_EXPIRED" + ErrorReasonCodeRecentlySent ConstantsErrorReason = "CODE_RECENTLY_SENT" + ErrorReasonContactUnverified ConstantsErrorReason = "CONTACT_UNVERIFIED" + ErrorReasonDeliveryRejected ConstantsErrorReason = "DELIVERY_REJECTED" + ErrorReasonDomainNotSet ConstantsErrorReason = "DOMAIN_NOT_SET" + ErrorReasonDomainTaken ConstantsErrorReason = "DOMAIN_TAKEN" + ErrorReasonDomainsDisabled ConstantsErrorReason = "DOMAINS_DISABLED" + ErrorReasonIncidentResolved ConstantsErrorReason = "INCIDENT_RESOLVED" + ErrorReasonInsufficientScope ConstantsErrorReason = "INSUFFICIENT_SCOPE" + ErrorReasonMaintenancePublishDenied ConstantsErrorReason = "MAINTENANCE_PUBLISH_DENIED" + ErrorReasonMaintenanceWindowLimit ConstantsErrorReason = "MAINTENANCE_WINDOW_LIMIT" + ErrorReasonMaintenanceWindowState ConstantsErrorReason = "MAINTENANCE_WINDOW_STATE" + ErrorReasonMissingOrganizationID ConstantsErrorReason = "MISSING_ORGANIZATION_ID" + ErrorReasonMonitorLimit ConstantsErrorReason = "MONITOR_LIMIT" + ErrorReasonNothingToVerify ConstantsErrorReason = "NOTHING_TO_VERIFY" + ErrorReasonSlugTaken ConstantsErrorReason = "SLUG_TAKEN" + ErrorReasonStatusPageDomainLimit ConstantsErrorReason = "STATUS_PAGE_DOMAIN_LIMIT" + ErrorReasonStatusPageLimit ConstantsErrorReason = "STATUS_PAGE_LIMIT" + ErrorReasonTooManyAttempts ConstantsErrorReason = "TOO_MANY_ATTEMPTS" + ErrorReasonUnverifiedChannelLimit ConstantsErrorReason = "UNVERIFIED_CHANNEL_LIMIT" ) // Valid indicates whether the value is a known member of the ConstantsErrorReason enum. @@ -129,6 +135,12 @@ func (e ConstantsErrorReason) Valid() bool { return true case ErrorReasonInsufficientScope: return true + case ErrorReasonMaintenancePublishDenied: + return true + case ErrorReasonMaintenanceWindowLimit: + return true + case ErrorReasonMaintenanceWindowState: + return true case ErrorReasonMissingOrganizationID: return true case ErrorReasonMonitorLimit: @@ -719,14 +731,15 @@ func (e DtoIncidentDetailStatus) Valid() bool { // Defines values for DtoIncidentEventType. const ( - DtoIncidentEventTypeAcknowledged DtoIncidentEventType = "acknowledged" - DtoIncidentEventTypeDeescalated DtoIncidentEventType = "deescalated" - DtoIncidentEventTypeDeliveryFailed DtoIncidentEventType = "delivery_failed" - DtoIncidentEventTypeEscalated DtoIncidentEventType = "escalated" - DtoIncidentEventTypeOpened DtoIncidentEventType = "opened" - DtoIncidentEventTypeReminder DtoIncidentEventType = "reminder" - DtoIncidentEventTypeResolved DtoIncidentEventType = "resolved" - DtoIncidentEventTypeThreshold DtoIncidentEventType = "threshold" + DtoIncidentEventTypeAcknowledged DtoIncidentEventType = "acknowledged" + DtoIncidentEventTypeDeescalated DtoIncidentEventType = "deescalated" + DtoIncidentEventTypeDeliveryFailed DtoIncidentEventType = "delivery_failed" + DtoIncidentEventTypeEscalated DtoIncidentEventType = "escalated" + DtoIncidentEventTypeMaintenanceHold DtoIncidentEventType = "maintenance_hold" + DtoIncidentEventTypeOpened DtoIncidentEventType = "opened" + DtoIncidentEventTypeReminder DtoIncidentEventType = "reminder" + DtoIncidentEventTypeResolved DtoIncidentEventType = "resolved" + DtoIncidentEventTypeThreshold DtoIncidentEventType = "threshold" ) // Valid indicates whether the value is a known member of the DtoIncidentEventType enum. @@ -740,6 +753,8 @@ func (e DtoIncidentEventType) Valid() bool { return true case DtoIncidentEventTypeEscalated: return true + case DtoIncidentEventTypeMaintenanceHold: + return true case DtoIncidentEventTypeOpened: return true case DtoIncidentEventTypeReminder: @@ -777,6 +792,48 @@ func (e DtoLastCheckSeverity) Valid() bool { } } +// Defines values for DtoMaintenanceTargetMonitorType. +const ( + DtoMaintenanceTargetMonitorTypeHttp DtoMaintenanceTargetMonitorType = "http" + DtoMaintenanceTargetMonitorTypeSsl DtoMaintenanceTargetMonitorType = "ssl" +) + +// Valid indicates whether the value is a known member of the DtoMaintenanceTargetMonitorType enum. +func (e DtoMaintenanceTargetMonitorType) Valid() bool { + switch e { + case DtoMaintenanceTargetMonitorTypeHttp: + return true + case DtoMaintenanceTargetMonitorTypeSsl: + return true + default: + return false + } +} + +// Defines values for DtoMaintenanceWindowState. +const ( + DtoMaintenanceWindowStateCancelled DtoMaintenanceWindowState = "cancelled" + DtoMaintenanceWindowStateCompleted DtoMaintenanceWindowState = "completed" + DtoMaintenanceWindowStateInProgress DtoMaintenanceWindowState = "in_progress" + DtoMaintenanceWindowStateScheduled DtoMaintenanceWindowState = "scheduled" +) + +// Valid indicates whether the value is a known member of the DtoMaintenanceWindowState enum. +func (e DtoMaintenanceWindowState) Valid() bool { + switch e { + case DtoMaintenanceWindowStateCancelled: + return true + case DtoMaintenanceWindowStateCompleted: + return true + case DtoMaintenanceWindowStateInProgress: + return true + case DtoMaintenanceWindowStateScheduled: + return true + default: + return false + } +} + // Defines values for DtoMonitorOverallStatus. const ( DtoMonitorOverallStatusCritical DtoMonitorOverallStatus = "critical" @@ -1143,6 +1200,7 @@ const ( DtoPublicStatusComponentStatusMajorOutage DtoPublicStatusComponentStatus = "major_outage" DtoPublicStatusComponentStatusOperational DtoPublicStatusComponentStatus = "operational" DtoPublicStatusComponentStatusPartialOutage DtoPublicStatusComponentStatus = "partial_outage" + DtoPublicStatusComponentStatusUnderMaintenance DtoPublicStatusComponentStatus = "under_maintenance" DtoPublicStatusComponentStatusUnknown DtoPublicStatusComponentStatus = "unknown" ) @@ -1157,6 +1215,8 @@ func (e DtoPublicStatusComponentStatus) Valid() bool { return true case DtoPublicStatusComponentStatusPartialOutage: return true + case DtoPublicStatusComponentStatusUnderMaintenance: + return true case DtoPublicStatusComponentStatusUnknown: return true default: @@ -1166,18 +1226,21 @@ func (e DtoPublicStatusComponentStatus) Valid() bool { // Defines values for DtoPublicStatusDayGrade. const ( - DtoPublicStatusDayGradeMajor DtoPublicStatusDayGrade = "major" - DtoPublicStatusDayGradeMinor DtoPublicStatusDayGrade = "minor" - DtoPublicStatusDayGradeNoData DtoPublicStatusDayGrade = "no_data" - DtoPublicStatusDayGradeOk DtoPublicStatusDayGrade = "ok" - DtoPublicStatusDayGradePartial DtoPublicStatusDayGrade = "partial" - DtoPublicStatusDayGradeUnknown DtoPublicStatusDayGrade = "unknown" - DtoPublicStatusDayGradeWarning DtoPublicStatusDayGrade = "warning" + DtoPublicStatusDayGradeMaintenance DtoPublicStatusDayGrade = "maintenance" + DtoPublicStatusDayGradeMajor DtoPublicStatusDayGrade = "major" + DtoPublicStatusDayGradeMinor DtoPublicStatusDayGrade = "minor" + DtoPublicStatusDayGradeNoData DtoPublicStatusDayGrade = "no_data" + DtoPublicStatusDayGradeOk DtoPublicStatusDayGrade = "ok" + DtoPublicStatusDayGradePartial DtoPublicStatusDayGrade = "partial" + DtoPublicStatusDayGradeUnknown DtoPublicStatusDayGrade = "unknown" + DtoPublicStatusDayGradeWarning DtoPublicStatusDayGrade = "warning" ) // Valid indicates whether the value is a known member of the DtoPublicStatusDayGrade enum. func (e DtoPublicStatusDayGrade) Valid() bool { switch e { + case DtoPublicStatusDayGradeMaintenance: + return true case DtoPublicStatusDayGradeMajor: return true case DtoPublicStatusDayGradeMinor: @@ -1203,6 +1266,7 @@ const ( DtoPublicStatusGroupStatusMajorOutage DtoPublicStatusGroupStatus = "major_outage" DtoPublicStatusGroupStatusOperational DtoPublicStatusGroupStatus = "operational" DtoPublicStatusGroupStatusPartialOutage DtoPublicStatusGroupStatus = "partial_outage" + DtoPublicStatusGroupStatusUnderMaintenance DtoPublicStatusGroupStatus = "under_maintenance" DtoPublicStatusGroupStatusUnknown DtoPublicStatusGroupStatus = "unknown" ) @@ -1217,6 +1281,8 @@ func (e DtoPublicStatusGroupStatus) Valid() bool { return true case DtoPublicStatusGroupStatusPartialOutage: return true + case DtoPublicStatusGroupStatusUnderMaintenance: + return true case DtoPublicStatusGroupStatusUnknown: return true default: @@ -1287,12 +1353,37 @@ func (e DtoPublicStatusIncidentStatus) Valid() bool { } } +// Defines values for DtoPublicStatusMaintenanceStatus. +const ( + DtoPublicStatusMaintenanceStatusCancelled DtoPublicStatusMaintenanceStatus = "cancelled" + DtoPublicStatusMaintenanceStatusCompleted DtoPublicStatusMaintenanceStatus = "completed" + DtoPublicStatusMaintenanceStatusInProgress DtoPublicStatusMaintenanceStatus = "in_progress" + DtoPublicStatusMaintenanceStatusScheduled DtoPublicStatusMaintenanceStatus = "scheduled" +) + +// Valid indicates whether the value is a known member of the DtoPublicStatusMaintenanceStatus enum. +func (e DtoPublicStatusMaintenanceStatus) Valid() bool { + switch e { + case DtoPublicStatusMaintenanceStatusCancelled: + return true + case DtoPublicStatusMaintenanceStatusCompleted: + return true + case DtoPublicStatusMaintenanceStatusInProgress: + return true + case DtoPublicStatusMaintenanceStatusScheduled: + return true + default: + return false + } +} + // Defines values for DtoPublicStatusPageIndicator. const ( - DtoPublicStatusPageIndicatorCritical DtoPublicStatusPageIndicator = "critical" - DtoPublicStatusPageIndicatorMajor DtoPublicStatusPageIndicator = "major" - DtoPublicStatusPageIndicatorMinor DtoPublicStatusPageIndicator = "minor" - DtoPublicStatusPageIndicatorNone DtoPublicStatusPageIndicator = "none" + DtoPublicStatusPageIndicatorCritical DtoPublicStatusPageIndicator = "critical" + DtoPublicStatusPageIndicatorMaintenance DtoPublicStatusPageIndicator = "maintenance" + DtoPublicStatusPageIndicatorMajor DtoPublicStatusPageIndicator = "major" + DtoPublicStatusPageIndicatorMinor DtoPublicStatusPageIndicator = "minor" + DtoPublicStatusPageIndicatorNone DtoPublicStatusPageIndicator = "none" ) // Valid indicates whether the value is a known member of the DtoPublicStatusPageIndicator enum. @@ -1300,6 +1391,8 @@ func (e DtoPublicStatusPageIndicator) Valid() bool { switch e { case DtoPublicStatusPageIndicatorCritical: return true + case DtoPublicStatusPageIndicatorMaintenance: + return true case DtoPublicStatusPageIndicatorMajor: return true case DtoPublicStatusPageIndicatorMinor: @@ -1466,22 +1559,22 @@ func (e DtoStatusPageComponentKind) Valid() bool { // Defines values for DtoStatusPageComponentManualStatus. const ( - DegradedPerformance DtoStatusPageComponentManualStatus = "degraded_performance" - MajorOutage DtoStatusPageComponentManualStatus = "major_outage" - Operational DtoStatusPageComponentManualStatus = "operational" - PartialOutage DtoStatusPageComponentManualStatus = "partial_outage" + DtoStatusPageComponentManualStatusDegradedPerformance DtoStatusPageComponentManualStatus = "degraded_performance" + DtoStatusPageComponentManualStatusMajorOutage DtoStatusPageComponentManualStatus = "major_outage" + DtoStatusPageComponentManualStatusOperational DtoStatusPageComponentManualStatus = "operational" + DtoStatusPageComponentManualStatusPartialOutage DtoStatusPageComponentManualStatus = "partial_outage" ) // Valid indicates whether the value is a known member of the DtoStatusPageComponentManualStatus enum. func (e DtoStatusPageComponentManualStatus) Valid() bool { switch e { - case DegradedPerformance: + case DtoStatusPageComponentManualStatusDegradedPerformance: return true - case MajorOutage: + case DtoStatusPageComponentManualStatusMajorOutage: return true - case Operational: + case DtoStatusPageComponentManualStatusOperational: return true - case PartialOutage: + case DtoStatusPageComponentManualStatusPartialOutage: return true default: return false @@ -1490,13 +1583,13 @@ func (e DtoStatusPageComponentManualStatus) Valid() bool { // Defines values for DtoStatusPageDomainErrorCode. const ( - DOMAINTAKEN DtoStatusPageDomainErrorCode = "DOMAIN_TAKEN" + DtoStatusPageDomainErrorCodeDOMAINTAKEN DtoStatusPageDomainErrorCode = "DOMAIN_TAKEN" ) // Valid indicates whether the value is a known member of the DtoStatusPageDomainErrorCode enum. func (e DtoStatusPageDomainErrorCode) Valid() bool { switch e { - case DOMAINTAKEN: + case DtoStatusPageDomainErrorCodeDOMAINTAKEN: return true default: return false @@ -1505,25 +1598,25 @@ func (e DtoStatusPageDomainErrorCode) Valid() bool { // Defines values for DtoStatusPageDomainStatus. const ( - Active DtoStatusPageDomainStatus = "active" - Failed DtoStatusPageDomainStatus = "failed" - PendingCertificate DtoStatusPageDomainStatus = "pending_certificate" - PendingDns DtoStatusPageDomainStatus = "pending_dns" - PendingOwnership DtoStatusPageDomainStatus = "pending_ownership" + DtoStatusPageDomainStatusActive DtoStatusPageDomainStatus = "active" + DtoStatusPageDomainStatusFailed DtoStatusPageDomainStatus = "failed" + DtoStatusPageDomainStatusPendingCertificate DtoStatusPageDomainStatus = "pending_certificate" + DtoStatusPageDomainStatusPendingDns DtoStatusPageDomainStatus = "pending_dns" + DtoStatusPageDomainStatusPendingOwnership DtoStatusPageDomainStatus = "pending_ownership" ) // Valid indicates whether the value is a known member of the DtoStatusPageDomainStatus enum. func (e DtoStatusPageDomainStatus) Valid() bool { switch e { - case Active: + case DtoStatusPageDomainStatusActive: return true - case Failed: + case DtoStatusPageDomainStatusFailed: return true - case PendingCertificate: + case DtoStatusPageDomainStatusPendingCertificate: return true - case PendingDns: + case DtoStatusPageDomainStatusPendingDns: return true - case PendingOwnership: + case DtoStatusPageDomainStatusPendingOwnership: return true default: return false @@ -1548,6 +1641,171 @@ func (e DtoStatusPageDomainRecordType) Valid() bool { } } +// Defines values for DtoStatusPageGlanceIndicator. +const ( + DtoStatusPageGlanceIndicatorCritical DtoStatusPageGlanceIndicator = "critical" + DtoStatusPageGlanceIndicatorMaintenance DtoStatusPageGlanceIndicator = "maintenance" + DtoStatusPageGlanceIndicatorMajor DtoStatusPageGlanceIndicator = "major" + DtoStatusPageGlanceIndicatorMinor DtoStatusPageGlanceIndicator = "minor" + DtoStatusPageGlanceIndicatorNone DtoStatusPageGlanceIndicator = "none" +) + +// Valid indicates whether the value is a known member of the DtoStatusPageGlanceIndicator enum. +func (e DtoStatusPageGlanceIndicator) Valid() bool { + switch e { + case DtoStatusPageGlanceIndicatorCritical: + return true + case DtoStatusPageGlanceIndicatorMaintenance: + return true + case DtoStatusPageGlanceIndicatorMajor: + return true + case DtoStatusPageGlanceIndicatorMinor: + return true + case DtoStatusPageGlanceIndicatorNone: + return true + default: + return false + } +} + +// Defines values for DtoStatusPageGlanceComponentStatus. +const ( + DtoStatusPageGlanceComponentStatusDegradedPerformance DtoStatusPageGlanceComponentStatus = "degraded_performance" + DtoStatusPageGlanceComponentStatusMajorOutage DtoStatusPageGlanceComponentStatus = "major_outage" + DtoStatusPageGlanceComponentStatusOperational DtoStatusPageGlanceComponentStatus = "operational" + DtoStatusPageGlanceComponentStatusPartialOutage DtoStatusPageGlanceComponentStatus = "partial_outage" + DtoStatusPageGlanceComponentStatusUnderMaintenance DtoStatusPageGlanceComponentStatus = "under_maintenance" + DtoStatusPageGlanceComponentStatusUnknown DtoStatusPageGlanceComponentStatus = "unknown" +) + +// Valid indicates whether the value is a known member of the DtoStatusPageGlanceComponentStatus enum. +func (e DtoStatusPageGlanceComponentStatus) Valid() bool { + switch e { + case DtoStatusPageGlanceComponentStatusDegradedPerformance: + return true + case DtoStatusPageGlanceComponentStatusMajorOutage: + return true + case DtoStatusPageGlanceComponentStatusOperational: + return true + case DtoStatusPageGlanceComponentStatusPartialOutage: + return true + case DtoStatusPageGlanceComponentStatusUnderMaintenance: + return true + case DtoStatusPageGlanceComponentStatusUnknown: + return true + default: + return false + } +} + +// Defines values for DtoStatusPageGlanceDomainErrorCode. +const ( + DtoStatusPageGlanceDomainErrorCodeDOMAINTAKEN DtoStatusPageGlanceDomainErrorCode = "DOMAIN_TAKEN" +) + +// Valid indicates whether the value is a known member of the DtoStatusPageGlanceDomainErrorCode enum. +func (e DtoStatusPageGlanceDomainErrorCode) Valid() bool { + switch e { + case DtoStatusPageGlanceDomainErrorCodeDOMAINTAKEN: + return true + default: + return false + } +} + +// Defines values for DtoStatusPageGlanceDomainStatus. +const ( + DtoStatusPageGlanceDomainStatusActive DtoStatusPageGlanceDomainStatus = "active" + DtoStatusPageGlanceDomainStatusFailed DtoStatusPageGlanceDomainStatus = "failed" + DtoStatusPageGlanceDomainStatusPendingCertificate DtoStatusPageGlanceDomainStatus = "pending_certificate" + DtoStatusPageGlanceDomainStatusPendingDns DtoStatusPageGlanceDomainStatus = "pending_dns" + DtoStatusPageGlanceDomainStatusPendingOwnership DtoStatusPageGlanceDomainStatus = "pending_ownership" +) + +// Valid indicates whether the value is a known member of the DtoStatusPageGlanceDomainStatus enum. +func (e DtoStatusPageGlanceDomainStatus) Valid() bool { + switch e { + case DtoStatusPageGlanceDomainStatusActive: + return true + case DtoStatusPageGlanceDomainStatusFailed: + return true + case DtoStatusPageGlanceDomainStatusPendingCertificate: + return true + case DtoStatusPageGlanceDomainStatusPendingDns: + return true + case DtoStatusPageGlanceDomainStatusPendingOwnership: + return true + default: + return false + } +} + +// Defines values for DtoStatusPageGlanceIncidentImpact. +const ( + DtoStatusPageGlanceIncidentImpactCritical DtoStatusPageGlanceIncidentImpact = "critical" + DtoStatusPageGlanceIncidentImpactMajor DtoStatusPageGlanceIncidentImpact = "major" + DtoStatusPageGlanceIncidentImpactMinor DtoStatusPageGlanceIncidentImpact = "minor" + DtoStatusPageGlanceIncidentImpactNone DtoStatusPageGlanceIncidentImpact = "none" +) + +// Valid indicates whether the value is a known member of the DtoStatusPageGlanceIncidentImpact enum. +func (e DtoStatusPageGlanceIncidentImpact) Valid() bool { + switch e { + case DtoStatusPageGlanceIncidentImpactCritical: + return true + case DtoStatusPageGlanceIncidentImpactMajor: + return true + case DtoStatusPageGlanceIncidentImpactMinor: + return true + case DtoStatusPageGlanceIncidentImpactNone: + return true + default: + return false + } +} + +// Defines values for DtoStatusPageGlanceIncidentStatus. +const ( + DtoStatusPageGlanceIncidentStatusIdentified DtoStatusPageGlanceIncidentStatus = "identified" + DtoStatusPageGlanceIncidentStatusInvestigating DtoStatusPageGlanceIncidentStatus = "investigating" + DtoStatusPageGlanceIncidentStatusMonitoring DtoStatusPageGlanceIncidentStatus = "monitoring" + DtoStatusPageGlanceIncidentStatusResolved DtoStatusPageGlanceIncidentStatus = "resolved" +) + +// Valid indicates whether the value is a known member of the DtoStatusPageGlanceIncidentStatus enum. +func (e DtoStatusPageGlanceIncidentStatus) Valid() bool { + switch e { + case DtoStatusPageGlanceIncidentStatusIdentified: + return true + case DtoStatusPageGlanceIncidentStatusInvestigating: + return true + case DtoStatusPageGlanceIncidentStatusMonitoring: + return true + case DtoStatusPageGlanceIncidentStatusResolved: + return true + default: + return false + } +} + +// Defines values for DtoStatusPageGlanceMaintenanceStatus. +const ( + DtoStatusPageGlanceMaintenanceStatusInProgress DtoStatusPageGlanceMaintenanceStatus = "in_progress" + DtoStatusPageGlanceMaintenanceStatusScheduled DtoStatusPageGlanceMaintenanceStatus = "scheduled" +) + +// Valid indicates whether the value is a known member of the DtoStatusPageGlanceMaintenanceStatus enum. +func (e DtoStatusPageGlanceMaintenanceStatus) Valid() bool { + switch e { + case DtoStatusPageGlanceMaintenanceStatusInProgress: + return true + case DtoStatusPageGlanceMaintenanceStatusScheduled: + return true + default: + return false + } +} + // Defines values for DtoStatusPageIncidentImpact. const ( DtoStatusPageIncidentImpactCritical DtoStatusPageIncidentImpact = "critical" @@ -2001,6 +2259,30 @@ func (e ListIncidentsParamsStatus) Valid() bool { } } +// Defines values for ListMaintenanceWindowsParamsStatus. +const ( + ListMaintenanceWindowsParamsStatusCancelled ListMaintenanceWindowsParamsStatus = "cancelled" + ListMaintenanceWindowsParamsStatusCompleted ListMaintenanceWindowsParamsStatus = "completed" + ListMaintenanceWindowsParamsStatusInProgress ListMaintenanceWindowsParamsStatus = "in_progress" + ListMaintenanceWindowsParamsStatusScheduled ListMaintenanceWindowsParamsStatus = "scheduled" +) + +// Valid indicates whether the value is a known member of the ListMaintenanceWindowsParamsStatus enum. +func (e ListMaintenanceWindowsParamsStatus) Valid() bool { + switch e { + case ListMaintenanceWindowsParamsStatusCancelled: + return true + case ListMaintenanceWindowsParamsStatusCompleted: + return true + case ListMaintenanceWindowsParamsStatusInProgress: + return true + case ListMaintenanceWindowsParamsStatusScheduled: + return true + default: + return false + } +} + // Defines values for ListMonitorsParamsInclude. const ( History ListMonitorsParamsInclude = "history" @@ -2072,19 +2354,19 @@ func (e ListMonitorsParamsStatus) Valid() bool { // Defines values for ListMonitorsParamsType. const ( - ListMonitorsParamsTypeDomain ListMonitorsParamsType = "domain" - ListMonitorsParamsTypeHttp ListMonitorsParamsType = "http" - ListMonitorsParamsTypeSsl ListMonitorsParamsType = "ssl" + Domain ListMonitorsParamsType = "domain" + Http ListMonitorsParamsType = "http" + Ssl ListMonitorsParamsType = "ssl" ) // Valid indicates whether the value is a known member of the ListMonitorsParamsType enum. func (e ListMonitorsParamsType) Valid() bool { switch e { - case ListMonitorsParamsTypeDomain: + case Domain: return true - case ListMonitorsParamsTypeHttp: + case Http: return true - case ListMonitorsParamsTypeSsl: + case Ssl: return true default: return false @@ -2117,16 +2399,16 @@ func (e GetMonitorStatsParamsRange) Valid() bool { // Defines values for ListStatusPageIncidentsParamsStatus. const ( - Open ListStatusPageIncidentsParamsStatus = "open" - Resolved ListStatusPageIncidentsParamsStatus = "resolved" + ListStatusPageIncidentsParamsStatusOpen ListStatusPageIncidentsParamsStatus = "open" + ListStatusPageIncidentsParamsStatusResolved ListStatusPageIncidentsParamsStatus = "resolved" ) // Valid indicates whether the value is a known member of the ListStatusPageIncidentsParamsStatus enum. func (e ListStatusPageIncidentsParamsStatus) Valid() bool { switch e { - case Open: + case ListStatusPageIncidentsParamsStatusOpen: return true - case Resolved: + case ListStatusPageIncidentsParamsStatusResolved: return true default: return false @@ -2248,8 +2530,16 @@ type DtoAvailability struct { DowntimeMinutes int `json:"downtimeMinutes"` From string `json:"from"` Inconclusive int `json:"inconclusive"` - Ok int `json:"ok"` - To string `json:"to"` + + // Maintenance Maintenance counts the checks inside a maintenance window, whatever they + // found. They are billed; the other counts cover only what ran outside. + Maintenance int `json:"maintenance"` + + // MaintenanceMinutes MaintenanceMinutes is how long maintenance windows held the monitor in + // these days, not counted as downtime. + MaintenanceMinutes int `json:"maintenanceMinutes"` + Ok int `json:"ok"` + To string `json:"to"` // UptimePercent UptimePercent is (ok + warning) / (ok + warning + critical); absent // without conclusive checks, and for SSL and domain monitors (no @@ -2391,11 +2681,19 @@ type DtoDayAvailability struct { // DowntimeMinutes DowntimeMinutes estimates the time spent down: the share of // critical checks among the conclusive ones times the minutes the - // day's checks cover. A warning is not downtime. + // day's checks cover outside maintenance. A warning is not downtime. DowntimeMinutes int `json:"downtimeMinutes"` Inconclusive int `json:"inconclusive"` - // NoData NoData: no checks that day (draw it gray, never as up). + // Maintenance Maintenance counts the checks inside a maintenance window, whatever they + // found. They are billed; the other counts cover only what ran outside. + Maintenance int `json:"maintenance"` + + // MaintenanceMinutes MaintenanceMinutes is how much of the day maintenance windows covered. + MaintenanceMinutes int `json:"maintenanceMinutes"` + + // NoData NoData: no checks that day, inside or outside maintenance (draw it + // gray, never as up). NoData bool `json:"noData"` Ok int `json:"ok"` UptimePercent *float32 `json:"uptimePercent,omitempty"` @@ -2543,8 +2841,12 @@ type DtoHTTPSettingsInputMethod string // DtoHistoryBeat defines model for dto.HistoryBeat. type DtoHistoryBeat struct { - CheckedAt string `json:"checkedAt"` - Condition string `json:"condition"` + CheckedAt string `json:"checkedAt"` + Condition string `json:"condition"` + + // Maintenance Maintenance says a window held this check when it ran: it is out of uptime and + // couldn't alert. + Maintenance bool `json:"maintenance"` ResponseTimeMs int `json:"responseTimeMs"` ResultId int `json:"resultId"` Severity DtoHistoryBeatSeverity `json:"severity"` @@ -2567,9 +2869,13 @@ type DtoIncident struct { Condition string `json:"condition"` // DurationSeconds DurationSeconds is how long it lasted (or has lasted so far). - DurationSeconds int `json:"durationSeconds"` - Facts DtoConditionFacts `json:"facts"` - Id openapi_types.UUID `json:"id"` + DurationSeconds int `json:"durationSeconds"` + Facts DtoConditionFacts `json:"facts"` + Id openapi_types.UUID `json:"id"` + + // MaintenanceHeld MaintenanceHeld says a maintenance window held it open at some point, so its alerts + // were paused for that time; a resolved one doesn't count towards time to recover. + MaintenanceHeld bool `json:"maintenanceHeld"` MonitorId openapi_types.UUID `json:"monitorId"` MonitorName string `json:"monitorName"` MonitorTarget string `json:"monitorTarget"` @@ -2659,9 +2965,13 @@ type DtoIncidentDetail struct { Condition string `json:"condition"` // DurationSeconds DurationSeconds is how long it lasted (or has lasted so far). - DurationSeconds int `json:"durationSeconds"` - Facts DtoConditionFacts `json:"facts"` - Id openapi_types.UUID `json:"id"` + DurationSeconds int `json:"durationSeconds"` + Facts DtoConditionFacts `json:"facts"` + Id openapi_types.UUID `json:"id"` + + // MaintenanceHeld MaintenanceHeld says a maintenance window held it open at some point, so its alerts + // were paused for that time; a resolved one doesn't count towards time to recover. + MaintenanceHeld bool `json:"maintenanceHeld"` MonitorId openapi_types.UUID `json:"monitorId"` MonitorName string `json:"monitorName"` MonitorTarget string `json:"monitorTarget"` @@ -2719,6 +3029,7 @@ type DtoIncidentEventType string // DtoIncidentOpenCounts defines model for dto.IncidentOpenCounts. type DtoIncidentOpenCounts struct { Critical int `json:"critical"` + InMaintenance int `json:"inMaintenance"` Total int `json:"total"` Unacknowledged int `json:"unacknowledged"` Warning int `json:"warning"` @@ -2732,7 +3043,8 @@ type DtoIncidentSummary struct { Open DtoIncidentOpenCounts `json:"open"` // ResolvedLast30d ResolvedLast30d counts incidents resolved in the last 30 days, the - // ones mttrLast30dSeconds averages. + // ones mttrLast30dSeconds averages: not those a maintenance window held + // open at some point, whose duration is mostly the planned work. ResolvedLast30d int `json:"resolvedLast30d"` // ResolvedLast7d ResolvedLast7d counts incidents resolved in the last 7 days. @@ -2750,6 +3062,154 @@ type DtoLastCheck struct { // DtoLastCheckSeverity defines model for DtoLastCheck.Severity. type DtoLastCheckSeverity string +// DtoMaintenanceTargetComponent defines model for dto.MaintenanceTargetComponent. +type DtoMaintenanceTargetComponent struct { + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` + StatusPageId openapi_types.UUID `json:"statusPageId"` +} + +// DtoMaintenanceTargetMonitor defines model for dto.MaintenanceTargetMonitor. +type DtoMaintenanceTargetMonitor struct { + Enabled bool `json:"enabled"` + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` + Target string `json:"target"` + Type DtoMaintenanceTargetMonitorType `json:"type"` +} + +// DtoMaintenanceTargetMonitorType defines model for DtoMaintenanceTargetMonitor.Type. +type DtoMaintenanceTargetMonitorType string + +// DtoMaintenanceTargetStatusPage defines model for dto.MaintenanceTargetStatusPage. +type DtoMaintenanceTargetStatusPage struct { + // CanPublish CanPublish says you may show a window here. On a published page it decides + // whether a window showing here can be saved. + CanPublish bool `json:"canPublish"` + ComponentIds []openapi_types.UUID `json:"componentIds"` + Id openapi_types.UUID `json:"id"` + + // MonitorIds MonitorIDs are the monitors that make a window show on this page; a monitor the + // page shows only for its certificate or domain isn't among them. ComponentIDs are + // its manual components. + MonitorIds []openapi_types.UUID `json:"monitorIds"` + Name string `json:"name"` + Published bool `json:"published"` + + // Subscribers Subscribers are its confirmed subscribers; absent when you can't read the page. + Subscribers *int `json:"subscribers,omitempty"` +} + +// DtoMaintenanceTargets defines model for dto.MaintenanceTargets. +type DtoMaintenanceTargets struct { + Components []DtoMaintenanceTargetComponent `json:"components"` + Monitors []DtoMaintenanceTargetMonitor `json:"monitors"` + StatusPages []DtoMaintenanceTargetStatusPage `json:"statusPages"` +} + +// DtoMaintenanceWindow defines model for dto.MaintenanceWindow. +type DtoMaintenanceWindow struct { + // CancelledAt CancelledAt is set once cancelled; cancelledBy stays absent when the system did it, + // every target having gone before the start. + CancelledAt *string `json:"cancelledAt,omitempty"` + CancelledBy *openapi_types.UUID `json:"cancelledBy,omitempty"` + + // CancelledByName CancelledByName names who cancelled it (their name, else their email); only when + // reading one window, and absent when Norcube Auth can't say. So do the other names. + CancelledByName *string `json:"cancelledByName,omitempty"` + CreatedAt string `json:"createdAt"` + CreatedBy *openapi_types.UUID `json:"createdBy,omitempty"` + CreatedByName *string `json:"createdByName,omitempty"` + Description string `json:"description"` + + // EndsAt EndsAt is when it ended, if someone finished it early (finishedEarly). + EndsAt string `json:"endsAt"` + FinishedBy *openapi_types.UUID `json:"finishedBy,omitempty"` + FinishedByName *string `json:"finishedByName,omitempty"` + FinishedEarly bool `json:"finishedEarly"` + Id openapi_types.UUID `json:"id"` + NotifyFinished bool `json:"notifyFinished"` + NotifyScheduled bool `json:"notifyScheduled"` + NotifyStarted bool `json:"notifyStarted"` + StartsAt string `json:"startsAt"` + + // State State follows from the times: scheduled before the start, in_progress until the + // end, then completed; cancelled once called off. + State DtoMaintenanceWindowState `json:"state"` + + // StatusPages StatusPages are the pages it shows on, published or not: every page showing a + // target, which nobody chooses. Published ones show it publicly. + StatusPages []DtoMaintenanceWindowStatusPage `json:"statusPages"` + Targets DtoMaintenanceWindowResponseTargets `json:"targets"` + Title string `json:"title"` + UpdatedAt string `json:"updatedAt"` +} + +// DtoMaintenanceWindowState State follows from the times: scheduled before the start, in_progress until the +// end, then completed; cancelled once called off. +type DtoMaintenanceWindowState string + +// DtoMaintenanceWindowCreate defines model for dto.MaintenanceWindowCreate. +type DtoMaintenanceWindowCreate struct { + // Description Description is public: it shows on status pages and in mails. + Description *string `json:"description,omitempty"` + + // EndsAt EndsAt is at most 30 days after the start. + EndsAt string `json:"endsAt"` + NotifyFinished bool `json:"notifyFinished"` + + // NotifyScheduled NotifyScheduled, NotifyStarted and NotifyFinished say which mails go to the + // subscribers of the status pages it shows on. A cancellation always tells whoever + // was told. + NotifyScheduled bool `json:"notifyScheduled"` + NotifyStarted bool `json:"notifyStarted"` + + // StartsAt StartsAt may be up to a year ahead; up to five minutes in the past reads as now. + StartsAt string `json:"startsAt"` + Targets DtoMaintenanceWindowTargets `json:"targets"` + Title string `json:"title"` +} + +// DtoMaintenanceWindowResponseTargets defines model for dto.MaintenanceWindowResponseTargets. +type DtoMaintenanceWindowResponseTargets struct { + ComponentIds []openapi_types.UUID `json:"componentIds"` + MonitorIds []openapi_types.UUID `json:"monitorIds"` +} + +// DtoMaintenanceWindowStatusPage defines model for dto.MaintenanceWindowStatusPage. +type DtoMaintenanceWindowStatusPage struct { + // ComponentIds ComponentIDs are the page's components it affects. + ComponentIds []openapi_types.UUID `json:"componentIds"` + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` + Published bool `json:"published"` +} + +// DtoMaintenanceWindowTargets defines model for dto.MaintenanceWindowTargets. +type DtoMaintenanceWindowTargets struct { + ComponentIds *[]openapi_types.UUID `json:"componentIds,omitempty"` + MonitorIds *[]openapi_types.UUID `json:"monitorIds,omitempty"` + StatusPageIds *[]openapi_types.UUID `json:"statusPageIds,omitempty"` +} + +// DtoMaintenanceWindowUpdate defines model for dto.MaintenanceWindowUpdate. +type DtoMaintenanceWindowUpdate struct { + Description *string `json:"description,omitempty"` + + // EndsAt EndsAt: until it ends, and to a time still to come. To end it now, use finish. + EndsAt *string `json:"endsAt,omitempty"` + NotifyFinished *bool `json:"notifyFinished,omitempty"` + NotifyScheduled *bool `json:"notifyScheduled,omitempty"` + NotifyStarted *bool `json:"notifyStarted,omitempty"` + + // StartsAt StartsAt: only before it starts, and to a time still to come. + StartsAt *string `json:"startsAt,omitempty"` + + // Targets Targets replaces them as a whole, only before it starts. + Targets *DtoMaintenanceWindowTargets `json:"targets,omitempty"` + Title *string `json:"title,omitempty"` +} + // DtoMonitor defines model for dto.Monitor. type DtoMonitor struct { // Aspects Aspects are the monitor's watched aspects (an HTTP monitor's @@ -2774,10 +3234,14 @@ type DtoMonitor struct { // Last24h Last24h is set on list rows of monitors that track uptime (HTTP): // the last 24 full hours plus the current one. SSL and domain monitors // show days left (condition.facts) instead. - Last24h *DtoWindowSummary `json:"last24h,omitempty"` - LastCheck *DtoLastCheck `json:"lastCheck,omitempty"` - Name string `json:"name"` - NextCheckAt *string `json:"nextCheckAt,omitempty"` + Last24h *DtoWindowSummary `json:"last24h,omitempty"` + LastCheck *DtoLastCheck `json:"lastCheck,omitempty"` + + // Maintenance Maintenance is the window holding the monitor right now (list and detail): alerts + // are paused and the time is out of uptime. Status stays what was measured. + Maintenance *DtoMonitorMaintenance `json:"maintenance,omitempty"` + Name string `json:"name"` + NextCheckAt *string `json:"nextCheckAt,omitempty"` // OverallStatus OverallStatus is the worst of status and the statuses of the // monitor's watched aspects (critical, warning, pending, ok), paused @@ -3021,6 +3485,14 @@ type DtoMonitorEventAspect string // behind on renewals, is not one). type DtoMonitorEventType string +// DtoMonitorMaintenance defines model for dto.MonitorMaintenance. +type DtoMonitorMaintenance struct { + EndsAt string `json:"endsAt"` + StartsAt string `json:"startsAt"` + Title string `json:"title"` + WindowId openapi_types.UUID `json:"windowId"` +} + // DtoMonitorStats defines model for dto.MonitorStats. type DtoMonitorStats struct { AvgMs *int `json:"avgMs,omitempty"` @@ -3029,10 +3501,14 @@ type DtoMonitorStats struct { From string `json:"from"` Granularity DtoMonitorStatsGranularity `json:"granularity"` Inconclusive int `json:"inconclusive"` - MaxMs *int `json:"maxMs,omitempty"` - Ok int `json:"ok"` - Series []DtoStatsBucket `json:"series"` - To string `json:"to"` + + // Maintenance Maintenance counts the checks inside a maintenance window, whatever they + // found. They are billed; the other counts cover only what ran outside. + Maintenance int `json:"maintenance"` + MaxMs *int `json:"maxMs,omitempty"` + Ok int `json:"ok"` + Series []DtoStatsBucket `json:"series"` + To string `json:"to"` // UptimePercent UptimePercent is (ok + warning) / (ok + warning + critical); absent // without conclusive checks and for SSL and domain monitors. @@ -3091,7 +3567,11 @@ type DtoPublicStatusDay struct { Day string `json:"day"` DowntimeMinutes *int `json:"downtimeMinutes,omitempty"` Grade DtoPublicStatusDayGrade `json:"grade"` - UptimePercent *float32 `json:"uptimePercent,omitempty"` + + // MaintenanceMinutes MaintenanceMinutes is how much of the day a window covered. Those minutes + // don't count towards the day's uptime. + MaintenanceMinutes *int `json:"maintenanceMinutes,omitempty"` + UptimePercent *float32 `json:"uptimePercent,omitempty"` } // DtoPublicStatusDayGrade defines model for DtoPublicStatusDay.Grade. @@ -3112,8 +3592,13 @@ type DtoPublicStatusGroupStatus string // DtoPublicStatusHistory defines model for dto.PublicStatusHistory. type DtoPublicStatusHistory struct { - Incidents []DtoPublicStatusIncident `json:"incidents"` - SchemaVersion int `json:"schemaVersion"` + Incidents []DtoPublicStatusIncident `json:"incidents"` + + // Maintenance Maintenance are the past windows, newest first, including announced ones + // that were cancelled, so links in mail and feeds keep working. Left out + // when there are none. + Maintenance *[]DtoPublicStatusMaintenance `json:"maintenance,omitempty"` + SchemaVersion int `json:"schemaVersion"` } // DtoPublicStatusIncident defines model for dto.PublicStatusIncident. @@ -3142,6 +3627,37 @@ type DtoPublicStatusIncidentImpact string // DtoPublicStatusIncidentStatus defines model for DtoPublicStatusIncident.Status. type DtoPublicStatusIncidentStatus string +// DtoPublicStatusMaintenance defines model for dto.PublicStatusMaintenance. +type DtoPublicStatusMaintenance struct { + Components []DtoPublicStatusMaintenanceComponent `json:"components"` + Description string `json:"description"` + EndsAt string `json:"endsAt"` + + // FinishedEarly FinishedEarly: someone ended it before it was due to end; EndsAt is when. + FinishedEarly bool `json:"finishedEarly"` + Id openapi_types.UUID `json:"id"` + StartsAt string `json:"startsAt"` + + // Status Status is decided when the snapshot is pushed, because a window that was + // finished early can't be told from its times alone. + Status DtoPublicStatusMaintenanceStatus `json:"status"` + Title string `json:"title"` + + // UpdatedAt UpdatedAt is when the window last changed, or the moment it started or + // ended if that came later. Never in the future, so feeds can use it. + UpdatedAt string `json:"updatedAt"` +} + +// DtoPublicStatusMaintenanceStatus Status is decided when the snapshot is pushed, because a window that was +// finished early can't be told from its times alone. +type DtoPublicStatusMaintenanceStatus string + +// DtoPublicStatusMaintenanceComponent defines model for dto.PublicStatusMaintenanceComponent. +type DtoPublicStatusMaintenanceComponent struct { + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` +} + // DtoPublicStatusPage defines model for dto.PublicStatusPage. type DtoPublicStatusPage struct { // Active Active are the open posts, newest first. @@ -3171,7 +3687,12 @@ type DtoPublicStatusPage struct { // the renderer serves at /logo/: a hash of the content and an // extension. Left out when it has none; LogoDarkFile is for dark mode. LogoFile *string `json:"logoFile,omitempty"` - Name string `json:"name"` + + // Maintenance Maintenance are the windows in progress and the soonest scheduled ones. + // Left out when there are none, and absent from snapshots pushed before + // windows existed. + Maintenance *[]DtoPublicStatusMaintenance `json:"maintenance,omitempty"` + Name string `json:"name"` // Published Published false: only preview links show it. Published bool `json:"published"` @@ -3240,17 +3761,21 @@ type DtoSSLSettingsInput struct { // DtoStatsBucket defines model for dto.StatsBucket. type DtoStatsBucket struct { - AvgMs int `json:"avgMs"` - Checks int `json:"checks"` - Critical int `json:"critical"` - Inconclusive int `json:"inconclusive"` - MaxMs int `json:"maxMs"` - Ok int `json:"ok"` - P50Ms int `json:"p50Ms"` - P95Ms int `json:"p95Ms"` - Region string `json:"region"` - Start string `json:"start"` - Warning int `json:"warning"` + AvgMs int `json:"avgMs"` + Checks int `json:"checks"` + Critical int `json:"critical"` + Inconclusive int `json:"inconclusive"` + + // Maintenance Maintenance counts the checks inside a maintenance window, whatever they + // found. They are billed; the other counts cover only what ran outside. + Maintenance int `json:"maintenance"` + MaxMs int `json:"maxMs"` + Ok int `json:"ok"` + P50Ms int `json:"p50Ms"` + P95Ms int `json:"p95Ms"` + Region string `json:"region"` + Start string `json:"start"` + Warning int `json:"warning"` } // DtoStatusChange defines model for dto.StatusChange. @@ -3275,12 +3800,15 @@ type DtoStatusChange struct { // Events Events are what else happened while this status lasted (from // changedAt to endedAt), newest first: certificate renewals. [] when // nothing did. - Events []DtoMonitorEvent `json:"events"` - From DtoStatusChangeFrom `json:"from"` - Id int `json:"id"` - Message *string `json:"message,omitempty"` - StatusCode *int `json:"statusCode,omitempty"` - To DtoStatusChangeTo `json:"to"` + Events []DtoMonitorEvent `json:"events"` + From DtoStatusChangeFrom `json:"from"` + Id int `json:"id"` + + // MaintenanceWindowId MaintenanceWindowID is the window the change happened in, absent outside one. + MaintenanceWindowId *openapi_types.UUID `json:"maintenanceWindowId,omitempty"` + Message *string `json:"message,omitempty"` + StatusCode *int `json:"statusCode,omitempty"` + To DtoStatusChangeTo `json:"to"` } // DtoStatusChangeFrom defines model for DtoStatusChange.From. @@ -3295,10 +3823,13 @@ type DtoStatusPage struct { // CustomDomain CustomDomain is the page's custom domain once active. URL keeps working // beside it; GET /status-pages/{id}/domain tells about one still pending. - CustomDomain *string `json:"customDomain,omitempty"` - Description string `json:"description"` - Id openapi_types.UUID `json:"id"` - Name string `json:"name"` + CustomDomain *string `json:"customDomain,omitempty"` + Description string `json:"description"` + + // Glance Glance is how the page is doing, on the list of pages only. + Glance *DtoStatusPageGlance `json:"glance,omitempty"` + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` // Published Published pages are public; others answer 404. Published bool `json:"published"` @@ -3413,6 +3944,87 @@ type DtoStatusPageDomainSet struct { Hostname string `json:"hostname"` } +// DtoStatusPageGlance defines model for dto.StatusPageGlance. +type DtoStatusPageGlance struct { + // Components Components are all of the page's components in layout order, groups flattened. + Components []DtoStatusPageGlanceComponent `json:"components"` + + // Domain Domain is the custom domain in whatever state; left out without one. + Domain *DtoStatusPageGlanceDomain `json:"domain,omitempty"` + + // Incidents Incidents are the open posts, newest first. + Incidents []DtoStatusPageGlanceIncident `json:"incidents"` + + // Indicator Indicator is the page's one-word verdict. + Indicator DtoStatusPageGlanceIndicator `json:"indicator"` + + // Maintenance Maintenance are the windows in progress and the soonest scheduled ones. + Maintenance []DtoStatusPageGlanceMaintenance `json:"maintenance"` + + // Subscribers Subscribers counts confirmed addresses. + Subscribers int `json:"subscribers"` +} + +// DtoStatusPageGlanceIndicator Indicator is the page's one-word verdict. +type DtoStatusPageGlanceIndicator string + +// DtoStatusPageGlanceComponent defines model for dto.StatusPageGlanceComponent. +type DtoStatusPageGlanceComponent struct { + Id openapi_types.UUID `json:"id"` + Name string `json:"name"` + Status DtoStatusPageGlanceComponentStatus `json:"status"` + + // UptimePercent UptimePercent over the page's range, when the page shows it and the + // component counts availability. + UptimePercent *float32 `json:"uptimePercent,omitempty"` +} + +// DtoStatusPageGlanceComponentStatus defines model for DtoStatusPageGlanceComponent.Status. +type DtoStatusPageGlanceComponentStatus string + +// DtoStatusPageGlanceDomain defines model for dto.StatusPageGlanceDomain. +type DtoStatusPageGlanceDomain struct { + // ErrorCode ErrorCode: DOMAIN_TAKEN when another status page proved this hostname first. + ErrorCode *DtoStatusPageGlanceDomainErrorCode `json:"errorCode,omitempty"` + Hostname string `json:"hostname"` + + // Status Status: the same words as GET /status-pages/{id}/domain. + Status DtoStatusPageGlanceDomainStatus `json:"status"` +} + +// DtoStatusPageGlanceDomainErrorCode ErrorCode: DOMAIN_TAKEN when another status page proved this hostname first. +type DtoStatusPageGlanceDomainErrorCode string + +// DtoStatusPageGlanceDomainStatus Status: the same words as GET /status-pages/{id}/domain. +type DtoStatusPageGlanceDomainStatus string + +// DtoStatusPageGlanceIncident defines model for dto.StatusPageGlanceIncident. +type DtoStatusPageGlanceIncident struct { + Id openapi_types.UUID `json:"id"` + Impact DtoStatusPageGlanceIncidentImpact `json:"impact"` + StartedAt string `json:"startedAt"` + Status DtoStatusPageGlanceIncidentStatus `json:"status"` + Title string `json:"title"` +} + +// DtoStatusPageGlanceIncidentImpact defines model for DtoStatusPageGlanceIncident.Impact. +type DtoStatusPageGlanceIncidentImpact string + +// DtoStatusPageGlanceIncidentStatus defines model for DtoStatusPageGlanceIncident.Status. +type DtoStatusPageGlanceIncidentStatus string + +// DtoStatusPageGlanceMaintenance defines model for dto.StatusPageGlanceMaintenance. +type DtoStatusPageGlanceMaintenance struct { + EndsAt string `json:"endsAt"` + Id openapi_types.UUID `json:"id"` + StartsAt string `json:"startsAt"` + Status DtoStatusPageGlanceMaintenanceStatus `json:"status"` + Title string `json:"title"` +} + +// DtoStatusPageGlanceMaintenanceStatus defines model for DtoStatusPageGlanceMaintenance.Status. +type DtoStatusPageGlanceMaintenanceStatus string + // DtoStatusPageGroup defines model for dto.StatusPageGroup. type DtoStatusPageGroup struct { Collapsed *bool `json:"collapsed,omitempty"` @@ -3634,7 +4246,11 @@ type DtoWindowSummary struct { Critical int `json:"critical"` From string `json:"from"` Inconclusive int `json:"inconclusive"` - Ok int `json:"ok"` + + // Maintenance Maintenance counts the checks inside a maintenance window, whatever they + // found. They are billed; the other counts cover only what ran outside. + Maintenance int `json:"maintenance"` + Ok int `json:"ok"` // P50Ms P50Ms and P95Ms approximate the window's median and 95th percentile // response time (the checks-weighted mean of the hourly percentiles). @@ -3789,6 +4405,25 @@ type ListIncidentsParamsSeverity string // ListIncidentsParamsStatus defines parameters for ListIncidents. type ListIncidentsParamsStatus string +// ListMaintenanceWindowsParams defines parameters for ListMaintenanceWindows. +type ListMaintenanceWindowsParams struct { + Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"` + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // MonitorId MonitorID keeps the windows holding that monitor. + MonitorId *openapi_types.UUID `form:"monitorId,omitempty" json:"monitorId,omitempty"` + + // Status Status keeps the windows standing there; scheduled ones come soonest first, the + // others latest start first. + Status *ListMaintenanceWindowsParamsStatus `form:"status,omitempty" json:"status,omitempty"` + + // StatusPageId StatusPageID keeps the windows showing on that page. + StatusPageId *openapi_types.UUID `form:"statusPageId,omitempty" json:"statusPageId,omitempty"` +} + +// ListMaintenanceWindowsParamsStatus defines parameters for ListMaintenanceWindows. +type ListMaintenanceWindowsParamsStatus string + // ListMonitorsParams defines parameters for ListMonitors. type ListMonitorsParams struct { Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"` @@ -3889,6 +4524,12 @@ type UpdateAlertChannelJSONRequestBody = DtoAlertChannelUpdate // ConfirmAlertChannelVerificationJSONRequestBody defines body for ConfirmAlertChannelVerification for application/json ContentType. type ConfirmAlertChannelVerificationJSONRequestBody = DtoAlertChannelVerifyConfirm +// CreateMaintenanceWindowJSONRequestBody defines body for CreateMaintenanceWindow for application/json ContentType. +type CreateMaintenanceWindowJSONRequestBody = DtoMaintenanceWindowCreate + +// UpdateMaintenanceWindowJSONRequestBody defines body for UpdateMaintenanceWindow for application/json ContentType. +type UpdateMaintenanceWindowJSONRequestBody = DtoMaintenanceWindowUpdate + // CreateMonitorJSONRequestBody defines body for CreateMonitor for application/json ContentType. type CreateMonitorJSONRequestBody = DtoMonitorCreate @@ -4043,6 +4684,34 @@ type ClientInterface interface { // AcknowledgeIncident request AcknowledgeIncident(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListMaintenanceWindows request + ListMaintenanceWindows(ctx context.Context, params *ListMaintenanceWindowsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateMaintenanceWindowWithBody request with any body + CreateMaintenanceWindowWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateMaintenanceWindow(ctx context.Context, body CreateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMaintenanceTargets request + GetMaintenanceTargets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteMaintenanceWindow request + DeleteMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMaintenanceWindow request + GetMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateMaintenanceWindowWithBody request with any body + UpdateMaintenanceWindowWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateMaintenanceWindow(ctx context.Context, id openapi_types.UUID, body UpdateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CancelMaintenanceWindow request + CancelMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // FinishMaintenanceWindow request + FinishMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListMonitors request ListMonitors(ctx context.Context, params *ListMonitorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -4386,8 +5055,8 @@ func (c *Client) AcknowledgeIncident(ctx context.Context, id openapi_types.UUID, return c.Client.Do(req) } -func (c *Client) ListMonitors(ctx context.Context, params *ListMonitorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListMonitorsRequest(c.Server, params) +func (c *Client) ListMaintenanceWindows(ctx context.Context, params *ListMaintenanceWindowsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListMaintenanceWindowsRequest(c.Server, params) if err != nil { return nil, err } @@ -4398,8 +5067,8 @@ func (c *Client) ListMonitors(ctx context.Context, params *ListMonitorsParams, r return c.Client.Do(req) } -func (c *Client) CreateMonitorWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateMonitorRequestWithBody(c.Server, contentType, body) +func (c *Client) CreateMaintenanceWindowWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateMaintenanceWindowRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -4410,8 +5079,8 @@ func (c *Client) CreateMonitorWithBody(ctx context.Context, contentType string, return c.Client.Do(req) } -func (c *Client) CreateMonitor(ctx context.Context, body CreateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateMonitorRequest(c.Server, body) +func (c *Client) CreateMaintenanceWindow(ctx context.Context, body CreateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateMaintenanceWindowRequest(c.Server, body) if err != nil { return nil, err } @@ -4422,8 +5091,8 @@ func (c *Client) CreateMonitor(ctx context.Context, body CreateMonitorJSONReques return c.Client.Do(req) } -func (c *Client) ApplyMonitorBulkActionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApplyMonitorBulkActionRequestWithBody(c.Server, contentType, body) +func (c *Client) GetMaintenanceTargets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMaintenanceTargetsRequest(c.Server) if err != nil { return nil, err } @@ -4434,8 +5103,8 @@ func (c *Client) ApplyMonitorBulkActionWithBody(ctx context.Context, contentType return c.Client.Do(req) } -func (c *Client) ApplyMonitorBulkAction(ctx context.Context, body ApplyMonitorBulkActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewApplyMonitorBulkActionRequest(c.Server, body) +func (c *Client) DeleteMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteMaintenanceWindowRequest(c.Server, id) if err != nil { return nil, err } @@ -4446,8 +5115,8 @@ func (c *Client) ApplyMonitorBulkAction(ctx context.Context, body ApplyMonitorBu return c.Client.Do(req) } -func (c *Client) DeleteMonitor(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteMonitorRequest(c.Server, id) +func (c *Client) GetMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMaintenanceWindowRequest(c.Server, id) if err != nil { return nil, err } @@ -4458,8 +5127,8 @@ func (c *Client) DeleteMonitor(ctx context.Context, id openapi_types.UUID, reqEd return c.Client.Do(req) } -func (c *Client) GetMonitor(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetMonitorRequest(c.Server, id) +func (c *Client) UpdateMaintenanceWindowWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMaintenanceWindowRequestWithBody(c.Server, id, contentType, body) if err != nil { return nil, err } @@ -4470,8 +5139,8 @@ func (c *Client) GetMonitor(ctx context.Context, id openapi_types.UUID, reqEdito return c.Client.Do(req) } -func (c *Client) UpdateMonitorWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateMonitorRequestWithBody(c.Server, id, contentType, body) +func (c *Client) UpdateMaintenanceWindow(ctx context.Context, id openapi_types.UUID, body UpdateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMaintenanceWindowRequest(c.Server, id, body) if err != nil { return nil, err } @@ -4482,8 +5151,128 @@ func (c *Client) UpdateMonitorWithBody(ctx context.Context, id openapi_types.UUI return c.Client.Do(req) } -func (c *Client) UpdateMonitor(ctx context.Context, id openapi_types.UUID, body UpdateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateMonitorRequest(c.Server, id, body) +func (c *Client) CancelMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCancelMaintenanceWindowRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) FinishMaintenanceWindow(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewFinishMaintenanceWindowRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListMonitors(ctx context.Context, params *ListMonitorsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListMonitorsRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateMonitorWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateMonitorRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateMonitor(ctx context.Context, body CreateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateMonitorRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApplyMonitorBulkActionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApplyMonitorBulkActionRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ApplyMonitorBulkAction(ctx context.Context, body ApplyMonitorBulkActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewApplyMonitorBulkActionRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteMonitor(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteMonitorRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetMonitor(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMonitorRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateMonitorWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMonitorRequestWithBody(c.Server, id, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateMonitor(ctx context.Context, id openapi_types.UUID, body UpdateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMonitorRequest(c.Server, id, body) if err != nil { return nil, err } @@ -5712,8 +6501,8 @@ func NewAcknowledgeIncidentRequest(server string, id openapi_types.UUID) (*http. return req, nil } -// NewListMonitorsRequest generates requests for ListMonitors -func NewListMonitorsRequest(server string, params *ListMonitorsParams) (*http.Request, error) { +// NewListMaintenanceWindowsRequest generates requests for ListMaintenanceWindows +func NewListMaintenanceWindowsRequest(server string, params *ListMaintenanceWindowsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -5721,7 +6510,7 @@ func NewListMonitorsRequest(server string, params *ListMonitorsParams) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/monitors") + operationPath := fmt.Sprintf("/maintenance-windows") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5752,18 +6541,6 @@ func NewListMonitorsRequest(server string, params *ListMonitorsParams) (*http.Re } - if params.Include != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "include", *params.Include, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - if params.Limit != nil { if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { @@ -5776,21 +6553,9 @@ func NewListMonitorsRequest(server string, params *ListMonitorsParams) (*http.Re } - if params.Q != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "q", *params.Q, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.Sort != nil { + if params.MonitorId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sort", *params.Sort, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "monitorId", *params.MonitorId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uuid"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -5812,9 +6577,9 @@ func NewListMonitorsRequest(server string, params *ListMonitorsParams) (*http.Re } - if params.Type != nil { + if params.StatusPageId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "type", *params.Type, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "statusPageId", *params.StatusPageId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uuid"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -5838,19 +6603,19 @@ func NewListMonitorsRequest(server string, params *ListMonitorsParams) (*http.Re return req, nil } -// NewCreateMonitorRequest calls the generic CreateMonitor builder with application/json body -func NewCreateMonitorRequest(server string, body CreateMonitorJSONRequestBody) (*http.Request, error) { +// NewCreateMaintenanceWindowRequest calls the generic CreateMaintenanceWindow builder with application/json body +func NewCreateMaintenanceWindowRequest(server string, body CreateMaintenanceWindowJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateMonitorRequestWithBody(server, "application/json", bodyReader) + return NewCreateMaintenanceWindowRequestWithBody(server, "application/json", bodyReader) } -// NewCreateMonitorRequestWithBody generates requests for CreateMonitor with any type of body -func NewCreateMonitorRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateMaintenanceWindowRequestWithBody generates requests for CreateMaintenanceWindow with any type of body +func NewCreateMaintenanceWindowRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -5858,7 +6623,7 @@ func NewCreateMonitorRequestWithBody(server string, contentType string, body io. return nil, err } - operationPath := fmt.Sprintf("/monitors") + operationPath := fmt.Sprintf("/maintenance-windows") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5878,19 +6643,8 @@ func NewCreateMonitorRequestWithBody(server string, contentType string, body io. return req, nil } -// NewApplyMonitorBulkActionRequest calls the generic ApplyMonitorBulkAction builder with application/json body -func NewApplyMonitorBulkActionRequest(server string, body ApplyMonitorBulkActionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewApplyMonitorBulkActionRequestWithBody(server, "application/json", bodyReader) -} - -// NewApplyMonitorBulkActionRequestWithBody generates requests for ApplyMonitorBulkAction with any type of body -func NewApplyMonitorBulkActionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewGetMaintenanceTargetsRequest generates requests for GetMaintenanceTargets +func NewGetMaintenanceTargetsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -5898,7 +6652,7 @@ func NewApplyMonitorBulkActionRequestWithBody(server string, contentType string, return nil, err } - operationPath := fmt.Sprintf("/monitors/bulk") + operationPath := fmt.Sprintf("/maintenance-windows/targets") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5908,18 +6662,16 @@ func NewApplyMonitorBulkActionRequestWithBody(server string, contentType string, return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteMonitorRequest generates requests for DeleteMonitor -func NewDeleteMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewDeleteMaintenanceWindowRequest generates requests for DeleteMaintenanceWindow +func NewDeleteMaintenanceWindowRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -5934,7 +6686,7 @@ func NewDeleteMonitorRequest(server string, id openapi_types.UUID) (*http.Reques return nil, err } - operationPath := fmt.Sprintf("/monitors/%s", pathParam0) + operationPath := fmt.Sprintf("/maintenance-windows/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5952,8 +6704,8 @@ func NewDeleteMonitorRequest(server string, id openapi_types.UUID) (*http.Reques return req, nil } -// NewGetMonitorRequest generates requests for GetMonitor -func NewGetMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewGetMaintenanceWindowRequest generates requests for GetMaintenanceWindow +func NewGetMaintenanceWindowRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -5968,7 +6720,7 @@ func NewGetMonitorRequest(server string, id openapi_types.UUID) (*http.Request, return nil, err } - operationPath := fmt.Sprintf("/monitors/%s", pathParam0) + operationPath := fmt.Sprintf("/maintenance-windows/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -5986,19 +6738,19 @@ func NewGetMonitorRequest(server string, id openapi_types.UUID) (*http.Request, return req, nil } -// NewUpdateMonitorRequest calls the generic UpdateMonitor builder with application/json body -func NewUpdateMonitorRequest(server string, id openapi_types.UUID, body UpdateMonitorJSONRequestBody) (*http.Request, error) { +// NewUpdateMaintenanceWindowRequest calls the generic UpdateMaintenanceWindow builder with application/json body +func NewUpdateMaintenanceWindowRequest(server string, id openapi_types.UUID, body UpdateMaintenanceWindowJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateMonitorRequestWithBody(server, id, "application/json", bodyReader) + return NewUpdateMaintenanceWindowRequestWithBody(server, id, "application/json", bodyReader) } -// NewUpdateMonitorRequestWithBody generates requests for UpdateMonitor with any type of body -func NewUpdateMonitorRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateMaintenanceWindowRequestWithBody generates requests for UpdateMaintenanceWindow with any type of body +func NewUpdateMaintenanceWindowRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6013,7 +6765,7 @@ func NewUpdateMonitorRequestWithBody(server string, id openapi_types.UUID, conte return nil, err } - operationPath := fmt.Sprintf("/monitors/%s", pathParam0) + operationPath := fmt.Sprintf("/maintenance-windows/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6033,8 +6785,8 @@ func NewUpdateMonitorRequestWithBody(server string, id openapi_types.UUID, conte return req, nil } -// NewGetMonitorAlertsRequest generates requests for GetMonitorAlerts -func NewGetMonitorAlertsRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewCancelMaintenanceWindowRequest generates requests for CancelMaintenanceWindow +func NewCancelMaintenanceWindowRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6049,7 +6801,7 @@ func NewGetMonitorAlertsRequest(server string, id openapi_types.UUID) (*http.Req return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/alerts", pathParam0) + operationPath := fmt.Sprintf("/maintenance-windows/%s/cancel", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6059,7 +6811,7 @@ func NewGetMonitorAlertsRequest(server string, id openapi_types.UUID) (*http.Req return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -6067,19 +6819,8 @@ func NewGetMonitorAlertsRequest(server string, id openapi_types.UUID) (*http.Req return req, nil } -// NewSetMonitorAlertsRequest calls the generic SetMonitorAlerts builder with application/json body -func NewSetMonitorAlertsRequest(server string, id openapi_types.UUID, body SetMonitorAlertsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSetMonitorAlertsRequestWithBody(server, id, "application/json", bodyReader) -} - -// NewSetMonitorAlertsRequestWithBody generates requests for SetMonitorAlerts with any type of body -func NewSetMonitorAlertsRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewFinishMaintenanceWindowRequest generates requests for FinishMaintenanceWindow +func NewFinishMaintenanceWindowRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6094,7 +6835,7 @@ func NewSetMonitorAlertsRequestWithBody(server string, id openapi_types.UUID, co return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/alerts", pathParam0) + operationPath := fmt.Sprintf("/maintenance-windows/%s/finish", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6104,33 +6845,24 @@ func NewSetMonitorAlertsRequestWithBody(server string, id openapi_types.UUID, co return nil, err } - req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewGetMonitorAvailabilityRequest generates requests for GetMonitorAvailability -func NewGetMonitorAvailabilityRequest(server string, id openapi_types.UUID, params *GetMonitorAvailabilityParams) (*http.Request, error) { +// NewListMonitorsRequest generates requests for ListMonitors +func NewListMonitorsRequest(server string, params *ListMonitorsParams) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/availability", pathParam0) + operationPath := fmt.Sprintf("/monitors") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6149,9 +6881,9 @@ func NewGetMonitorAvailabilityRequest(server string, id openapi_types.UUID, para // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string - if params.Days != nil { + if params.Cursor != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "days", *params.Days, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -6161,44 +6893,82 @@ func NewGetMonitorAvailabilityRequest(server string, id openapi_types.UUID, para } - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") - } - - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) - if err != nil { - return nil, err - } + if params.Include != nil { - return req, nil -} + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "include", *params.Include, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } -// NewGetMonitorCertificateRequest generates requests for GetMonitorCertificate -func NewGetMonitorCertificateRequest(server string, id openapi_types.UUID) (*http.Request, error) { - var err error + } - var pathParam0 string + if params.Limit != nil { - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } + } - operationPath := fmt.Sprintf("/monitors/%s/certificate", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + if params.Q != nil { - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "q", *params.Q, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Sort != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sort", *params.Sort, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Status != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "status", *params.Status, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Type != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "type", *params.Type, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") } req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) @@ -6209,23 +6979,27 @@ func NewGetMonitorCertificateRequest(server string, id openapi_types.UUID) (*htt return req, nil } -// NewRunMonitorCheckRequest generates requests for RunMonitorCheck -func NewRunMonitorCheckRequest(server string, id openapi_types.UUID) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) +// NewCreateMonitorRequest calls the generic CreateMonitor builder with application/json body +func NewCreateMonitorRequest(server string, body CreateMonitorJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewCreateMonitorRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateMonitorRequestWithBody generates requests for CreateMonitor with any type of body +func NewCreateMonitorRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/check", pathParam0) + operationPath := fmt.Sprintf("/monitors") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6235,31 +7009,37 @@ func NewRunMonitorCheckRequest(server string, id openapi_types.UUID) (*http.Requ return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewPauseMonitorRequest generates requests for PauseMonitor -func NewPauseMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) +// NewApplyMonitorBulkActionRequest calls the generic ApplyMonitorBulkAction builder with application/json body +func NewApplyMonitorBulkActionRequest(server string, body ApplyMonitorBulkActionJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewApplyMonitorBulkActionRequestWithBody(server, "application/json", bodyReader) +} + +// NewApplyMonitorBulkActionRequestWithBody generates requests for ApplyMonitorBulkAction with any type of body +func NewApplyMonitorBulkActionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/pause", pathParam0) + operationPath := fmt.Sprintf("/monitors/bulk") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6269,16 +7049,18 @@ func NewPauseMonitorRequest(server string, id openapi_types.UUID) (*http.Request return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewListMonitorResultsRequest generates requests for ListMonitorResults -func NewListMonitorResultsRequest(server string, id openapi_types.UUID, params *ListMonitorResultsParams) (*http.Request, error) { +// NewDeleteMonitorRequest generates requests for DeleteMonitor +func NewDeleteMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6293,7 +7075,7 @@ func NewListMonitorResultsRequest(server string, id openapi_types.UUID, params * return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/results", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6303,70 +7085,7 @@ func NewListMonitorResultsRequest(server string, id openapi_types.UUID, params * return nil, err } - if params != nil { - // queryValues collects non-styled parameters (passthrough, JSON) - // that are safe to round-trip through url.Values.Encode(). - queryValues := queryURL.Query() - // rawQueryFragments collects pre-encoded query fragments from - // styled parameters, preserving literal commas as delimiters - // per the OpenAPI spec (e.g. "color=blue,black,brown"). - var rawQueryFragments []string - - if params.Cursor != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.From != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "from", *params.From, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.To != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "to", *params.To, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") - } - - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -6374,8 +7093,8 @@ func NewListMonitorResultsRequest(server string, id openapi_types.UUID, params * return req, nil } -// NewResumeMonitorRequest generates requests for ResumeMonitor -func NewResumeMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewGetMonitorRequest generates requests for GetMonitor +func NewGetMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6390,7 +7109,7 @@ func NewResumeMonitorRequest(server string, id openapi_types.UUID) (*http.Reques return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/resume", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6400,7 +7119,7 @@ func NewResumeMonitorRequest(server string, id openapi_types.UUID) (*http.Reques return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -6408,8 +7127,19 @@ func NewResumeMonitorRequest(server string, id openapi_types.UUID) (*http.Reques return req, nil } -// NewGetMonitorStatsRequest generates requests for GetMonitorStats -func NewGetMonitorStatsRequest(server string, id openapi_types.UUID, params *GetMonitorStatsParams) (*http.Request, error) { +// NewUpdateMonitorRequest calls the generic UpdateMonitor builder with application/json body +func NewUpdateMonitorRequest(server string, id openapi_types.UUID, body UpdateMonitorJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateMonitorRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewUpdateMonitorRequestWithBody generates requests for UpdateMonitor with any type of body +func NewUpdateMonitorRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -6424,7 +7154,7 @@ func NewGetMonitorStatsRequest(server string, id openapi_types.UUID, params *Get return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/stats", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6434,39 +7164,18 @@ func NewGetMonitorStatsRequest(server string, id openapi_types.UUID, params *Get return nil, err } - if params != nil { - // queryValues collects non-styled parameters (passthrough, JSON) - // that are safe to round-trip through url.Values.Encode(). - queryValues := queryURL.Query() - // rawQueryFragments collects pre-encoded query fragments from - // styled parameters, preserving literal commas as delimiters - // per the OpenAPI spec (e.g. "color=blue,black,brown"). - var rawQueryFragments []string - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "range", params.Range, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") - } - - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewListMonitorStatusChangesRequest generates requests for ListMonitorStatusChanges -func NewListMonitorStatusChangesRequest(server string, id openapi_types.UUID, params *ListMonitorStatusChangesParams) (*http.Request, error) { +// NewGetMonitorAlertsRequest generates requests for GetMonitorAlerts +func NewGetMonitorAlertsRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6481,7 +7190,7 @@ func NewListMonitorStatusChangesRequest(server string, id openapi_types.UUID, pa return nil, err } - operationPath := fmt.Sprintf("/monitors/%s/status-changes", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s/alerts", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6491,63 +7200,78 @@ func NewListMonitorStatusChangesRequest(server string, id openapi_types.UUID, pa return nil, err } - if params != nil { - // queryValues collects non-styled parameters (passthrough, JSON) - // that are safe to round-trip through url.Values.Encode(). - queryValues := queryURL.Query() - // rawQueryFragments collects pre-encoded query fragments from - // styled parameters, preserving literal commas as delimiters - // per the OpenAPI spec (e.g. "color=blue,black,brown"). - var rawQueryFragments []string + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } - if params.Cursor != nil { + return req, nil +} - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } +// NewSetMonitorAlertsRequest calls the generic SetMonitorAlerts builder with application/json body +func NewSetMonitorAlertsRequest(server string, id openapi_types.UUID, body SetMonitorAlertsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSetMonitorAlertsRequestWithBody(server, id, "application/json", bodyReader) +} - } +// NewSetMonitorAlertsRequestWithBody generates requests for SetMonitorAlerts with any type of body +func NewSetMonitorAlertsRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error - if params.Limit != nil { + var pathParam0 string - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - } + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + operationPath := fmt.Sprintf("/monitors/%s/alerts", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewListStatusPagesRequest generates requests for ListStatusPages -func NewListStatusPagesRequest(server string, params *ListStatusPagesParams) (*http.Request, error) { +// NewGetMonitorAvailabilityRequest generates requests for GetMonitorAvailability +func NewGetMonitorAvailabilityRequest(server string, id openapi_types.UUID, params *GetMonitorAvailabilityParams) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages") + operationPath := fmt.Sprintf("/monitors/%s/availability", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6566,33 +7290,9 @@ func NewListStatusPagesRequest(server string, params *ListStatusPagesParams) (*h // per the OpenAPI spec (e.g. "color=blue,black,brown"). var rawQueryFragments []string - if params.Cursor != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.MonitorId != nil { + if params.Days != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "monitorId", *params.MonitorId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uuid"}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "days", *params.Days, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -6616,27 +7316,23 @@ func NewListStatusPagesRequest(server string, params *ListStatusPagesParams) (*h return req, nil } -// NewCreateStatusPageRequest calls the generic CreateStatusPage builder with application/json body -func NewCreateStatusPageRequest(server string, body CreateStatusPageJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewGetMonitorCertificateRequest generates requests for GetMonitorCertificate +func NewGetMonitorCertificateRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewCreateStatusPageRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateStatusPageRequestWithBody generates requests for CreateStatusPage with any type of body -func NewCreateStatusPageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages") + operationPath := fmt.Sprintf("/monitors/%s/certificate", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6646,18 +7342,16 @@ func NewCreateStatusPageRequestWithBody(server string, contentType string, body return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteStatusPageRequest generates requests for DeleteStatusPage -func NewDeleteStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewRunMonitorCheckRequest generates requests for RunMonitorCheck +func NewRunMonitorCheckRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6672,7 +7366,7 @@ func NewDeleteStatusPageRequest(server string, id openapi_types.UUID) (*http.Req return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s/check", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6682,7 +7376,7 @@ func NewDeleteStatusPageRequest(server string, id openapi_types.UUID) (*http.Req return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -6690,8 +7384,8 @@ func NewDeleteStatusPageRequest(server string, id openapi_types.UUID) (*http.Req return req, nil } -// NewGetStatusPageRequest generates requests for GetStatusPage -func NewGetStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewPauseMonitorRequest generates requests for PauseMonitor +func NewPauseMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6706,7 +7400,7 @@ func NewGetStatusPageRequest(server string, id openapi_types.UUID) (*http.Reques return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s/pause", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6716,7 +7410,7 @@ func NewGetStatusPageRequest(server string, id openapi_types.UUID) (*http.Reques return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -6724,19 +7418,8 @@ func NewGetStatusPageRequest(server string, id openapi_types.UUID) (*http.Reques return req, nil } -// NewUpdateStatusPageRequest calls the generic UpdateStatusPage builder with application/json body -func NewUpdateStatusPageRequest(server string, id openapi_types.UUID, body UpdateStatusPageJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateStatusPageRequestWithBody(server, id, "application/json", bodyReader) -} - -// NewUpdateStatusPageRequestWithBody generates requests for UpdateStatusPage with any type of body -func NewUpdateStatusPageRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewListMonitorResultsRequest generates requests for ListMonitorResults +func NewListMonitorResultsRequest(server string, id openapi_types.UUID, params *ListMonitorResultsParams) (*http.Request, error) { var err error var pathParam0 string @@ -6751,7 +7434,7 @@ func NewUpdateStatusPageRequestWithBody(server string, id openapi_types.UUID, co return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s/results", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6761,18 +7444,79 @@ func NewUpdateStatusPageRequestWithBody(server string, id openapi_types.UUID, co return nil, err } - req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Cursor != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.From != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "from", *params.From, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.To != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "to", *params.To, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "date-time"}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteStatusPageDomainRequest generates requests for DeleteStatusPageDomain -func NewDeleteStatusPageDomainRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewResumeMonitorRequest generates requests for ResumeMonitor +func NewResumeMonitorRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -6787,7 +7531,7 @@ func NewDeleteStatusPageDomainRequest(server string, id openapi_types.UUID) (*ht return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/domain", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s/resume", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6797,7 +7541,7 @@ func NewDeleteStatusPageDomainRequest(server string, id openapi_types.UUID) (*ht return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) if err != nil { return nil, err } @@ -6805,8 +7549,8 @@ func NewDeleteStatusPageDomainRequest(server string, id openapi_types.UUID) (*ht return req, nil } -// NewGetStatusPageDomainRequest generates requests for GetStatusPageDomain -func NewGetStatusPageDomainRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewGetMonitorStatsRequest generates requests for GetMonitorStats +func NewGetMonitorStatsRequest(server string, id openapi_types.UUID, params *GetMonitorStatsParams) (*http.Request, error) { var err error var pathParam0 string @@ -6821,7 +7565,7 @@ func NewGetStatusPageDomainRequest(server string, id openapi_types.UUID) (*http. return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/domain", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s/stats", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6831,27 +7575,39 @@ func NewGetStatusPageDomainRequest(server string, id openapi_types.UUID) (*http. return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string -// NewSetStatusPageDomainRequest calls the generic SetStatusPageDomain builder with application/json body -func NewSetStatusPageDomainRequest(server string, id openapi_types.UUID, body SetStatusPageDomainJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "range", params.Range, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewSetStatusPageDomainRequestWithBody(server, id, "application/json", bodyReader) + + return req, nil } -// NewSetStatusPageDomainRequestWithBody generates requests for SetStatusPageDomain with any type of body -func NewSetStatusPageDomainRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewListMonitorStatusChangesRequest generates requests for ListMonitorStatusChanges +func NewListMonitorStatusChangesRequest(server string, id openapi_types.UUID, params *ListMonitorStatusChangesParams) (*http.Request, error) { var err error var pathParam0 string @@ -6866,7 +7622,7 @@ func NewSetStatusPageDomainRequestWithBody(server string, id openapi_types.UUID, return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/domain", pathParam0) + operationPath := fmt.Sprintf("/monitors/%s/status-changes", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6876,33 +7632,63 @@ func NewSetStatusPageDomainRequestWithBody(server string, id openapi_types.UUID, return nil, err } - req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) - if err != nil { - return nil, err - } + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string - req.Header.Add("Content-Type", contentType) + if params.Cursor != nil { - return req, nil -} + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } -// NewListStatusPageIncidentsRequest generates requests for ListStatusPageIncidents -func NewListStatusPageIncidentsRequest(server string, id openapi_types.UUID, params *ListStatusPageIncidentsParams) (*http.Request, error) { - var err error + } - var pathParam0 string + if params.Limit != nil { - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } + return req, nil +} + +// NewListStatusPagesRequest generates requests for ListStatusPages +func NewListStatusPagesRequest(server string, params *ListStatusPagesParams) (*http.Request, error) { + var err error + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/incidents", pathParam0) + operationPath := fmt.Sprintf("/status-pages") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -6945,9 +7731,9 @@ func NewListStatusPageIncidentsRequest(server string, id openapi_types.UUID, par } - if params.Status != nil { + if params.MonitorId != nil { - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "status", *params.Status, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "monitorId", *params.MonitorId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: "uuid"}); err != nil { return nil, err } else { for _, qp := range strings.Split(queryFrag, "&") { @@ -6971,34 +7757,27 @@ func NewListStatusPageIncidentsRequest(server string, id openapi_types.UUID, par return req, nil } -// NewCreateStatusPageIncidentRequest calls the generic CreateStatusPageIncident builder with application/json body -func NewCreateStatusPageIncidentRequest(server string, id openapi_types.UUID, body CreateStatusPageIncidentJSONRequestBody) (*http.Request, error) { +// NewCreateStatusPageRequest calls the generic CreateStatusPage builder with application/json body +func NewCreateStatusPageRequest(server string, body CreateStatusPageJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateStatusPageIncidentRequestWithBody(server, id, "application/json", bodyReader) + return NewCreateStatusPageRequestWithBody(server, "application/json", bodyReader) } -// NewCreateStatusPageIncidentRequestWithBody generates requests for CreateStatusPageIncident with any type of body -func NewCreateStatusPageIncidentRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateStatusPageRequestWithBody generates requests for CreateStatusPage with any type of body +func NewCreateStatusPageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/incidents", pathParam0) + operationPath := fmt.Sprintf("/status-pages") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7018,8 +7797,8 @@ func NewCreateStatusPageIncidentRequestWithBody(server string, id openapi_types. return req, nil } -// NewGetStatusPageIncidentRequest generates requests for GetStatusPageIncident -func NewGetStatusPageIncidentRequest(server string, id openapi_types.UUID, incidentId openapi_types.UUID) (*http.Request, error) { +// NewDeleteStatusPageRequest generates requests for DeleteStatusPage +func NewDeleteStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7029,19 +7808,12 @@ func NewGetStatusPageIncidentRequest(server string, id openapi_types.UUID, incid return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "incidentId", incidentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/incidents/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/status-pages/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7051,7 +7823,7 @@ func NewGetStatusPageIncidentRequest(server string, id openapi_types.UUID, incid return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -7059,19 +7831,8 @@ func NewGetStatusPageIncidentRequest(server string, id openapi_types.UUID, incid return req, nil } -// NewUpdateStatusPageIncidentRequest calls the generic UpdateStatusPageIncident builder with application/json body -func NewUpdateStatusPageIncidentRequest(server string, id openapi_types.UUID, incidentId openapi_types.UUID, body UpdateStatusPageIncidentJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateStatusPageIncidentRequestWithBody(server, id, incidentId, "application/json", bodyReader) -} - -// NewUpdateStatusPageIncidentRequestWithBody generates requests for UpdateStatusPageIncident with any type of body -func NewUpdateStatusPageIncidentRequestWithBody(server string, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewGetStatusPageRequest generates requests for GetStatusPage +func NewGetStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7081,19 +7842,12 @@ func NewUpdateStatusPageIncidentRequestWithBody(server string, id openapi_types. return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "incidentId", incidentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/incidents/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/status-pages/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7103,29 +7857,27 @@ func NewUpdateStatusPageIncidentRequestWithBody(server string, id openapi_types. return nil, err } - req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewCreateStatusPageIncidentUpdateRequest calls the generic CreateStatusPageIncidentUpdate builder with application/json body -func NewCreateStatusPageIncidentUpdateRequest(server string, id openapi_types.UUID, incidentId openapi_types.UUID, body CreateStatusPageIncidentUpdateJSONRequestBody) (*http.Request, error) { +// NewUpdateStatusPageRequest calls the generic UpdateStatusPage builder with application/json body +func NewUpdateStatusPageRequest(server string, id openapi_types.UUID, body UpdateStatusPageJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateStatusPageIncidentUpdateRequestWithBody(server, id, incidentId, "application/json", bodyReader) + return NewUpdateStatusPageRequestWithBody(server, id, "application/json", bodyReader) } -// NewCreateStatusPageIncidentUpdateRequestWithBody generates requests for CreateStatusPageIncidentUpdate with any type of body -func NewCreateStatusPageIncidentUpdateRequestWithBody(server string, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateStatusPageRequestWithBody generates requests for UpdateStatusPage with any type of body +func NewUpdateStatusPageRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -7135,19 +7887,12 @@ func NewCreateStatusPageIncidentUpdateRequestWithBody(server string, id openapi_ return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "incidentId", incidentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/incidents/%s/updates", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/status-pages/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7157,7 +7902,7 @@ func NewCreateStatusPageIncidentUpdateRequestWithBody(server string, id openapi_ return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } @@ -7167,8 +7912,8 @@ func NewCreateStatusPageIncidentUpdateRequestWithBody(server string, id openapi_ return req, nil } -// NewGetStatusPageLayoutRequest generates requests for GetStatusPageLayout -func NewGetStatusPageLayoutRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewDeleteStatusPageDomainRequest generates requests for DeleteStatusPageDomain +func NewDeleteStatusPageDomainRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7183,7 +7928,7 @@ func NewGetStatusPageLayoutRequest(server string, id openapi_types.UUID) (*http. return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/layout", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/domain", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7193,7 +7938,7 @@ func NewGetStatusPageLayoutRequest(server string, id openapi_types.UUID) (*http. return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -7201,19 +7946,8 @@ func NewGetStatusPageLayoutRequest(server string, id openapi_types.UUID) (*http. return req, nil } -// NewSetStatusPageLayoutRequest calls the generic SetStatusPageLayout builder with application/json body -func NewSetStatusPageLayoutRequest(server string, id openapi_types.UUID, body SetStatusPageLayoutJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSetStatusPageLayoutRequestWithBody(server, id, "application/json", bodyReader) -} - -// NewSetStatusPageLayoutRequestWithBody generates requests for SetStatusPageLayout with any type of body -func NewSetStatusPageLayoutRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { +// NewGetStatusPageDomainRequest generates requests for GetStatusPageDomain +func NewGetStatusPageDomainRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7228,7 +7962,7 @@ func NewSetStatusPageLayoutRequestWithBody(server string, id openapi_types.UUID, return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/layout", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/domain", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7238,18 +7972,27 @@ func NewSetStatusPageLayoutRequestWithBody(server string, id openapi_types.UUID, return nil, err } - req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteStatusPageLogoRequest generates requests for DeleteStatusPageLogo -func NewDeleteStatusPageLogoRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewSetStatusPageDomainRequest calls the generic SetStatusPageDomain builder with application/json body +func NewSetStatusPageDomainRequest(server string, id openapi_types.UUID, body SetStatusPageDomainJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSetStatusPageDomainRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewSetStatusPageDomainRequestWithBody generates requests for SetStatusPageDomain with any type of body +func NewSetStatusPageDomainRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -7264,7 +8007,7 @@ func NewDeleteStatusPageLogoRequest(server string, id openapi_types.UUID) (*http return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/logo", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/domain", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7274,16 +8017,18 @@ func NewDeleteStatusPageLogoRequest(server string, id openapi_types.UUID) (*http return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewGetStatusPageLogoRequest generates requests for GetStatusPageLogo -func NewGetStatusPageLogoRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewListStatusPageIncidentsRequest generates requests for ListStatusPageIncidents +func NewListStatusPageIncidentsRequest(server string, id openapi_types.UUID, params *ListStatusPageIncidentsParams) (*http.Request, error) { var err error var pathParam0 string @@ -7298,7 +8043,7 @@ func NewGetStatusPageLogoRequest(server string, id openapi_types.UUID) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/logo", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/incidents", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7308,27 +8053,78 @@ func NewGetStatusPageLogoRequest(server string, id openapi_types.UUID) (*http.Re return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string -// NewSetStatusPageLogoRequest calls the generic SetStatusPageLogo builder with application/json body -func NewSetStatusPageLogoRequest(server string, id openapi_types.UUID, body SetStatusPageLogoJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewSetStatusPageLogoRequestWithBody(server, id, "application/json", bodyReader) -} + if params.Cursor != nil { -// NewSetStatusPageLogoRequestWithBody generates requests for SetStatusPageLogo with any type of body -func NewSetStatusPageLogoRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.Status != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "status", *params.Status, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateStatusPageIncidentRequest calls the generic CreateStatusPageIncident builder with application/json body +func NewCreateStatusPageIncidentRequest(server string, id openapi_types.UUID, body CreateStatusPageIncidentJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateStatusPageIncidentRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewCreateStatusPageIncidentRequestWithBody generates requests for CreateStatusPageIncident with any type of body +func NewCreateStatusPageIncidentRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -7343,7 +8139,7 @@ func NewSetStatusPageLogoRequestWithBody(server string, id openapi_types.UUID, c return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/logo", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/incidents", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7353,7 +8149,7 @@ func NewSetStatusPageLogoRequestWithBody(server string, id openapi_types.UUID, c return nil, err } - req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } @@ -7363,8 +8159,8 @@ func NewSetStatusPageLogoRequestWithBody(server string, id openapi_types.UUID, c return req, nil } -// NewPreviewStatusPageRequest generates requests for PreviewStatusPage -func NewPreviewStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewGetStatusPageIncidentRequest generates requests for GetStatusPageIncident +func NewGetStatusPageIncidentRequest(server string, id openapi_types.UUID, incidentId openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7374,12 +8170,19 @@ func NewPreviewStatusPageRequest(server string, id openapi_types.UUID) (*http.Re return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "incidentId", incidentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/preview", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/incidents/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7397,8 +8200,19 @@ func NewPreviewStatusPageRequest(server string, id openapi_types.UUID) (*http.Re return req, nil } -// NewCreateStatusPagePreviewLinkRequest generates requests for CreateStatusPagePreviewLink -func NewCreateStatusPagePreviewLinkRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewUpdateStatusPageIncidentRequest calls the generic UpdateStatusPageIncident builder with application/json body +func NewUpdateStatusPageIncidentRequest(server string, id openapi_types.UUID, incidentId openapi_types.UUID, body UpdateStatusPageIncidentJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateStatusPageIncidentRequestWithBody(server, id, incidentId, "application/json", bodyReader) +} + +// NewUpdateStatusPageIncidentRequestWithBody generates requests for UpdateStatusPageIncident with any type of body +func NewUpdateStatusPageIncidentRequestWithBody(server string, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -7408,12 +8222,19 @@ func NewCreateStatusPagePreviewLinkRequest(server string, id openapi_types.UUID) return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "incidentId", incidentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/preview-link", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/incidents/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7423,16 +8244,29 @@ func NewCreateStatusPagePreviewLinkRequest(server string, id openapi_types.UUID) return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewPublishStatusPageRequest generates requests for PublishStatusPage -func NewPublishStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewCreateStatusPageIncidentUpdateRequest calls the generic CreateStatusPageIncidentUpdate builder with application/json body +func NewCreateStatusPageIncidentUpdateRequest(server string, id openapi_types.UUID, incidentId openapi_types.UUID, body CreateStatusPageIncidentUpdateJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateStatusPageIncidentUpdateRequestWithBody(server, id, incidentId, "application/json", bodyReader) +} + +// NewCreateStatusPageIncidentUpdateRequestWithBody generates requests for CreateStatusPageIncidentUpdate with any type of body +func NewCreateStatusPageIncidentUpdateRequestWithBody(server string, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -7442,12 +8276,19 @@ func NewPublishStatusPageRequest(server string, id openapi_types.UUID) (*http.Re return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "incidentId", incidentId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/publish", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/incidents/%s/updates", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7457,16 +8298,18 @@ func NewPublishStatusPageRequest(server string, id openapi_types.UUID) (*http.Re return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewListStatusPageSubscribersRequest generates requests for ListStatusPageSubscribers -func NewListStatusPageSubscribersRequest(server string, id openapi_types.UUID, params *ListStatusPageSubscribersParams) (*http.Request, error) { +// NewGetStatusPageLayoutRequest generates requests for GetStatusPageLayout +func NewGetStatusPageLayoutRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7481,7 +8324,7 @@ func NewListStatusPageSubscribersRequest(server string, id openapi_types.UUID, p return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/subscribers", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/layout", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7491,45 +8334,6 @@ func NewListStatusPageSubscribersRequest(server string, id openapi_types.UUID, p return nil, err } - if params != nil { - // queryValues collects non-styled parameters (passthrough, JSON) - // that are safe to round-trip through url.Values.Encode(). - queryValues := queryURL.Query() - // rawQueryFragments collects pre-encoded query fragments from - // styled parameters, preserving literal commas as delimiters - // per the OpenAPI spec (e.g. "color=blue,black,brown"). - var rawQueryFragments []string - - if params.Cursor != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { - return nil, err - } else { - for _, qp := range strings.Split(queryFrag, "&") { - rawQueryFragments = append(rawQueryFragments, qp) - } - } - - } - - if encoded := queryValues.Encode(); encoded != "" { - rawQueryFragments = append(rawQueryFragments, encoded) - } - queryURL.RawQuery = strings.Join(rawQueryFragments, "&") - } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err @@ -7538,8 +8342,19 @@ func NewListStatusPageSubscribersRequest(server string, id openapi_types.UUID, p return req, nil } -// NewCountStatusPageSubscribersRequest generates requests for CountStatusPageSubscribers -func NewCountStatusPageSubscribersRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewSetStatusPageLayoutRequest calls the generic SetStatusPageLayout builder with application/json body +func NewSetStatusPageLayoutRequest(server string, id openapi_types.UUID, body SetStatusPageLayoutJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSetStatusPageLayoutRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewSetStatusPageLayoutRequestWithBody generates requests for SetStatusPageLayout with any type of body +func NewSetStatusPageLayoutRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -7554,7 +8369,7 @@ func NewCountStatusPageSubscribersRequest(server string, id openapi_types.UUID) return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/subscribers/count", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/layout", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7564,16 +8379,18 @@ func NewCountStatusPageSubscribersRequest(server string, id openapi_types.UUID) return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewExportStatusPageSubscribersRequest generates requests for ExportStatusPageSubscribers -func NewExportStatusPageSubscribersRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewDeleteStatusPageLogoRequest generates requests for DeleteStatusPageLogo +func NewDeleteStatusPageLogoRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7588,7 +8405,7 @@ func NewExportStatusPageSubscribersRequest(server string, id openapi_types.UUID) return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/subscribers/export", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/logo", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7598,7 +8415,7 @@ func NewExportStatusPageSubscribersRequest(server string, id openapi_types.UUID) return nil, err } - req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) if err != nil { return nil, err } @@ -7606,8 +8423,8 @@ func NewExportStatusPageSubscribersRequest(server string, id openapi_types.UUID) return req, nil } -// NewDeleteStatusPageSubscriberRequest generates requests for DeleteStatusPageSubscriber -func NewDeleteStatusPageSubscriberRequest(server string, id openapi_types.UUID, subscriberId openapi_types.UUID) (*http.Request, error) { +// NewGetStatusPageLogoRequest generates requests for GetStatusPageLogo +func NewGetStatusPageLogoRequest(server string, id openapi_types.UUID) (*http.Request, error) { var err error var pathParam0 string @@ -7617,19 +8434,12 @@ func NewDeleteStatusPageSubscriberRequest(server string, id openapi_types.UUID, return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithOptions("simple", false, "subscriberId", subscriberId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/subscribers/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/status-pages/%s/logo", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7639,7 +8449,7 @@ func NewDeleteStatusPageSubscriberRequest(server string, id openapi_types.UUID, return nil, err } - req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) if err != nil { return nil, err } @@ -7647,8 +8457,19 @@ func NewDeleteStatusPageSubscriberRequest(server string, id openapi_types.UUID, return req, nil } -// NewUnpublishStatusPageRequest generates requests for UnpublishStatusPage -func NewUnpublishStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { +// NewSetStatusPageLogoRequest calls the generic SetStatusPageLogo builder with application/json body +func NewSetStatusPageLogoRequest(server string, id openapi_types.UUID, body SetStatusPageLogoJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewSetStatusPageLogoRequestWithBody(server, id, "application/json", bodyReader) +} + +// NewSetStatusPageLogoRequestWithBody generates requests for SetStatusPageLogo with any type of body +func NewSetStatusPageLogoRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -7663,7 +8484,7 @@ func NewUnpublishStatusPageRequest(server string, id openapi_types.UUID) (*http. return nil, err } - operationPath := fmt.Sprintf("/status-pages/%s/unpublish", pathParam0) + operationPath := fmt.Sprintf("/status-pages/%s/logo", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -7673,366 +8494,616 @@ func NewUnpublishStatusPageRequest(server string, id openapi_types.UUID) (*http. return nil, err } - req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + req, err := http.NewRequest(http.MethodPut, queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} +// NewPreviewStatusPageRequest generates requests for PreviewStatusPage +func NewPreviewStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} + var pathParam0 string -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil -} -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } -} -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // ListAlertChannelsWithResponse request - ListAlertChannelsWithResponse(ctx context.Context, params *ListAlertChannelsParams, reqEditors ...RequestEditorFn) (*ListAlertChannelsResponse, error) + operationPath := fmt.Sprintf("/status-pages/%s/preview", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // CreateAlertChannelWithBodyWithResponse request with any body - CreateAlertChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - CreateAlertChannelWithResponse(ctx context.Context, body CreateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } - // DeleteAlertChannelWithResponse request - DeleteAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAlertChannelResponse, error) + return req, nil +} - // GetAlertChannelWithResponse request - GetAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAlertChannelResponse, error) +// NewCreateStatusPagePreviewLinkRequest generates requests for CreateStatusPagePreviewLink +func NewCreateStatusPagePreviewLinkRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error - // UpdateAlertChannelWithBodyWithResponse request with any body - UpdateAlertChannelWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) + var pathParam0 string - UpdateAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - // ListAlertChannelDeliveriesWithResponse request - ListAlertChannelDeliveriesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListAlertChannelDeliveriesParams, reqEditors ...RequestEditorFn) (*ListAlertChannelDeliveriesResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // TestAlertChannelWithResponse request - TestAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*TestAlertChannelResponse, error) + operationPath := fmt.Sprintf("/status-pages/%s/preview-link", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // SendAlertChannelVerificationWithResponse request - SendAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*SendAlertChannelVerificationResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // ConfirmAlertChannelVerificationWithBodyWithResponse request with any body - ConfirmAlertChannelVerificationWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } - ConfirmAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, body ConfirmAlertChannelVerificationJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) + return req, nil +} - // ListIncidentsWithResponse request - ListIncidentsWithResponse(ctx context.Context, params *ListIncidentsParams, reqEditors ...RequestEditorFn) (*ListIncidentsResponse, error) +// NewPublishStatusPageRequest generates requests for PublishStatusPage +func NewPublishStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error - // GetIncidentSummaryWithResponse request - GetIncidentSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetIncidentSummaryResponse, error) + var pathParam0 string - // GetIncidentWithResponse request - GetIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetIncidentResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - // AcknowledgeIncidentWithResponse request - AcknowledgeIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*AcknowledgeIncidentResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // ListMonitorsWithResponse request - ListMonitorsWithResponse(ctx context.Context, params *ListMonitorsParams, reqEditors ...RequestEditorFn) (*ListMonitorsResponse, error) + operationPath := fmt.Sprintf("/status-pages/%s/publish", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // CreateMonitorWithBodyWithResponse request with any body - CreateMonitorWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - CreateMonitorWithResponse(ctx context.Context, body CreateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } - // ApplyMonitorBulkActionWithBodyWithResponse request with any body - ApplyMonitorBulkActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) + return req, nil +} - ApplyMonitorBulkActionWithResponse(ctx context.Context, body ApplyMonitorBulkActionJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) +// NewListStatusPageSubscribersRequest generates requests for ListStatusPageSubscribers +func NewListStatusPageSubscribersRequest(server string, id openapi_types.UUID, params *ListStatusPageSubscribersParams) (*http.Request, error) { + var err error - // DeleteMonitorWithResponse request - DeleteMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteMonitorResponse, error) + var pathParam0 string - // GetMonitorWithResponse request - GetMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - // UpdateMonitorWithBodyWithResponse request with any body - UpdateMonitorWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - UpdateMonitorWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) + operationPath := fmt.Sprintf("/status-pages/%s/subscribers", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // GetMonitorAlertsWithResponse request - GetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorAlertsResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // SetMonitorAlertsWithBodyWithResponse request with any body - SetMonitorAlertsWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string - SetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, body SetMonitorAlertsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) + if params.Cursor != nil { - // GetMonitorAvailabilityWithResponse request - GetMonitorAvailabilityWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorAvailabilityParams, reqEditors ...RequestEditorFn) (*GetMonitorAvailabilityResponse, error) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "cursor", *params.Cursor, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } - // GetMonitorCertificateWithResponse request - GetMonitorCertificateWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorCertificateResponse, error) + } - // RunMonitorCheckWithResponse request - RunMonitorCheckWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*RunMonitorCheckResponse, error) + if params.Limit != nil { - // PauseMonitorWithResponse request - PauseMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PauseMonitorResponse, error) + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "limit", *params.Limit, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } - // ListMonitorResultsWithResponse request - ListMonitorResultsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorResultsParams, reqEditors ...RequestEditorFn) (*ListMonitorResultsResponse, error) + } - // ResumeMonitorWithResponse request - ResumeMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ResumeMonitorResponse, error) + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } - // GetMonitorStatsWithResponse request - GetMonitorStatsWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorStatsParams, reqEditors ...RequestEditorFn) (*GetMonitorStatsResponse, error) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } - // ListMonitorStatusChangesWithResponse request - ListMonitorStatusChangesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorStatusChangesParams, reqEditors ...RequestEditorFn) (*ListMonitorStatusChangesResponse, error) + return req, nil +} - // ListStatusPagesWithResponse request - ListStatusPagesWithResponse(ctx context.Context, params *ListStatusPagesParams, reqEditors ...RequestEditorFn) (*ListStatusPagesResponse, error) +// NewCountStatusPageSubscribersRequest generates requests for CountStatusPageSubscribers +func NewCountStatusPageSubscribersRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error - // CreateStatusPageWithBodyWithResponse request with any body - CreateStatusPageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) + var pathParam0 string - CreateStatusPageWithResponse(ctx context.Context, body CreateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - // DeleteStatusPageWithResponse request - DeleteStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetStatusPageWithResponse request - GetStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageResponse, error) + operationPath := fmt.Sprintf("/status-pages/%s/subscribers/count", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // UpdateStatusPageWithBodyWithResponse request with any body - UpdateStatusPageWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - UpdateStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } - // DeleteStatusPageDomainWithResponse request - DeleteStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageDomainResponse, error) - - // GetStatusPageDomainWithResponse request - GetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageDomainResponse, error) - - // SetStatusPageDomainWithBodyWithResponse request with any body - SetStatusPageDomainWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) - - SetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) - - // ListStatusPageIncidentsWithResponse request - ListStatusPageIncidentsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageIncidentsParams, reqEditors ...RequestEditorFn) (*ListStatusPageIncidentsResponse, error) - - // CreateStatusPageIncidentWithBodyWithResponse request with any body - CreateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) - - CreateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, body CreateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) + return req, nil +} - // GetStatusPageIncidentWithResponse request - GetStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageIncidentResponse, error) +// NewExportStatusPageSubscribersRequest generates requests for ExportStatusPageSubscribers +func NewExportStatusPageSubscribersRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error - // UpdateStatusPageIncidentWithBodyWithResponse request with any body - UpdateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) + var pathParam0 string - UpdateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body UpdateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - // CreateStatusPageIncidentUpdateWithBodyWithResponse request with any body - CreateStatusPageIncidentUpdateWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - CreateStatusPageIncidentUpdateWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body CreateStatusPageIncidentUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) + operationPath := fmt.Sprintf("/status-pages/%s/subscribers/export", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // GetStatusPageLayoutWithResponse request - GetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLayoutResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // SetStatusPageLayoutWithBodyWithResponse request with any body - SetStatusPageLayoutWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } - SetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLayoutJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) + return req, nil +} - // DeleteStatusPageLogoWithResponse request - DeleteStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageLogoResponse, error) +// NewDeleteStatusPageSubscriberRequest generates requests for DeleteStatusPageSubscriber +func NewDeleteStatusPageSubscriberRequest(server string, id openapi_types.UUID, subscriberId openapi_types.UUID) (*http.Request, error) { + var err error - // GetStatusPageLogoWithResponse request - GetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLogoResponse, error) + var pathParam0 string - // SetStatusPageLogoWithBodyWithResponse request with any body - SetStatusPageLogoWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - SetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLogoJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) + var pathParam1 string - // PreviewStatusPageWithResponse request - PreviewStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PreviewStatusPageResponse, error) + pathParam1, err = runtime.StyleParamWithOptions("simple", false, "subscriberId", subscriberId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err + } - // CreateStatusPagePreviewLinkWithResponse request - CreateStatusPagePreviewLinkWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CreateStatusPagePreviewLinkResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // PublishStatusPageWithResponse request - PublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PublishStatusPageResponse, error) + operationPath := fmt.Sprintf("/status-pages/%s/subscribers/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // ListStatusPageSubscribersWithResponse request - ListStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageSubscribersParams, reqEditors ...RequestEditorFn) (*ListStatusPageSubscribersResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // CountStatusPageSubscribersWithResponse request - CountStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CountStatusPageSubscribersResponse, error) + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } - // ExportStatusPageSubscribersWithResponse request - ExportStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ExportStatusPageSubscribersResponse, error) + return req, nil +} - // DeleteStatusPageSubscriberWithResponse request - DeleteStatusPageSubscriberWithResponse(ctx context.Context, id openapi_types.UUID, subscriberId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageSubscriberResponse, error) +// NewUnpublishStatusPageRequest generates requests for UnpublishStatusPage +func NewUnpublishStatusPageRequest(server string, id openapi_types.UUID) (*http.Request, error) { + var err error - // UnpublishStatusPageWithResponse request - UnpublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*UnpublishStatusPageResponse, error) -} + var pathParam0 string -type ListAlertChannelsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoAlertChannel `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: "uuid"}) + if err != nil { + return nil, err } - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem -} -// Status returns HTTPResponse.Status -func (r ListAlertChannelsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r ListAlertChannelsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/status-pages/%s/unpublish", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return 0 -} -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListAlertChannelsResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return "" -} - -type CreateAlertChannelResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *DtoAlertChannelWithSecret - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem -} -// Status returns HTTPResponse.Status -func (r CreateAlertChannelResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r CreateAlertChannelResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 + return req, nil } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateAlertChannelResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } } - return "" + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil } -type DeleteAlertChannelResponse struct { - Body []byte - HTTPResponse *http.Response - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface } -// Status returns HTTPResponse.Status -func (r DeleteAlertChannelResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err } - return http.StatusText(0) + return &ClientWithResponses{client}, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteAlertChannelResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil } - return 0 } -// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteAlertChannelResponse) ContentType() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Header.Get("Content-Type") - } - return "" -} +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // ListAlertChannelsWithResponse request + ListAlertChannelsWithResponse(ctx context.Context, params *ListAlertChannelsParams, reqEditors ...RequestEditorFn) (*ListAlertChannelsResponse, error) -type GetAlertChannelResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DtoAlertChannel - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem -} + // CreateAlertChannelWithBodyWithResponse request with any body + CreateAlertChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) -// Status returns HTTPResponse.Status -func (r GetAlertChannelResponse) Status() string { + CreateAlertChannelWithResponse(ctx context.Context, body CreateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) + + // DeleteAlertChannelWithResponse request + DeleteAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAlertChannelResponse, error) + + // GetAlertChannelWithResponse request + GetAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAlertChannelResponse, error) + + // UpdateAlertChannelWithBodyWithResponse request with any body + UpdateAlertChannelWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) + + UpdateAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) + + // ListAlertChannelDeliveriesWithResponse request + ListAlertChannelDeliveriesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListAlertChannelDeliveriesParams, reqEditors ...RequestEditorFn) (*ListAlertChannelDeliveriesResponse, error) + + // TestAlertChannelWithResponse request + TestAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*TestAlertChannelResponse, error) + + // SendAlertChannelVerificationWithResponse request + SendAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*SendAlertChannelVerificationResponse, error) + + // ConfirmAlertChannelVerificationWithBodyWithResponse request with any body + ConfirmAlertChannelVerificationWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) + + ConfirmAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, body ConfirmAlertChannelVerificationJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) + + // ListIncidentsWithResponse request + ListIncidentsWithResponse(ctx context.Context, params *ListIncidentsParams, reqEditors ...RequestEditorFn) (*ListIncidentsResponse, error) + + // GetIncidentSummaryWithResponse request + GetIncidentSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetIncidentSummaryResponse, error) + + // GetIncidentWithResponse request + GetIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetIncidentResponse, error) + + // AcknowledgeIncidentWithResponse request + AcknowledgeIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*AcknowledgeIncidentResponse, error) + + // ListMaintenanceWindowsWithResponse request + ListMaintenanceWindowsWithResponse(ctx context.Context, params *ListMaintenanceWindowsParams, reqEditors ...RequestEditorFn) (*ListMaintenanceWindowsResponse, error) + + // CreateMaintenanceWindowWithBodyWithResponse request with any body + CreateMaintenanceWindowWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMaintenanceWindowResponse, error) + + CreateMaintenanceWindowWithResponse(ctx context.Context, body CreateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMaintenanceWindowResponse, error) + + // GetMaintenanceTargetsWithResponse request + GetMaintenanceTargetsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMaintenanceTargetsResponse, error) + + // DeleteMaintenanceWindowWithResponse request + DeleteMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteMaintenanceWindowResponse, error) + + // GetMaintenanceWindowWithResponse request + GetMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMaintenanceWindowResponse, error) + + // UpdateMaintenanceWindowWithBodyWithResponse request with any body + UpdateMaintenanceWindowWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMaintenanceWindowResponse, error) + + UpdateMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMaintenanceWindowResponse, error) + + // CancelMaintenanceWindowWithResponse request + CancelMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CancelMaintenanceWindowResponse, error) + + // FinishMaintenanceWindowWithResponse request + FinishMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*FinishMaintenanceWindowResponse, error) + + // ListMonitorsWithResponse request + ListMonitorsWithResponse(ctx context.Context, params *ListMonitorsParams, reqEditors ...RequestEditorFn) (*ListMonitorsResponse, error) + + // CreateMonitorWithBodyWithResponse request with any body + CreateMonitorWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) + + CreateMonitorWithResponse(ctx context.Context, body CreateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) + + // ApplyMonitorBulkActionWithBodyWithResponse request with any body + ApplyMonitorBulkActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) + + ApplyMonitorBulkActionWithResponse(ctx context.Context, body ApplyMonitorBulkActionJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) + + // DeleteMonitorWithResponse request + DeleteMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteMonitorResponse, error) + + // GetMonitorWithResponse request + GetMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorResponse, error) + + // UpdateMonitorWithBodyWithResponse request with any body + UpdateMonitorWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) + + UpdateMonitorWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) + + // GetMonitorAlertsWithResponse request + GetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorAlertsResponse, error) + + // SetMonitorAlertsWithBodyWithResponse request with any body + SetMonitorAlertsWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) + + SetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, body SetMonitorAlertsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) + + // GetMonitorAvailabilityWithResponse request + GetMonitorAvailabilityWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorAvailabilityParams, reqEditors ...RequestEditorFn) (*GetMonitorAvailabilityResponse, error) + + // GetMonitorCertificateWithResponse request + GetMonitorCertificateWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorCertificateResponse, error) + + // RunMonitorCheckWithResponse request + RunMonitorCheckWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*RunMonitorCheckResponse, error) + + // PauseMonitorWithResponse request + PauseMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PauseMonitorResponse, error) + + // ListMonitorResultsWithResponse request + ListMonitorResultsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorResultsParams, reqEditors ...RequestEditorFn) (*ListMonitorResultsResponse, error) + + // ResumeMonitorWithResponse request + ResumeMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ResumeMonitorResponse, error) + + // GetMonitorStatsWithResponse request + GetMonitorStatsWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorStatsParams, reqEditors ...RequestEditorFn) (*GetMonitorStatsResponse, error) + + // ListMonitorStatusChangesWithResponse request + ListMonitorStatusChangesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorStatusChangesParams, reqEditors ...RequestEditorFn) (*ListMonitorStatusChangesResponse, error) + + // ListStatusPagesWithResponse request + ListStatusPagesWithResponse(ctx context.Context, params *ListStatusPagesParams, reqEditors ...RequestEditorFn) (*ListStatusPagesResponse, error) + + // CreateStatusPageWithBodyWithResponse request with any body + CreateStatusPageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) + + CreateStatusPageWithResponse(ctx context.Context, body CreateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) + + // DeleteStatusPageWithResponse request + DeleteStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageResponse, error) + + // GetStatusPageWithResponse request + GetStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageResponse, error) + + // UpdateStatusPageWithBodyWithResponse request with any body + UpdateStatusPageWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) + + UpdateStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) + + // DeleteStatusPageDomainWithResponse request + DeleteStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageDomainResponse, error) + + // GetStatusPageDomainWithResponse request + GetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageDomainResponse, error) + + // SetStatusPageDomainWithBodyWithResponse request with any body + SetStatusPageDomainWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) + + SetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) + + // ListStatusPageIncidentsWithResponse request + ListStatusPageIncidentsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageIncidentsParams, reqEditors ...RequestEditorFn) (*ListStatusPageIncidentsResponse, error) + + // CreateStatusPageIncidentWithBodyWithResponse request with any body + CreateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) + + CreateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, body CreateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) + + // GetStatusPageIncidentWithResponse request + GetStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageIncidentResponse, error) + + // UpdateStatusPageIncidentWithBodyWithResponse request with any body + UpdateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) + + UpdateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body UpdateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) + + // CreateStatusPageIncidentUpdateWithBodyWithResponse request with any body + CreateStatusPageIncidentUpdateWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) + + CreateStatusPageIncidentUpdateWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body CreateStatusPageIncidentUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) + + // GetStatusPageLayoutWithResponse request + GetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLayoutResponse, error) + + // SetStatusPageLayoutWithBodyWithResponse request with any body + SetStatusPageLayoutWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) + + SetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLayoutJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) + + // DeleteStatusPageLogoWithResponse request + DeleteStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageLogoResponse, error) + + // GetStatusPageLogoWithResponse request + GetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLogoResponse, error) + + // SetStatusPageLogoWithBodyWithResponse request with any body + SetStatusPageLogoWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) + + SetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLogoJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) + + // PreviewStatusPageWithResponse request + PreviewStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PreviewStatusPageResponse, error) + + // CreateStatusPagePreviewLinkWithResponse request + CreateStatusPagePreviewLinkWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CreateStatusPagePreviewLinkResponse, error) + + // PublishStatusPageWithResponse request + PublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PublishStatusPageResponse, error) + + // ListStatusPageSubscribersWithResponse request + ListStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageSubscribersParams, reqEditors ...RequestEditorFn) (*ListStatusPageSubscribersResponse, error) + + // CountStatusPageSubscribersWithResponse request + CountStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CountStatusPageSubscribersResponse, error) + + // ExportStatusPageSubscribersWithResponse request + ExportStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ExportStatusPageSubscribersResponse, error) + + // DeleteStatusPageSubscriberWithResponse request + DeleteStatusPageSubscriberWithResponse(ctx context.Context, id openapi_types.UUID, subscriberId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageSubscriberResponse, error) + + // UnpublishStatusPageWithResponse request + UnpublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*UnpublishStatusPageResponse, error) +} + +type ListAlertChannelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoAlertChannel `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem +} + +// Status returns HTTPResponse.Status +func (r ListAlertChannelsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8040,7 +9111,7 @@ func (r GetAlertChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetAlertChannelResponse) StatusCode() int { +func (r ListAlertChannelsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8048,25 +9119,24 @@ func (r GetAlertChannelResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetAlertChannelResponse) ContentType() string { +func (r ListAlertChannelsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateAlertChannelResponse struct { +type CreateAlertChannelResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoAlertChannelWithSecret + JSON201 *DtoAlertChannelWithSecret JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem - JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r UpdateAlertChannelResponse) Status() string { +func (r CreateAlertChannelResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8074,7 +9144,7 @@ func (r UpdateAlertChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateAlertChannelResponse) StatusCode() int { +func (r CreateAlertChannelResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8082,29 +9152,23 @@ func (r UpdateAlertChannelResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateAlertChannelResponse) ContentType() string { +func (r CreateAlertChannelResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListAlertChannelDeliveriesResponse struct { +type DeleteAlertChannelResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoChannelDelivery `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` - } - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ListAlertChannelDeliveriesResponse) Status() string { +func (r DeleteAlertChannelResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8112,7 +9176,7 @@ func (r ListAlertChannelDeliveriesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListAlertChannelDeliveriesResponse) StatusCode() int { +func (r DeleteAlertChannelResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8120,19 +9184,124 @@ func (r ListAlertChannelDeliveriesResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListAlertChannelDeliveriesResponse) ContentType() string { +func (r DeleteAlertChannelResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type TestAlertChannelResponse struct { +type GetAlertChannelResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoAlertChannelTestResult + JSON200 *DtoAlertChannel JSON401 *ResponseProblem - JSON402 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem +} + +// Status returns HTTPResponse.Status +func (r GetAlertChannelResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAlertChannelResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r GetAlertChannelResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type UpdateAlertChannelResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DtoAlertChannelWithSecret + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem +} + +// Status returns HTTPResponse.Status +func (r UpdateAlertChannelResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateAlertChannelResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r UpdateAlertChannelResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ListAlertChannelDeliveriesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoChannelDelivery `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem +} + +// Status returns HTTPResponse.Status +func (r ListAlertChannelDeliveriesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListAlertChannelDeliveriesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListAlertChannelDeliveriesResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type TestAlertChannelResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DtoAlertChannelTestResult + JSON401 *ResponseProblem + JSON402 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem JSON409 *ResponseProblem @@ -8368,12 +9537,12 @@ func (r AcknowledgeIncidentResponse) ContentType() string { return "" } -type ListMonitorsResponse struct { +type ListMaintenanceWindowsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoMonitor `json:"list"` + List []DtoMaintenanceWindow `json:"list"` Meta ResponseAPIResponsePaginationMeta `json:"meta"` } JSON400 *ResponseProblem @@ -8382,7 +9551,7 @@ type ListMonitorsResponse struct { } // Status returns HTTPResponse.Status -func (r ListMonitorsResponse) Status() string { +func (r ListMaintenanceWindowsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8390,7 +9559,7 @@ func (r ListMonitorsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListMonitorsResponse) StatusCode() int { +func (r ListMaintenanceWindowsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8398,26 +9567,26 @@ func (r ListMonitorsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListMonitorsResponse) ContentType() string { +func (r ListMaintenanceWindowsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateMonitorResponse struct { +type CreateMaintenanceWindowResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *DtoMonitor + JSON201 *DtoMaintenanceWindow JSON400 *ResponseProblem JSON401 *ResponseProblem - JSON402 *ResponseProblem JSON403 *ResponseProblem + JSON422 *ResponseProblem JSON503 *ResponseProblem } // Status returns HTTPResponse.Status -func (r CreateMonitorResponse) Status() string { +func (r CreateMaintenanceWindowResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8425,7 +9594,7 @@ func (r CreateMonitorResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateMonitorResponse) StatusCode() int { +func (r CreateMaintenanceWindowResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8433,26 +9602,24 @@ func (r CreateMonitorResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateMonitorResponse) ContentType() string { +func (r CreateMaintenanceWindowResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ApplyMonitorBulkActionResponse struct { +type GetMaintenanceTargetsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitorBulkResult - JSON400 *ResponseProblem + JSON200 *DtoMaintenanceTargets JSON401 *ResponseProblem JSON403 *ResponseProblem - JSON429 *ResponseProblem JSON503 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ApplyMonitorBulkActionResponse) Status() string { +func (r GetMaintenanceTargetsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8460,7 +9627,7 @@ func (r ApplyMonitorBulkActionResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ApplyMonitorBulkActionResponse) StatusCode() int { +func (r GetMaintenanceTargetsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8468,14 +9635,14 @@ func (r ApplyMonitorBulkActionResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ApplyMonitorBulkActionResponse) ContentType() string { +func (r GetMaintenanceTargetsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteMonitorResponse struct { +type DeleteMaintenanceWindowResponse struct { Body []byte HTTPResponse *http.Response JSON401 *ResponseProblem @@ -8485,7 +9652,7 @@ type DeleteMonitorResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteMonitorResponse) Status() string { +func (r DeleteMaintenanceWindowResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8493,7 +9660,7 @@ func (r DeleteMonitorResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteMonitorResponse) StatusCode() int { +func (r DeleteMaintenanceWindowResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8501,24 +9668,24 @@ func (r DeleteMonitorResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteMonitorResponse) ContentType() string { +func (r DeleteMaintenanceWindowResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetMonitorResponse struct { +type GetMaintenanceWindowResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitor + JSON200 *DtoMaintenanceWindow JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetMonitorResponse) Status() string { +func (r GetMaintenanceWindowResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8526,7 +9693,7 @@ func (r GetMonitorResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetMonitorResponse) StatusCode() int { +func (r GetMaintenanceWindowResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8534,26 +9701,28 @@ func (r GetMonitorResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetMonitorResponse) ContentType() string { +func (r GetMaintenanceWindowResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateMonitorResponse struct { +type UpdateMaintenanceWindowResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitor + JSON200 *DtoMaintenanceWindow JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem + JSON409 *ResponseProblem + JSON422 *ResponseProblem JSON503 *ResponseProblem } // Status returns HTTPResponse.Status -func (r UpdateMonitorResponse) Status() string { +func (r UpdateMaintenanceWindowResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8561,7 +9730,7 @@ func (r UpdateMonitorResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateMonitorResponse) StatusCode() int { +func (r UpdateMaintenanceWindowResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8569,24 +9738,25 @@ func (r UpdateMonitorResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateMonitorResponse) ContentType() string { +func (r UpdateMaintenanceWindowResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetMonitorAlertsResponse struct { +type CancelMaintenanceWindowResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitorAlerts + JSON200 *DtoMaintenanceWindow JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem + JSON409 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetMonitorAlertsResponse) Status() string { +func (r CancelMaintenanceWindowResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8594,7 +9764,7 @@ func (r GetMonitorAlertsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetMonitorAlertsResponse) StatusCode() int { +func (r CancelMaintenanceWindowResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8602,25 +9772,25 @@ func (r GetMonitorAlertsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetMonitorAlertsResponse) ContentType() string { +func (r CancelMaintenanceWindowResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type SetMonitorAlertsResponse struct { +type FinishMaintenanceWindowResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitorAlerts - JSON400 *ResponseProblem + JSON200 *DtoMaintenanceWindow JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem + JSON409 *ResponseProblem } // Status returns HTTPResponse.Status -func (r SetMonitorAlertsResponse) Status() string { +func (r FinishMaintenanceWindowResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8628,7 +9798,7 @@ func (r SetMonitorAlertsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SetMonitorAlertsResponse) StatusCode() int { +func (r FinishMaintenanceWindowResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8636,25 +9806,28 @@ func (r SetMonitorAlertsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r SetMonitorAlertsResponse) ContentType() string { +func (r FinishMaintenanceWindowResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetMonitorAvailabilityResponse struct { +type ListMonitorsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoAvailability - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON200 *struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoMonitor `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetMonitorAvailabilityResponse) Status() string { +func (r ListMonitorsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8662,7 +9835,7 @@ func (r GetMonitorAvailabilityResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetMonitorAvailabilityResponse) StatusCode() int { +func (r ListMonitorsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8670,24 +9843,26 @@ func (r GetMonitorAvailabilityResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetMonitorAvailabilityResponse) ContentType() string { +func (r ListMonitorsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetMonitorCertificateResponse struct { +type CreateMonitorResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitorCertificate + JSON201 *DtoMonitor + JSON400 *ResponseProblem JSON401 *ResponseProblem + JSON402 *ResponseProblem JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON503 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetMonitorCertificateResponse) Status() string { +func (r CreateMonitorResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8695,7 +9870,7 @@ func (r GetMonitorCertificateResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetMonitorCertificateResponse) StatusCode() int { +func (r CreateMonitorResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8703,26 +9878,26 @@ func (r GetMonitorCertificateResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetMonitorCertificateResponse) ContentType() string { +func (r CreateMonitorResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type RunMonitorCheckResponse struct { +type ApplyMonitorBulkActionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoCheckResult + JSON200 *DtoMonitorBulkResult + JSON400 *ResponseProblem JSON401 *ResponseProblem - JSON402 *ResponseProblem JSON403 *ResponseProblem - JSON404 *ResponseProblem JSON429 *ResponseProblem + JSON503 *ResponseProblem } // Status returns HTTPResponse.Status -func (r RunMonitorCheckResponse) Status() string { +func (r ApplyMonitorBulkActionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8730,7 +9905,7 @@ func (r RunMonitorCheckResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r RunMonitorCheckResponse) StatusCode() int { +func (r ApplyMonitorBulkActionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8738,24 +9913,24 @@ func (r RunMonitorCheckResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r RunMonitorCheckResponse) ContentType() string { +func (r ApplyMonitorBulkActionResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type PauseMonitorResponse struct { +type DeleteMonitorResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitor JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem + JSON409 *ResponseProblem } // Status returns HTTPResponse.Status -func (r PauseMonitorResponse) Status() string { +func (r DeleteMonitorResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8763,7 +9938,7 @@ func (r PauseMonitorResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PauseMonitorResponse) StatusCode() int { +func (r DeleteMonitorResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8771,29 +9946,24 @@ func (r PauseMonitorResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r PauseMonitorResponse) ContentType() string { +func (r DeleteMonitorResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListMonitorResultsResponse struct { +type GetMonitorResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoCheckResult `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` - } - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON200 *DtoMonitor + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ListMonitorResultsResponse) Status() string { +func (r GetMonitorResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8801,7 +9971,7 @@ func (r ListMonitorResultsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListMonitorResultsResponse) StatusCode() int { +func (r GetMonitorResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8809,24 +9979,26 @@ func (r ListMonitorResultsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListMonitorResultsResponse) ContentType() string { +func (r GetMonitorResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ResumeMonitorResponse struct { +type UpdateMonitorResponse struct { Body []byte HTTPResponse *http.Response JSON200 *DtoMonitor + JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem + JSON503 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ResumeMonitorResponse) Status() string { +func (r UpdateMonitorResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8834,7 +10006,7 @@ func (r ResumeMonitorResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ResumeMonitorResponse) StatusCode() int { +func (r UpdateMonitorResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8842,25 +10014,24 @@ func (r ResumeMonitorResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ResumeMonitorResponse) ContentType() string { +func (r UpdateMonitorResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetMonitorStatsResponse struct { +type GetMonitorAlertsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoMonitorStats - JSON400 *ResponseProblem + JSON200 *DtoMonitorAlerts JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetMonitorStatsResponse) Status() string { +func (r GetMonitorAlertsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8868,7 +10039,7 @@ func (r GetMonitorStatsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetMonitorStatsResponse) StatusCode() int { +func (r GetMonitorAlertsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8876,29 +10047,25 @@ func (r GetMonitorStatsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetMonitorStatsResponse) ContentType() string { +func (r GetMonitorAlertsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListMonitorStatusChangesResponse struct { +type SetMonitorAlertsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoStatusChange `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` - } - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON200 *DtoMonitorAlerts + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ListMonitorStatusChangesResponse) Status() string { +func (r SetMonitorAlertsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8906,7 +10073,7 @@ func (r ListMonitorStatusChangesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListMonitorStatusChangesResponse) StatusCode() int { +func (r SetMonitorAlertsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8914,28 +10081,25 @@ func (r ListMonitorStatusChangesResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListMonitorStatusChangesResponse) ContentType() string { +func (r SetMonitorAlertsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListStatusPagesResponse struct { +type GetMonitorAvailabilityResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoStatusPage `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` - } - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem + JSON200 *DtoAvailability + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ListStatusPagesResponse) Status() string { +func (r GetMonitorAvailabilityResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8943,7 +10107,7 @@ func (r ListStatusPagesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListStatusPagesResponse) StatusCode() int { +func (r GetMonitorAvailabilityResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8951,26 +10115,24 @@ func (r ListStatusPagesResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListStatusPagesResponse) ContentType() string { +func (r GetMonitorAvailabilityResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateStatusPageResponse struct { +type GetMonitorCertificateResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *DtoStatusPage - JSON400 *ResponseProblem + JSON200 *DtoMonitorCertificate JSON401 *ResponseProblem - JSON402 *ResponseProblem JSON403 *ResponseProblem - JSON409 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r CreateStatusPageResponse) Status() string { +func (r GetMonitorCertificateResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -8978,7 +10140,7 @@ func (r CreateStatusPageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateStatusPageResponse) StatusCode() int { +func (r GetMonitorCertificateResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -8986,23 +10148,26 @@ func (r CreateStatusPageResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateStatusPageResponse) ContentType() string { +func (r GetMonitorCertificateResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteStatusPageResponse struct { +type RunMonitorCheckResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *DtoCheckResult JSON401 *ResponseProblem + JSON402 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem + JSON429 *ResponseProblem } // Status returns HTTPResponse.Status -func (r DeleteStatusPageResponse) Status() string { +func (r RunMonitorCheckResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9010,7 +10175,7 @@ func (r DeleteStatusPageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteStatusPageResponse) StatusCode() int { +func (r RunMonitorCheckResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9018,24 +10183,24 @@ func (r DeleteStatusPageResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteStatusPageResponse) ContentType() string { +func (r RunMonitorCheckResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetStatusPageResponse struct { +type PauseMonitorResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPage + JSON200 *DtoMonitor JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetStatusPageResponse) Status() string { +func (r PauseMonitorResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9043,7 +10208,7 @@ func (r GetStatusPageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetStatusPageResponse) StatusCode() int { +func (r PauseMonitorResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9051,26 +10216,29 @@ func (r GetStatusPageResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetStatusPageResponse) ContentType() string { +func (r PauseMonitorResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateStatusPageResponse struct { +type ListMonitorResultsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPage - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem - JSON409 *ResponseProblem + JSON200 *struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoCheckResult `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r UpdateStatusPageResponse) Status() string { +func (r ListMonitorResultsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9078,7 +10246,7 @@ func (r UpdateStatusPageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateStatusPageResponse) StatusCode() int { +func (r ListMonitorResultsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9086,23 +10254,24 @@ func (r UpdateStatusPageResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateStatusPageResponse) ContentType() string { +func (r ListMonitorResultsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteStatusPageDomainResponse struct { +type ResumeMonitorResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *DtoMonitor JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r DeleteStatusPageDomainResponse) Status() string { +func (r ResumeMonitorResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9110,7 +10279,7 @@ func (r DeleteStatusPageDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteStatusPageDomainResponse) StatusCode() int { +func (r ResumeMonitorResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9118,24 +10287,25 @@ func (r DeleteStatusPageDomainResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteStatusPageDomainResponse) ContentType() string { +func (r ResumeMonitorResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetStatusPageDomainResponse struct { +type GetMonitorStatsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageDomain + JSON200 *DtoMonitorStats + JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetStatusPageDomainResponse) Status() string { +func (r GetMonitorStatsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9143,7 +10313,7 @@ func (r GetStatusPageDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetStatusPageDomainResponse) StatusCode() int { +func (r GetMonitorStatsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9151,28 +10321,29 @@ func (r GetStatusPageDomainResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetStatusPageDomainResponse) ContentType() string { +func (r GetMonitorStatsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type SetStatusPageDomainResponse struct { +type ListMonitorStatusChangesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageDomain - JSON400 *ResponseProblem - JSON401 *ResponseProblem - JSON402 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem - JSON409 *ResponseProblem - JSON503 *ResponseProblem + JSON200 *struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoStatusChange `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r SetStatusPageDomainResponse) Status() string { +func (r ListMonitorStatusChangesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9180,7 +10351,7 @@ func (r SetStatusPageDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SetStatusPageDomainResponse) StatusCode() int { +func (r ListMonitorStatusChangesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9188,29 +10359,28 @@ func (r SetStatusPageDomainResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r SetStatusPageDomainResponse) ContentType() string { +func (r ListMonitorStatusChangesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListStatusPageIncidentsResponse struct { +type ListStatusPagesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoStatusPageIncident `json:"list"` + List []DtoStatusPage `json:"list"` Meta ResponseAPIResponsePaginationMeta `json:"meta"` } JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem - JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ListStatusPageIncidentsResponse) Status() string { +func (r ListStatusPagesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9218,7 +10388,7 @@ func (r ListStatusPageIncidentsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListStatusPageIncidentsResponse) StatusCode() int { +func (r ListStatusPagesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9226,25 +10396,26 @@ func (r ListStatusPageIncidentsResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListStatusPageIncidentsResponse) ContentType() string { +func (r ListStatusPagesResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateStatusPageIncidentResponse struct { +type CreateStatusPageResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *DtoStatusPageIncident + JSON201 *DtoStatusPage JSON400 *ResponseProblem JSON401 *ResponseProblem + JSON402 *ResponseProblem JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON409 *ResponseProblem } // Status returns HTTPResponse.Status -func (r CreateStatusPageIncidentResponse) Status() string { +func (r CreateStatusPageResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9252,7 +10423,7 @@ func (r CreateStatusPageIncidentResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateStatusPageIncidentResponse) StatusCode() int { +func (r CreateStatusPageResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9260,24 +10431,23 @@ func (r CreateStatusPageIncidentResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateStatusPageIncidentResponse) ContentType() string { +func (r CreateStatusPageResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetStatusPageIncidentResponse struct { +type DeleteStatusPageResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageIncident JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetStatusPageIncidentResponse) Status() string { +func (r DeleteStatusPageResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9285,7 +10455,7 @@ func (r GetStatusPageIncidentResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetStatusPageIncidentResponse) StatusCode() int { +func (r DeleteStatusPageResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9293,25 +10463,24 @@ func (r GetStatusPageIncidentResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetStatusPageIncidentResponse) ContentType() string { +func (r DeleteStatusPageResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UpdateStatusPageIncidentResponse struct { +type GetStatusPageResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageIncident - JSON400 *ResponseProblem + JSON200 *DtoStatusPage JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r UpdateStatusPageIncidentResponse) Status() string { +func (r GetStatusPageResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9319,7 +10488,7 @@ func (r UpdateStatusPageIncidentResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateStatusPageIncidentResponse) StatusCode() int { +func (r GetStatusPageResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9327,17 +10496,17 @@ func (r UpdateStatusPageIncidentResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UpdateStatusPageIncidentResponse) ContentType() string { +func (r GetStatusPageResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateStatusPageIncidentUpdateResponse struct { +type UpdateStatusPageResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *DtoStatusPageIncident + JSON200 *DtoStatusPage JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem @@ -9346,7 +10515,7 @@ type CreateStatusPageIncidentUpdateResponse struct { } // Status returns HTTPResponse.Status -func (r CreateStatusPageIncidentUpdateResponse) Status() string { +func (r UpdateStatusPageResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9354,7 +10523,7 @@ func (r CreateStatusPageIncidentUpdateResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateStatusPageIncidentUpdateResponse) StatusCode() int { +func (r UpdateStatusPageResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9362,24 +10531,23 @@ func (r CreateStatusPageIncidentUpdateResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateStatusPageIncidentUpdateResponse) ContentType() string { +func (r UpdateStatusPageResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetStatusPageLayoutResponse struct { +type DeleteStatusPageDomainResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageLayout JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetStatusPageLayoutResponse) Status() string { +func (r DeleteStatusPageDomainResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9387,7 +10555,7 @@ func (r GetStatusPageLayoutResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetStatusPageLayoutResponse) StatusCode() int { +func (r DeleteStatusPageDomainResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9395,25 +10563,24 @@ func (r GetStatusPageLayoutResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetStatusPageLayoutResponse) ContentType() string { +func (r DeleteStatusPageDomainResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type SetStatusPageLayoutResponse struct { +type GetStatusPageDomainResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageLayout - JSON400 *ResponseProblem + JSON200 *DtoStatusPageDomain JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r SetStatusPageLayoutResponse) Status() string { +func (r GetStatusPageDomainResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9421,7 +10588,7 @@ func (r SetStatusPageLayoutResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SetStatusPageLayoutResponse) StatusCode() int { +func (r GetStatusPageDomainResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9429,23 +10596,28 @@ func (r SetStatusPageLayoutResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r SetStatusPageLayoutResponse) ContentType() string { +func (r GetStatusPageDomainResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteStatusPageLogoResponse struct { +type SetStatusPageDomainResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *DtoStatusPageDomain + JSON400 *ResponseProblem JSON401 *ResponseProblem + JSON402 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem + JSON409 *ResponseProblem + JSON503 *ResponseProblem } // Status returns HTTPResponse.Status -func (r DeleteStatusPageLogoResponse) Status() string { +func (r SetStatusPageDomainResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9453,7 +10625,7 @@ func (r DeleteStatusPageLogoResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteStatusPageLogoResponse) StatusCode() int { +func (r SetStatusPageDomainResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9461,24 +10633,29 @@ func (r DeleteStatusPageLogoResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteStatusPageLogoResponse) ContentType() string { +func (r SetStatusPageDomainResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type GetStatusPageLogoResponse struct { +type ListStatusPageIncidentsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageLogo - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON200 *struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoStatusPageIncident `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + JSON400 *ResponseProblem + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r GetStatusPageLogoResponse) Status() string { +func (r ListStatusPageIncidentsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9486,7 +10663,7 @@ func (r GetStatusPageLogoResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetStatusPageLogoResponse) StatusCode() int { +func (r ListStatusPageIncidentsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9494,17 +10671,17 @@ func (r GetStatusPageLogoResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r GetStatusPageLogoResponse) ContentType() string { +func (r ListStatusPageIncidentsResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type SetStatusPageLogoResponse struct { +type CreateStatusPageIncidentResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageLogo + JSON201 *DtoStatusPageIncident JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem @@ -9512,7 +10689,7 @@ type SetStatusPageLogoResponse struct { } // Status returns HTTPResponse.Status -func (r SetStatusPageLogoResponse) Status() string { +func (r CreateStatusPageIncidentResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9520,7 +10697,7 @@ func (r SetStatusPageLogoResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SetStatusPageLogoResponse) StatusCode() int { +func (r CreateStatusPageIncidentResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9528,24 +10705,24 @@ func (r SetStatusPageLogoResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r SetStatusPageLogoResponse) ContentType() string { +func (r CreateStatusPageIncidentResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type PreviewStatusPageResponse struct { +type GetStatusPageIncidentResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoPublicStatusPreview + JSON200 *DtoStatusPageIncident JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r PreviewStatusPageResponse) Status() string { +func (r GetStatusPageIncidentResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9553,7 +10730,7 @@ func (r PreviewStatusPageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PreviewStatusPageResponse) StatusCode() int { +func (r GetStatusPageIncidentResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9561,24 +10738,25 @@ func (r PreviewStatusPageResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r PreviewStatusPageResponse) ContentType() string { +func (r GetStatusPageIncidentResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CreateStatusPagePreviewLinkResponse struct { +type UpdateStatusPageIncidentResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPagePreviewLink + JSON200 *DtoStatusPageIncident + JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r CreateStatusPagePreviewLinkResponse) Status() string { +func (r UpdateStatusPageIncidentResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9586,7 +10764,7 @@ func (r CreateStatusPagePreviewLinkResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateStatusPagePreviewLinkResponse) StatusCode() int { +func (r UpdateStatusPageIncidentResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9594,26 +10772,26 @@ func (r CreateStatusPagePreviewLinkResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CreateStatusPagePreviewLinkResponse) ContentType() string { +func (r UpdateStatusPageIncidentResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type PublishStatusPageResponse struct { +type CreateStatusPageIncidentUpdateResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPage + JSON201 *DtoStatusPageIncident + JSON400 *ResponseProblem JSON401 *ResponseProblem - JSON402 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem JSON409 *ResponseProblem } // Status returns HTTPResponse.Status -func (r PublishStatusPageResponse) Status() string { +func (r CreateStatusPageIncidentUpdateResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9621,7 +10799,7 @@ func (r PublishStatusPageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PublishStatusPageResponse) StatusCode() int { +func (r CreateStatusPageIncidentUpdateResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9629,28 +10807,24 @@ func (r PublishStatusPageResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r PublishStatusPageResponse) ContentType() string { +func (r CreateStatusPageIncidentUpdateResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ListStatusPageSubscribersResponse struct { +type GetStatusPageLayoutResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoStatusPageSubscriber `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` - } - JSON401 *ResponseProblem - JSON403 *ResponseProblem - JSON404 *ResponseProblem + JSON200 *DtoStatusPageLayout + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ListStatusPageSubscribersResponse) Status() string { +func (r GetStatusPageLayoutResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9658,7 +10832,7 @@ func (r ListStatusPageSubscribersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListStatusPageSubscribersResponse) StatusCode() int { +func (r GetStatusPageLayoutResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9666,24 +10840,25 @@ func (r ListStatusPageSubscribersResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ListStatusPageSubscribersResponse) ContentType() string { +func (r GetStatusPageLayoutResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type CountStatusPageSubscribersResponse struct { +type SetStatusPageLayoutResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPageSubscriberCount + JSON200 *DtoStatusPageLayout + JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r CountStatusPageSubscribersResponse) Status() string { +func (r SetStatusPageLayoutResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9691,7 +10866,7 @@ func (r CountStatusPageSubscribersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CountStatusPageSubscribersResponse) StatusCode() int { +func (r SetStatusPageLayoutResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9699,20 +10874,23 @@ func (r CountStatusPageSubscribersResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r CountStatusPageSubscribersResponse) ContentType() string { +func (r SetStatusPageLayoutResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type ExportStatusPageSubscribersResponse struct { +type DeleteStatusPageLogoResponse struct { Body []byte HTTPResponse *http.Response + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r ExportStatusPageSubscribersResponse) Status() string { +func (r DeleteStatusPageLogoResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9720,7 +10898,7 @@ func (r ExportStatusPageSubscribersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ExportStatusPageSubscribersResponse) StatusCode() int { +func (r DeleteStatusPageLogoResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9728,23 +10906,24 @@ func (r ExportStatusPageSubscribersResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r ExportStatusPageSubscribersResponse) ContentType() string { +func (r DeleteStatusPageLogoResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type DeleteStatusPageSubscriberResponse struct { +type GetStatusPageLogoResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *DtoStatusPageLogo JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r DeleteStatusPageSubscriberResponse) Status() string { +func (r GetStatusPageLogoResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9752,7 +10931,7 @@ func (r DeleteStatusPageSubscriberResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteStatusPageSubscriberResponse) StatusCode() int { +func (r GetStatusPageLogoResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9760,24 +10939,25 @@ func (r DeleteStatusPageSubscriberResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r DeleteStatusPageSubscriberResponse) ContentType() string { +func (r GetStatusPageLogoResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -type UnpublishStatusPageResponse struct { +type SetStatusPageLogoResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *DtoStatusPage + JSON200 *DtoStatusPageLogo + JSON400 *ResponseProblem JSON401 *ResponseProblem JSON403 *ResponseProblem JSON404 *ResponseProblem } // Status returns HTTPResponse.Status -func (r UnpublishStatusPageResponse) Status() string { +func (r SetStatusPageLogoResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -9785,7 +10965,7 @@ func (r UnpublishStatusPageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UnpublishStatusPageResponse) StatusCode() int { +func (r SetStatusPageLogoResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -9793,648 +10973,1423 @@ func (r UnpublishStatusPageResponse) StatusCode() int { } // ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers -func (r UnpublishStatusPageResponse) ContentType() string { +func (r SetStatusPageLogoResponse) ContentType() string { if r.HTTPResponse != nil { return r.HTTPResponse.Header.Get("Content-Type") } return "" } -// ListAlertChannelsWithResponse request returning *ListAlertChannelsResponse -func (c *ClientWithResponses) ListAlertChannelsWithResponse(ctx context.Context, params *ListAlertChannelsParams, reqEditors ...RequestEditorFn) (*ListAlertChannelsResponse, error) { - rsp, err := c.ListAlertChannels(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListAlertChannelsResponse(rsp) +type PreviewStatusPageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DtoPublicStatusPreview + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } -// CreateAlertChannelWithBodyWithResponse request with arbitrary body returning *CreateAlertChannelResponse -func (c *ClientWithResponses) CreateAlertChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) { - rsp, err := c.CreateAlertChannelWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err +// Status returns HTTPResponse.Status +func (r PreviewStatusPageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseCreateAlertChannelResponse(rsp) + return http.StatusText(0) } -func (c *ClientWithResponses) CreateAlertChannelWithResponse(ctx context.Context, body CreateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) { - rsp, err := c.CreateAlertChannel(ctx, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r PreviewStatusPageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseCreateAlertChannelResponse(rsp) + return 0 } -// DeleteAlertChannelWithResponse request returning *DeleteAlertChannelResponse -func (c *ClientWithResponses) DeleteAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAlertChannelResponse, error) { - rsp, err := c.DeleteAlertChannel(ctx, id, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PreviewStatusPageResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseDeleteAlertChannelResponse(rsp) + return "" } -// GetAlertChannelWithResponse request returning *GetAlertChannelResponse -func (c *ClientWithResponses) GetAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAlertChannelResponse, error) { - rsp, err := c.GetAlertChannel(ctx, id, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAlertChannelResponse(rsp) +type CreateStatusPagePreviewLinkResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DtoStatusPagePreviewLink + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } -// UpdateAlertChannelWithBodyWithResponse request with arbitrary body returning *UpdateAlertChannelResponse -func (c *ClientWithResponses) UpdateAlertChannelWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) { - rsp, err := c.UpdateAlertChannelWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err +// Status returns HTTPResponse.Status +func (r CreateStatusPagePreviewLinkResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseUpdateAlertChannelResponse(rsp) + return http.StatusText(0) } -func (c *ClientWithResponses) UpdateAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) { - rsp, err := c.UpdateAlertChannel(ctx, id, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r CreateStatusPagePreviewLinkResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseUpdateAlertChannelResponse(rsp) + return 0 } -// ListAlertChannelDeliveriesWithResponse request returning *ListAlertChannelDeliveriesResponse -func (c *ClientWithResponses) ListAlertChannelDeliveriesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListAlertChannelDeliveriesParams, reqEditors ...RequestEditorFn) (*ListAlertChannelDeliveriesResponse, error) { - rsp, err := c.ListAlertChannelDeliveries(ctx, id, params, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r CreateStatusPagePreviewLinkResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseListAlertChannelDeliveriesResponse(rsp) + return "" } -// TestAlertChannelWithResponse request returning *TestAlertChannelResponse -func (c *ClientWithResponses) TestAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*TestAlertChannelResponse, error) { - rsp, err := c.TestAlertChannel(ctx, id, reqEditors...) - if err != nil { - return nil, err - } - return ParseTestAlertChannelResponse(rsp) +type PublishStatusPageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DtoStatusPage + JSON401 *ResponseProblem + JSON402 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem + JSON409 *ResponseProblem } -// SendAlertChannelVerificationWithResponse request returning *SendAlertChannelVerificationResponse -func (c *ClientWithResponses) SendAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*SendAlertChannelVerificationResponse, error) { - rsp, err := c.SendAlertChannelVerification(ctx, id, reqEditors...) - if err != nil { - return nil, err +// Status returns HTTPResponse.Status +func (r PublishStatusPageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseSendAlertChannelVerificationResponse(rsp) + return http.StatusText(0) } -// ConfirmAlertChannelVerificationWithBodyWithResponse request with arbitrary body returning *ConfirmAlertChannelVerificationResponse -func (c *ClientWithResponses) ConfirmAlertChannelVerificationWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) { - rsp, err := c.ConfirmAlertChannelVerificationWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r PublishStatusPageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseConfirmAlertChannelVerificationResponse(rsp) + return 0 } -func (c *ClientWithResponses) ConfirmAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, body ConfirmAlertChannelVerificationJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) { - rsp, err := c.ConfirmAlertChannelVerification(ctx, id, body, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PublishStatusPageResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseConfirmAlertChannelVerificationResponse(rsp) + return "" } -// ListIncidentsWithResponse request returning *ListIncidentsResponse -func (c *ClientWithResponses) ListIncidentsWithResponse(ctx context.Context, params *ListIncidentsParams, reqEditors ...RequestEditorFn) (*ListIncidentsResponse, error) { - rsp, err := c.ListIncidents(ctx, params, reqEditors...) - if err != nil { - return nil, err +type ListStatusPageSubscribersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoStatusPageSubscriber `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` } - return ParseListIncidentsResponse(rsp) + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem } -// GetIncidentSummaryWithResponse request returning *GetIncidentSummaryResponse -func (c *ClientWithResponses) GetIncidentSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetIncidentSummaryResponse, error) { - rsp, err := c.GetIncidentSummary(ctx, reqEditors...) - if err != nil { - return nil, err +// Status returns HTTPResponse.Status +func (r ListStatusPageSubscribersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseGetIncidentSummaryResponse(rsp) + return http.StatusText(0) } -// GetIncidentWithResponse request returning *GetIncidentResponse -func (c *ClientWithResponses) GetIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetIncidentResponse, error) { - rsp, err := c.GetIncident(ctx, id, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r ListStatusPageSubscribersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseGetIncidentResponse(rsp) + return 0 } -// AcknowledgeIncidentWithResponse request returning *AcknowledgeIncidentResponse -func (c *ClientWithResponses) AcknowledgeIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*AcknowledgeIncidentResponse, error) { - rsp, err := c.AcknowledgeIncident(ctx, id, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ListStatusPageSubscribersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseAcknowledgeIncidentResponse(rsp) + return "" } -// ListMonitorsWithResponse request returning *ListMonitorsResponse -func (c *ClientWithResponses) ListMonitorsWithResponse(ctx context.Context, params *ListMonitorsParams, reqEditors ...RequestEditorFn) (*ListMonitorsResponse, error) { - rsp, err := c.ListMonitors(ctx, params, reqEditors...) - if err != nil { - return nil, err +type CountStatusPageSubscribersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DtoStatusPageSubscriberCount + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem +} + +// Status returns HTTPResponse.Status +func (r CountStatusPageSubscribersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseListMonitorsResponse(rsp) + return http.StatusText(0) } -// CreateMonitorWithBodyWithResponse request with arbitrary body returning *CreateMonitorResponse -func (c *ClientWithResponses) CreateMonitorWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) { - rsp, err := c.CreateMonitorWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r CountStatusPageSubscribersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseCreateMonitorResponse(rsp) + return 0 } -func (c *ClientWithResponses) CreateMonitorWithResponse(ctx context.Context, body CreateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) { - rsp, err := c.CreateMonitor(ctx, body, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r CountStatusPageSubscribersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseCreateMonitorResponse(rsp) + return "" } -// ApplyMonitorBulkActionWithBodyWithResponse request with arbitrary body returning *ApplyMonitorBulkActionResponse -func (c *ClientWithResponses) ApplyMonitorBulkActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) { - rsp, err := c.ApplyMonitorBulkActionWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err +type ExportStatusPageSubscribersResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r ExportStatusPageSubscribersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseApplyMonitorBulkActionResponse(rsp) + return http.StatusText(0) } -func (c *ClientWithResponses) ApplyMonitorBulkActionWithResponse(ctx context.Context, body ApplyMonitorBulkActionJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) { - rsp, err := c.ApplyMonitorBulkAction(ctx, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r ExportStatusPageSubscribersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseApplyMonitorBulkActionResponse(rsp) + return 0 } -// DeleteMonitorWithResponse request returning *DeleteMonitorResponse -func (c *ClientWithResponses) DeleteMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteMonitorResponse, error) { - rsp, err := c.DeleteMonitor(ctx, id, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ExportStatusPageSubscribersResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseDeleteMonitorResponse(rsp) + return "" } -// GetMonitorWithResponse request returning *GetMonitorResponse -func (c *ClientWithResponses) GetMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorResponse, error) { - rsp, err := c.GetMonitor(ctx, id, reqEditors...) - if err != nil { - return nil, err +type DeleteStatusPageSubscriberResponse struct { + Body []byte + HTTPResponse *http.Response + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem +} + +// Status returns HTTPResponse.Status +func (r DeleteStatusPageSubscriberResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseGetMonitorResponse(rsp) + return http.StatusText(0) } -// UpdateMonitorWithBodyWithResponse request with arbitrary body returning *UpdateMonitorResponse -func (c *ClientWithResponses) UpdateMonitorWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) { - rsp, err := c.UpdateMonitorWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteStatusPageSubscriberResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseUpdateMonitorResponse(rsp) + return 0 } -func (c *ClientWithResponses) UpdateMonitorWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) { - rsp, err := c.UpdateMonitor(ctx, id, body, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r DeleteStatusPageSubscriberResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseUpdateMonitorResponse(rsp) + return "" } -// GetMonitorAlertsWithResponse request returning *GetMonitorAlertsResponse -func (c *ClientWithResponses) GetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorAlertsResponse, error) { - rsp, err := c.GetMonitorAlerts(ctx, id, reqEditors...) - if err != nil { - return nil, err +type UnpublishStatusPageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DtoStatusPage + JSON401 *ResponseProblem + JSON403 *ResponseProblem + JSON404 *ResponseProblem +} + +// Status returns HTTPResponse.Status +func (r UnpublishStatusPageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status } - return ParseGetMonitorAlertsResponse(rsp) + return http.StatusText(0) } -// SetMonitorAlertsWithBodyWithResponse request with arbitrary body returning *SetMonitorAlertsResponse -func (c *ClientWithResponses) SetMonitorAlertsWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) { - rsp, err := c.SetMonitorAlertsWithBody(ctx, id, contentType, body, reqEditors...) - if err != nil { - return nil, err +// StatusCode returns HTTPResponse.StatusCode +func (r UnpublishStatusPageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode } - return ParseSetMonitorAlertsResponse(rsp) + return 0 } -func (c *ClientWithResponses) SetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, body SetMonitorAlertsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) { - rsp, err := c.SetMonitorAlerts(ctx, id, body, reqEditors...) - if err != nil { - return nil, err +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r UnpublishStatusPageResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") } - return ParseSetMonitorAlertsResponse(rsp) + return "" } -// GetMonitorAvailabilityWithResponse request returning *GetMonitorAvailabilityResponse -func (c *ClientWithResponses) GetMonitorAvailabilityWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorAvailabilityParams, reqEditors ...RequestEditorFn) (*GetMonitorAvailabilityResponse, error) { - rsp, err := c.GetMonitorAvailability(ctx, id, params, reqEditors...) +// ListAlertChannelsWithResponse request returning *ListAlertChannelsResponse +func (c *ClientWithResponses) ListAlertChannelsWithResponse(ctx context.Context, params *ListAlertChannelsParams, reqEditors ...RequestEditorFn) (*ListAlertChannelsResponse, error) { + rsp, err := c.ListAlertChannels(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseGetMonitorAvailabilityResponse(rsp) + return ParseListAlertChannelsResponse(rsp) } -// GetMonitorCertificateWithResponse request returning *GetMonitorCertificateResponse -func (c *ClientWithResponses) GetMonitorCertificateWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorCertificateResponse, error) { - rsp, err := c.GetMonitorCertificate(ctx, id, reqEditors...) +// CreateAlertChannelWithBodyWithResponse request with arbitrary body returning *CreateAlertChannelResponse +func (c *ClientWithResponses) CreateAlertChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) { + rsp, err := c.CreateAlertChannelWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetMonitorCertificateResponse(rsp) + return ParseCreateAlertChannelResponse(rsp) } -// RunMonitorCheckWithResponse request returning *RunMonitorCheckResponse -func (c *ClientWithResponses) RunMonitorCheckWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*RunMonitorCheckResponse, error) { - rsp, err := c.RunMonitorCheck(ctx, id, reqEditors...) +func (c *ClientWithResponses) CreateAlertChannelWithResponse(ctx context.Context, body CreateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAlertChannelResponse, error) { + rsp, err := c.CreateAlertChannel(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseRunMonitorCheckResponse(rsp) + return ParseCreateAlertChannelResponse(rsp) } -// PauseMonitorWithResponse request returning *PauseMonitorResponse -func (c *ClientWithResponses) PauseMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PauseMonitorResponse, error) { - rsp, err := c.PauseMonitor(ctx, id, reqEditors...) +// DeleteAlertChannelWithResponse request returning *DeleteAlertChannelResponse +func (c *ClientWithResponses) DeleteAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteAlertChannelResponse, error) { + rsp, err := c.DeleteAlertChannel(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParsePauseMonitorResponse(rsp) + return ParseDeleteAlertChannelResponse(rsp) } -// ListMonitorResultsWithResponse request returning *ListMonitorResultsResponse -func (c *ClientWithResponses) ListMonitorResultsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorResultsParams, reqEditors ...RequestEditorFn) (*ListMonitorResultsResponse, error) { - rsp, err := c.ListMonitorResults(ctx, id, params, reqEditors...) +// GetAlertChannelWithResponse request returning *GetAlertChannelResponse +func (c *ClientWithResponses) GetAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAlertChannelResponse, error) { + rsp, err := c.GetAlertChannel(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseListMonitorResultsResponse(rsp) + return ParseGetAlertChannelResponse(rsp) } -// ResumeMonitorWithResponse request returning *ResumeMonitorResponse -func (c *ClientWithResponses) ResumeMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ResumeMonitorResponse, error) { - rsp, err := c.ResumeMonitor(ctx, id, reqEditors...) +// UpdateAlertChannelWithBodyWithResponse request with arbitrary body returning *UpdateAlertChannelResponse +func (c *ClientWithResponses) UpdateAlertChannelWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) { + rsp, err := c.UpdateAlertChannelWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseResumeMonitorResponse(rsp) + return ParseUpdateAlertChannelResponse(rsp) } -// GetMonitorStatsWithResponse request returning *GetMonitorStatsResponse -func (c *ClientWithResponses) GetMonitorStatsWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorStatsParams, reqEditors ...RequestEditorFn) (*GetMonitorStatsResponse, error) { - rsp, err := c.GetMonitorStats(ctx, id, params, reqEditors...) +func (c *ClientWithResponses) UpdateAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateAlertChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAlertChannelResponse, error) { + rsp, err := c.UpdateAlertChannel(ctx, id, body, reqEditors...) if err != nil { return nil, err } - return ParseGetMonitorStatsResponse(rsp) + return ParseUpdateAlertChannelResponse(rsp) } -// ListMonitorStatusChangesWithResponse request returning *ListMonitorStatusChangesResponse -func (c *ClientWithResponses) ListMonitorStatusChangesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorStatusChangesParams, reqEditors ...RequestEditorFn) (*ListMonitorStatusChangesResponse, error) { - rsp, err := c.ListMonitorStatusChanges(ctx, id, params, reqEditors...) +// ListAlertChannelDeliveriesWithResponse request returning *ListAlertChannelDeliveriesResponse +func (c *ClientWithResponses) ListAlertChannelDeliveriesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListAlertChannelDeliveriesParams, reqEditors ...RequestEditorFn) (*ListAlertChannelDeliveriesResponse, error) { + rsp, err := c.ListAlertChannelDeliveries(ctx, id, params, reqEditors...) if err != nil { return nil, err } - return ParseListMonitorStatusChangesResponse(rsp) + return ParseListAlertChannelDeliveriesResponse(rsp) } -// ListStatusPagesWithResponse request returning *ListStatusPagesResponse -func (c *ClientWithResponses) ListStatusPagesWithResponse(ctx context.Context, params *ListStatusPagesParams, reqEditors ...RequestEditorFn) (*ListStatusPagesResponse, error) { - rsp, err := c.ListStatusPages(ctx, params, reqEditors...) +// TestAlertChannelWithResponse request returning *TestAlertChannelResponse +func (c *ClientWithResponses) TestAlertChannelWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*TestAlertChannelResponse, error) { + rsp, err := c.TestAlertChannel(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseListStatusPagesResponse(rsp) + return ParseTestAlertChannelResponse(rsp) } -// CreateStatusPageWithBodyWithResponse request with arbitrary body returning *CreateStatusPageResponse -func (c *ClientWithResponses) CreateStatusPageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) { - rsp, err := c.CreateStatusPageWithBody(ctx, contentType, body, reqEditors...) +// SendAlertChannelVerificationWithResponse request returning *SendAlertChannelVerificationResponse +func (c *ClientWithResponses) SendAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*SendAlertChannelVerificationResponse, error) { + rsp, err := c.SendAlertChannelVerification(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseCreateStatusPageResponse(rsp) + return ParseSendAlertChannelVerificationResponse(rsp) } -func (c *ClientWithResponses) CreateStatusPageWithResponse(ctx context.Context, body CreateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) { - rsp, err := c.CreateStatusPage(ctx, body, reqEditors...) +// ConfirmAlertChannelVerificationWithBodyWithResponse request with arbitrary body returning *ConfirmAlertChannelVerificationResponse +func (c *ClientWithResponses) ConfirmAlertChannelVerificationWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) { + rsp, err := c.ConfirmAlertChannelVerificationWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateStatusPageResponse(rsp) + return ParseConfirmAlertChannelVerificationResponse(rsp) } -// DeleteStatusPageWithResponse request returning *DeleteStatusPageResponse -func (c *ClientWithResponses) DeleteStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageResponse, error) { - rsp, err := c.DeleteStatusPage(ctx, id, reqEditors...) +func (c *ClientWithResponses) ConfirmAlertChannelVerificationWithResponse(ctx context.Context, id openapi_types.UUID, body ConfirmAlertChannelVerificationJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfirmAlertChannelVerificationResponse, error) { + rsp, err := c.ConfirmAlertChannelVerification(ctx, id, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteStatusPageResponse(rsp) + return ParseConfirmAlertChannelVerificationResponse(rsp) } -// GetStatusPageWithResponse request returning *GetStatusPageResponse -func (c *ClientWithResponses) GetStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageResponse, error) { - rsp, err := c.GetStatusPage(ctx, id, reqEditors...) +// ListIncidentsWithResponse request returning *ListIncidentsResponse +func (c *ClientWithResponses) ListIncidentsWithResponse(ctx context.Context, params *ListIncidentsParams, reqEditors ...RequestEditorFn) (*ListIncidentsResponse, error) { + rsp, err := c.ListIncidents(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseGetStatusPageResponse(rsp) + return ParseListIncidentsResponse(rsp) } -// UpdateStatusPageWithBodyWithResponse request with arbitrary body returning *UpdateStatusPageResponse -func (c *ClientWithResponses) UpdateStatusPageWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) { - rsp, err := c.UpdateStatusPageWithBody(ctx, id, contentType, body, reqEditors...) +// GetIncidentSummaryWithResponse request returning *GetIncidentSummaryResponse +func (c *ClientWithResponses) GetIncidentSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetIncidentSummaryResponse, error) { + rsp, err := c.GetIncidentSummary(ctx, reqEditors...) if err != nil { return nil, err } - return ParseUpdateStatusPageResponse(rsp) + return ParseGetIncidentSummaryResponse(rsp) } -func (c *ClientWithResponses) UpdateStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) { - rsp, err := c.UpdateStatusPage(ctx, id, body, reqEditors...) +// GetIncidentWithResponse request returning *GetIncidentResponse +func (c *ClientWithResponses) GetIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetIncidentResponse, error) { + rsp, err := c.GetIncident(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseUpdateStatusPageResponse(rsp) + return ParseGetIncidentResponse(rsp) } -// DeleteStatusPageDomainWithResponse request returning *DeleteStatusPageDomainResponse -func (c *ClientWithResponses) DeleteStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageDomainResponse, error) { - rsp, err := c.DeleteStatusPageDomain(ctx, id, reqEditors...) +// AcknowledgeIncidentWithResponse request returning *AcknowledgeIncidentResponse +func (c *ClientWithResponses) AcknowledgeIncidentWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*AcknowledgeIncidentResponse, error) { + rsp, err := c.AcknowledgeIncident(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseDeleteStatusPageDomainResponse(rsp) + return ParseAcknowledgeIncidentResponse(rsp) } -// GetStatusPageDomainWithResponse request returning *GetStatusPageDomainResponse -func (c *ClientWithResponses) GetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageDomainResponse, error) { - rsp, err := c.GetStatusPageDomain(ctx, id, reqEditors...) +// ListMaintenanceWindowsWithResponse request returning *ListMaintenanceWindowsResponse +func (c *ClientWithResponses) ListMaintenanceWindowsWithResponse(ctx context.Context, params *ListMaintenanceWindowsParams, reqEditors ...RequestEditorFn) (*ListMaintenanceWindowsResponse, error) { + rsp, err := c.ListMaintenanceWindows(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseGetStatusPageDomainResponse(rsp) + return ParseListMaintenanceWindowsResponse(rsp) } -// SetStatusPageDomainWithBodyWithResponse request with arbitrary body returning *SetStatusPageDomainResponse -func (c *ClientWithResponses) SetStatusPageDomainWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) { - rsp, err := c.SetStatusPageDomainWithBody(ctx, id, contentType, body, reqEditors...) +// CreateMaintenanceWindowWithBodyWithResponse request with arbitrary body returning *CreateMaintenanceWindowResponse +func (c *ClientWithResponses) CreateMaintenanceWindowWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMaintenanceWindowResponse, error) { + rsp, err := c.CreateMaintenanceWindowWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseSetStatusPageDomainResponse(rsp) + return ParseCreateMaintenanceWindowResponse(rsp) } -func (c *ClientWithResponses) SetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) { - rsp, err := c.SetStatusPageDomain(ctx, id, body, reqEditors...) +func (c *ClientWithResponses) CreateMaintenanceWindowWithResponse(ctx context.Context, body CreateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMaintenanceWindowResponse, error) { + rsp, err := c.CreateMaintenanceWindow(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseSetStatusPageDomainResponse(rsp) + return ParseCreateMaintenanceWindowResponse(rsp) } -// ListStatusPageIncidentsWithResponse request returning *ListStatusPageIncidentsResponse -func (c *ClientWithResponses) ListStatusPageIncidentsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageIncidentsParams, reqEditors ...RequestEditorFn) (*ListStatusPageIncidentsResponse, error) { - rsp, err := c.ListStatusPageIncidents(ctx, id, params, reqEditors...) +// GetMaintenanceTargetsWithResponse request returning *GetMaintenanceTargetsResponse +func (c *ClientWithResponses) GetMaintenanceTargetsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMaintenanceTargetsResponse, error) { + rsp, err := c.GetMaintenanceTargets(ctx, reqEditors...) if err != nil { return nil, err } - return ParseListStatusPageIncidentsResponse(rsp) + return ParseGetMaintenanceTargetsResponse(rsp) } -// CreateStatusPageIncidentWithBodyWithResponse request with arbitrary body returning *CreateStatusPageIncidentResponse -func (c *ClientWithResponses) CreateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) { - rsp, err := c.CreateStatusPageIncidentWithBody(ctx, id, contentType, body, reqEditors...) +// DeleteMaintenanceWindowWithResponse request returning *DeleteMaintenanceWindowResponse +func (c *ClientWithResponses) DeleteMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteMaintenanceWindowResponse, error) { + rsp, err := c.DeleteMaintenanceWindow(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseCreateStatusPageIncidentResponse(rsp) + return ParseDeleteMaintenanceWindowResponse(rsp) } -func (c *ClientWithResponses) CreateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, body CreateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) { - rsp, err := c.CreateStatusPageIncident(ctx, id, body, reqEditors...) +// GetMaintenanceWindowWithResponse request returning *GetMaintenanceWindowResponse +func (c *ClientWithResponses) GetMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMaintenanceWindowResponse, error) { + rsp, err := c.GetMaintenanceWindow(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseCreateStatusPageIncidentResponse(rsp) + return ParseGetMaintenanceWindowResponse(rsp) } -// GetStatusPageIncidentWithResponse request returning *GetStatusPageIncidentResponse -func (c *ClientWithResponses) GetStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageIncidentResponse, error) { - rsp, err := c.GetStatusPageIncident(ctx, id, incidentId, reqEditors...) +// UpdateMaintenanceWindowWithBodyWithResponse request with arbitrary body returning *UpdateMaintenanceWindowResponse +func (c *ClientWithResponses) UpdateMaintenanceWindowWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMaintenanceWindowResponse, error) { + rsp, err := c.UpdateMaintenanceWindowWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetStatusPageIncidentResponse(rsp) + return ParseUpdateMaintenanceWindowResponse(rsp) } -// UpdateStatusPageIncidentWithBodyWithResponse request with arbitrary body returning *UpdateStatusPageIncidentResponse -func (c *ClientWithResponses) UpdateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) { - rsp, err := c.UpdateStatusPageIncidentWithBody(ctx, id, incidentId, contentType, body, reqEditors...) +func (c *ClientWithResponses) UpdateMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMaintenanceWindowJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMaintenanceWindowResponse, error) { + rsp, err := c.UpdateMaintenanceWindow(ctx, id, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateStatusPageIncidentResponse(rsp) + return ParseUpdateMaintenanceWindowResponse(rsp) } -func (c *ClientWithResponses) UpdateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body UpdateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) { - rsp, err := c.UpdateStatusPageIncident(ctx, id, incidentId, body, reqEditors...) +// CancelMaintenanceWindowWithResponse request returning *CancelMaintenanceWindowResponse +func (c *ClientWithResponses) CancelMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CancelMaintenanceWindowResponse, error) { + rsp, err := c.CancelMaintenanceWindow(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseUpdateStatusPageIncidentResponse(rsp) + return ParseCancelMaintenanceWindowResponse(rsp) } -// CreateStatusPageIncidentUpdateWithBodyWithResponse request with arbitrary body returning *CreateStatusPageIncidentUpdateResponse -func (c *ClientWithResponses) CreateStatusPageIncidentUpdateWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) { - rsp, err := c.CreateStatusPageIncidentUpdateWithBody(ctx, id, incidentId, contentType, body, reqEditors...) +// FinishMaintenanceWindowWithResponse request returning *FinishMaintenanceWindowResponse +func (c *ClientWithResponses) FinishMaintenanceWindowWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*FinishMaintenanceWindowResponse, error) { + rsp, err := c.FinishMaintenanceWindow(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseCreateStatusPageIncidentUpdateResponse(rsp) + return ParseFinishMaintenanceWindowResponse(rsp) } -func (c *ClientWithResponses) CreateStatusPageIncidentUpdateWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body CreateStatusPageIncidentUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) { - rsp, err := c.CreateStatusPageIncidentUpdate(ctx, id, incidentId, body, reqEditors...) +// ListMonitorsWithResponse request returning *ListMonitorsResponse +func (c *ClientWithResponses) ListMonitorsWithResponse(ctx context.Context, params *ListMonitorsParams, reqEditors ...RequestEditorFn) (*ListMonitorsResponse, error) { + rsp, err := c.ListMonitors(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseCreateStatusPageIncidentUpdateResponse(rsp) + return ParseListMonitorsResponse(rsp) } -// GetStatusPageLayoutWithResponse request returning *GetStatusPageLayoutResponse -func (c *ClientWithResponses) GetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLayoutResponse, error) { - rsp, err := c.GetStatusPageLayout(ctx, id, reqEditors...) +// CreateMonitorWithBodyWithResponse request with arbitrary body returning *CreateMonitorResponse +func (c *ClientWithResponses) CreateMonitorWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) { + rsp, err := c.CreateMonitorWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseGetStatusPageLayoutResponse(rsp) + return ParseCreateMonitorResponse(rsp) } -// SetStatusPageLayoutWithBodyWithResponse request with arbitrary body returning *SetStatusPageLayoutResponse -func (c *ClientWithResponses) SetStatusPageLayoutWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) { - rsp, err := c.SetStatusPageLayoutWithBody(ctx, id, contentType, body, reqEditors...) +func (c *ClientWithResponses) CreateMonitorWithResponse(ctx context.Context, body CreateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateMonitorResponse, error) { + rsp, err := c.CreateMonitor(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseSetStatusPageLayoutResponse(rsp) + return ParseCreateMonitorResponse(rsp) } -func (c *ClientWithResponses) SetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLayoutJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) { - rsp, err := c.SetStatusPageLayout(ctx, id, body, reqEditors...) +// ApplyMonitorBulkActionWithBodyWithResponse request with arbitrary body returning *ApplyMonitorBulkActionResponse +func (c *ClientWithResponses) ApplyMonitorBulkActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) { + rsp, err := c.ApplyMonitorBulkActionWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseSetStatusPageLayoutResponse(rsp) + return ParseApplyMonitorBulkActionResponse(rsp) } -// DeleteStatusPageLogoWithResponse request returning *DeleteStatusPageLogoResponse -func (c *ClientWithResponses) DeleteStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageLogoResponse, error) { - rsp, err := c.DeleteStatusPageLogo(ctx, id, reqEditors...) +func (c *ClientWithResponses) ApplyMonitorBulkActionWithResponse(ctx context.Context, body ApplyMonitorBulkActionJSONRequestBody, reqEditors ...RequestEditorFn) (*ApplyMonitorBulkActionResponse, error) { + rsp, err := c.ApplyMonitorBulkAction(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteStatusPageLogoResponse(rsp) + return ParseApplyMonitorBulkActionResponse(rsp) } -// GetStatusPageLogoWithResponse request returning *GetStatusPageLogoResponse -func (c *ClientWithResponses) GetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLogoResponse, error) { - rsp, err := c.GetStatusPageLogo(ctx, id, reqEditors...) +// DeleteMonitorWithResponse request returning *DeleteMonitorResponse +func (c *ClientWithResponses) DeleteMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteMonitorResponse, error) { + rsp, err := c.DeleteMonitor(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseGetStatusPageLogoResponse(rsp) + return ParseDeleteMonitorResponse(rsp) } -// SetStatusPageLogoWithBodyWithResponse request with arbitrary body returning *SetStatusPageLogoResponse -func (c *ClientWithResponses) SetStatusPageLogoWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) { - rsp, err := c.SetStatusPageLogoWithBody(ctx, id, contentType, body, reqEditors...) +// GetMonitorWithResponse request returning *GetMonitorResponse +func (c *ClientWithResponses) GetMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorResponse, error) { + rsp, err := c.GetMonitor(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseSetStatusPageLogoResponse(rsp) + return ParseGetMonitorResponse(rsp) } -func (c *ClientWithResponses) SetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLogoJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) { - rsp, err := c.SetStatusPageLogo(ctx, id, body, reqEditors...) +// UpdateMonitorWithBodyWithResponse request with arbitrary body returning *UpdateMonitorResponse +func (c *ClientWithResponses) UpdateMonitorWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) { + rsp, err := c.UpdateMonitorWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseSetStatusPageLogoResponse(rsp) + return ParseUpdateMonitorResponse(rsp) } -// PreviewStatusPageWithResponse request returning *PreviewStatusPageResponse -func (c *ClientWithResponses) PreviewStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PreviewStatusPageResponse, error) { - rsp, err := c.PreviewStatusPage(ctx, id, reqEditors...) +func (c *ClientWithResponses) UpdateMonitorWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateMonitorJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMonitorResponse, error) { + rsp, err := c.UpdateMonitor(ctx, id, body, reqEditors...) if err != nil { return nil, err } - return ParsePreviewStatusPageResponse(rsp) + return ParseUpdateMonitorResponse(rsp) } -// CreateStatusPagePreviewLinkWithResponse request returning *CreateStatusPagePreviewLinkResponse -func (c *ClientWithResponses) CreateStatusPagePreviewLinkWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CreateStatusPagePreviewLinkResponse, error) { - rsp, err := c.CreateStatusPagePreviewLink(ctx, id, reqEditors...) +// GetMonitorAlertsWithResponse request returning *GetMonitorAlertsResponse +func (c *ClientWithResponses) GetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorAlertsResponse, error) { + rsp, err := c.GetMonitorAlerts(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseCreateStatusPagePreviewLinkResponse(rsp) + return ParseGetMonitorAlertsResponse(rsp) } -// PublishStatusPageWithResponse request returning *PublishStatusPageResponse -func (c *ClientWithResponses) PublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PublishStatusPageResponse, error) { - rsp, err := c.PublishStatusPage(ctx, id, reqEditors...) +// SetMonitorAlertsWithBodyWithResponse request with arbitrary body returning *SetMonitorAlertsResponse +func (c *ClientWithResponses) SetMonitorAlertsWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) { + rsp, err := c.SetMonitorAlertsWithBody(ctx, id, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParsePublishStatusPageResponse(rsp) + return ParseSetMonitorAlertsResponse(rsp) } -// ListStatusPageSubscribersWithResponse request returning *ListStatusPageSubscribersResponse -func (c *ClientWithResponses) ListStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageSubscribersParams, reqEditors ...RequestEditorFn) (*ListStatusPageSubscribersResponse, error) { - rsp, err := c.ListStatusPageSubscribers(ctx, id, params, reqEditors...) +func (c *ClientWithResponses) SetMonitorAlertsWithResponse(ctx context.Context, id openapi_types.UUID, body SetMonitorAlertsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetMonitorAlertsResponse, error) { + rsp, err := c.SetMonitorAlerts(ctx, id, body, reqEditors...) if err != nil { return nil, err } - return ParseListStatusPageSubscribersResponse(rsp) + return ParseSetMonitorAlertsResponse(rsp) } -// CountStatusPageSubscribersWithResponse request returning *CountStatusPageSubscribersResponse -func (c *ClientWithResponses) CountStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CountStatusPageSubscribersResponse, error) { - rsp, err := c.CountStatusPageSubscribers(ctx, id, reqEditors...) +// GetMonitorAvailabilityWithResponse request returning *GetMonitorAvailabilityResponse +func (c *ClientWithResponses) GetMonitorAvailabilityWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorAvailabilityParams, reqEditors ...RequestEditorFn) (*GetMonitorAvailabilityResponse, error) { + rsp, err := c.GetMonitorAvailability(ctx, id, params, reqEditors...) if err != nil { return nil, err } - return ParseCountStatusPageSubscribersResponse(rsp) + return ParseGetMonitorAvailabilityResponse(rsp) } -// ExportStatusPageSubscribersWithResponse request returning *ExportStatusPageSubscribersResponse -func (c *ClientWithResponses) ExportStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ExportStatusPageSubscribersResponse, error) { - rsp, err := c.ExportStatusPageSubscribers(ctx, id, reqEditors...) +// GetMonitorCertificateWithResponse request returning *GetMonitorCertificateResponse +func (c *ClientWithResponses) GetMonitorCertificateWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetMonitorCertificateResponse, error) { + rsp, err := c.GetMonitorCertificate(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseExportStatusPageSubscribersResponse(rsp) + return ParseGetMonitorCertificateResponse(rsp) } -// DeleteStatusPageSubscriberWithResponse request returning *DeleteStatusPageSubscriberResponse -func (c *ClientWithResponses) DeleteStatusPageSubscriberWithResponse(ctx context.Context, id openapi_types.UUID, subscriberId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageSubscriberResponse, error) { - rsp, err := c.DeleteStatusPageSubscriber(ctx, id, subscriberId, reqEditors...) +// RunMonitorCheckWithResponse request returning *RunMonitorCheckResponse +func (c *ClientWithResponses) RunMonitorCheckWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*RunMonitorCheckResponse, error) { + rsp, err := c.RunMonitorCheck(ctx, id, reqEditors...) if err != nil { return nil, err } - return ParseDeleteStatusPageSubscriberResponse(rsp) + return ParseRunMonitorCheckResponse(rsp) +} + +// PauseMonitorWithResponse request returning *PauseMonitorResponse +func (c *ClientWithResponses) PauseMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PauseMonitorResponse, error) { + rsp, err := c.PauseMonitor(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParsePauseMonitorResponse(rsp) +} + +// ListMonitorResultsWithResponse request returning *ListMonitorResultsResponse +func (c *ClientWithResponses) ListMonitorResultsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorResultsParams, reqEditors ...RequestEditorFn) (*ListMonitorResultsResponse, error) { + rsp, err := c.ListMonitorResults(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListMonitorResultsResponse(rsp) +} + +// ResumeMonitorWithResponse request returning *ResumeMonitorResponse +func (c *ClientWithResponses) ResumeMonitorWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ResumeMonitorResponse, error) { + rsp, err := c.ResumeMonitor(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseResumeMonitorResponse(rsp) +} + +// GetMonitorStatsWithResponse request returning *GetMonitorStatsResponse +func (c *ClientWithResponses) GetMonitorStatsWithResponse(ctx context.Context, id openapi_types.UUID, params *GetMonitorStatsParams, reqEditors ...RequestEditorFn) (*GetMonitorStatsResponse, error) { + rsp, err := c.GetMonitorStats(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetMonitorStatsResponse(rsp) +} + +// ListMonitorStatusChangesWithResponse request returning *ListMonitorStatusChangesResponse +func (c *ClientWithResponses) ListMonitorStatusChangesWithResponse(ctx context.Context, id openapi_types.UUID, params *ListMonitorStatusChangesParams, reqEditors ...RequestEditorFn) (*ListMonitorStatusChangesResponse, error) { + rsp, err := c.ListMonitorStatusChanges(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListMonitorStatusChangesResponse(rsp) } -// UnpublishStatusPageWithResponse request returning *UnpublishStatusPageResponse -func (c *ClientWithResponses) UnpublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*UnpublishStatusPageResponse, error) { - rsp, err := c.UnpublishStatusPage(ctx, id, reqEditors...) - if err != nil { - return nil, err +// ListStatusPagesWithResponse request returning *ListStatusPagesResponse +func (c *ClientWithResponses) ListStatusPagesWithResponse(ctx context.Context, params *ListStatusPagesParams, reqEditors ...RequestEditorFn) (*ListStatusPagesResponse, error) { + rsp, err := c.ListStatusPages(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListStatusPagesResponse(rsp) +} + +// CreateStatusPageWithBodyWithResponse request with arbitrary body returning *CreateStatusPageResponse +func (c *ClientWithResponses) CreateStatusPageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) { + rsp, err := c.CreateStatusPageWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateStatusPageResponse(rsp) +} + +func (c *ClientWithResponses) CreateStatusPageWithResponse(ctx context.Context, body CreateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageResponse, error) { + rsp, err := c.CreateStatusPage(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateStatusPageResponse(rsp) +} + +// DeleteStatusPageWithResponse request returning *DeleteStatusPageResponse +func (c *ClientWithResponses) DeleteStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageResponse, error) { + rsp, err := c.DeleteStatusPage(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteStatusPageResponse(rsp) +} + +// GetStatusPageWithResponse request returning *GetStatusPageResponse +func (c *ClientWithResponses) GetStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageResponse, error) { + rsp, err := c.GetStatusPage(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetStatusPageResponse(rsp) +} + +// UpdateStatusPageWithBodyWithResponse request with arbitrary body returning *UpdateStatusPageResponse +func (c *ClientWithResponses) UpdateStatusPageWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) { + rsp, err := c.UpdateStatusPageWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateStatusPageResponse(rsp) +} + +func (c *ClientWithResponses) UpdateStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateStatusPageJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageResponse, error) { + rsp, err := c.UpdateStatusPage(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateStatusPageResponse(rsp) +} + +// DeleteStatusPageDomainWithResponse request returning *DeleteStatusPageDomainResponse +func (c *ClientWithResponses) DeleteStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageDomainResponse, error) { + rsp, err := c.DeleteStatusPageDomain(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteStatusPageDomainResponse(rsp) +} + +// GetStatusPageDomainWithResponse request returning *GetStatusPageDomainResponse +func (c *ClientWithResponses) GetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageDomainResponse, error) { + rsp, err := c.GetStatusPageDomain(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetStatusPageDomainResponse(rsp) +} + +// SetStatusPageDomainWithBodyWithResponse request with arbitrary body returning *SetStatusPageDomainResponse +func (c *ClientWithResponses) SetStatusPageDomainWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) { + rsp, err := c.SetStatusPageDomainWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetStatusPageDomainResponse(rsp) +} + +func (c *ClientWithResponses) SetStatusPageDomainWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageDomainJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageDomainResponse, error) { + rsp, err := c.SetStatusPageDomain(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetStatusPageDomainResponse(rsp) +} + +// ListStatusPageIncidentsWithResponse request returning *ListStatusPageIncidentsResponse +func (c *ClientWithResponses) ListStatusPageIncidentsWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageIncidentsParams, reqEditors ...RequestEditorFn) (*ListStatusPageIncidentsResponse, error) { + rsp, err := c.ListStatusPageIncidents(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListStatusPageIncidentsResponse(rsp) +} + +// CreateStatusPageIncidentWithBodyWithResponse request with arbitrary body returning *CreateStatusPageIncidentResponse +func (c *ClientWithResponses) CreateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) { + rsp, err := c.CreateStatusPageIncidentWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateStatusPageIncidentResponse(rsp) +} + +func (c *ClientWithResponses) CreateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, body CreateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentResponse, error) { + rsp, err := c.CreateStatusPageIncident(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateStatusPageIncidentResponse(rsp) +} + +// GetStatusPageIncidentWithResponse request returning *GetStatusPageIncidentResponse +func (c *ClientWithResponses) GetStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageIncidentResponse, error) { + rsp, err := c.GetStatusPageIncident(ctx, id, incidentId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetStatusPageIncidentResponse(rsp) +} + +// UpdateStatusPageIncidentWithBodyWithResponse request with arbitrary body returning *UpdateStatusPageIncidentResponse +func (c *ClientWithResponses) UpdateStatusPageIncidentWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) { + rsp, err := c.UpdateStatusPageIncidentWithBody(ctx, id, incidentId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateStatusPageIncidentResponse(rsp) +} + +func (c *ClientWithResponses) UpdateStatusPageIncidentWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body UpdateStatusPageIncidentJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateStatusPageIncidentResponse, error) { + rsp, err := c.UpdateStatusPageIncident(ctx, id, incidentId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateStatusPageIncidentResponse(rsp) +} + +// CreateStatusPageIncidentUpdateWithBodyWithResponse request with arbitrary body returning *CreateStatusPageIncidentUpdateResponse +func (c *ClientWithResponses) CreateStatusPageIncidentUpdateWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) { + rsp, err := c.CreateStatusPageIncidentUpdateWithBody(ctx, id, incidentId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateStatusPageIncidentUpdateResponse(rsp) +} + +func (c *ClientWithResponses) CreateStatusPageIncidentUpdateWithResponse(ctx context.Context, id openapi_types.UUID, incidentId openapi_types.UUID, body CreateStatusPageIncidentUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateStatusPageIncidentUpdateResponse, error) { + rsp, err := c.CreateStatusPageIncidentUpdate(ctx, id, incidentId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateStatusPageIncidentUpdateResponse(rsp) +} + +// GetStatusPageLayoutWithResponse request returning *GetStatusPageLayoutResponse +func (c *ClientWithResponses) GetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLayoutResponse, error) { + rsp, err := c.GetStatusPageLayout(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetStatusPageLayoutResponse(rsp) +} + +// SetStatusPageLayoutWithBodyWithResponse request with arbitrary body returning *SetStatusPageLayoutResponse +func (c *ClientWithResponses) SetStatusPageLayoutWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) { + rsp, err := c.SetStatusPageLayoutWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetStatusPageLayoutResponse(rsp) +} + +func (c *ClientWithResponses) SetStatusPageLayoutWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLayoutJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLayoutResponse, error) { + rsp, err := c.SetStatusPageLayout(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetStatusPageLayoutResponse(rsp) +} + +// DeleteStatusPageLogoWithResponse request returning *DeleteStatusPageLogoResponse +func (c *ClientWithResponses) DeleteStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageLogoResponse, error) { + rsp, err := c.DeleteStatusPageLogo(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteStatusPageLogoResponse(rsp) +} + +// GetStatusPageLogoWithResponse request returning *GetStatusPageLogoResponse +func (c *ClientWithResponses) GetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetStatusPageLogoResponse, error) { + rsp, err := c.GetStatusPageLogo(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetStatusPageLogoResponse(rsp) +} + +// SetStatusPageLogoWithBodyWithResponse request with arbitrary body returning *SetStatusPageLogoResponse +func (c *ClientWithResponses) SetStatusPageLogoWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) { + rsp, err := c.SetStatusPageLogoWithBody(ctx, id, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetStatusPageLogoResponse(rsp) +} + +func (c *ClientWithResponses) SetStatusPageLogoWithResponse(ctx context.Context, id openapi_types.UUID, body SetStatusPageLogoJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStatusPageLogoResponse, error) { + rsp, err := c.SetStatusPageLogo(ctx, id, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseSetStatusPageLogoResponse(rsp) +} + +// PreviewStatusPageWithResponse request returning *PreviewStatusPageResponse +func (c *ClientWithResponses) PreviewStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PreviewStatusPageResponse, error) { + rsp, err := c.PreviewStatusPage(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParsePreviewStatusPageResponse(rsp) +} + +// CreateStatusPagePreviewLinkWithResponse request returning *CreateStatusPagePreviewLinkResponse +func (c *ClientWithResponses) CreateStatusPagePreviewLinkWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CreateStatusPagePreviewLinkResponse, error) { + rsp, err := c.CreateStatusPagePreviewLink(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateStatusPagePreviewLinkResponse(rsp) +} + +// PublishStatusPageWithResponse request returning *PublishStatusPageResponse +func (c *ClientWithResponses) PublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*PublishStatusPageResponse, error) { + rsp, err := c.PublishStatusPage(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParsePublishStatusPageResponse(rsp) +} + +// ListStatusPageSubscribersWithResponse request returning *ListStatusPageSubscribersResponse +func (c *ClientWithResponses) ListStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, params *ListStatusPageSubscribersParams, reqEditors ...RequestEditorFn) (*ListStatusPageSubscribersResponse, error) { + rsp, err := c.ListStatusPageSubscribers(ctx, id, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListStatusPageSubscribersResponse(rsp) +} + +// CountStatusPageSubscribersWithResponse request returning *CountStatusPageSubscribersResponse +func (c *ClientWithResponses) CountStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*CountStatusPageSubscribersResponse, error) { + rsp, err := c.CountStatusPageSubscribers(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseCountStatusPageSubscribersResponse(rsp) +} + +// ExportStatusPageSubscribersWithResponse request returning *ExportStatusPageSubscribersResponse +func (c *ClientWithResponses) ExportStatusPageSubscribersWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ExportStatusPageSubscribersResponse, error) { + rsp, err := c.ExportStatusPageSubscribers(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseExportStatusPageSubscribersResponse(rsp) +} + +// DeleteStatusPageSubscriberWithResponse request returning *DeleteStatusPageSubscriberResponse +func (c *ClientWithResponses) DeleteStatusPageSubscriberWithResponse(ctx context.Context, id openapi_types.UUID, subscriberId openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteStatusPageSubscriberResponse, error) { + rsp, err := c.DeleteStatusPageSubscriber(ctx, id, subscriberId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteStatusPageSubscriberResponse(rsp) +} + +// UnpublishStatusPageWithResponse request returning *UnpublishStatusPageResponse +func (c *ClientWithResponses) UnpublishStatusPageWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*UnpublishStatusPageResponse, error) { + rsp, err := c.UnpublishStatusPage(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseUnpublishStatusPageResponse(rsp) +} + +// ParseListAlertChannelsResponse parses an HTTP response from a ListAlertChannelsWithResponse call +func ParseListAlertChannelsResponse(rsp *http.Response) (*ListAlertChannelsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListAlertChannelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoAlertChannel `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + } + + return response, nil +} + +// ParseCreateAlertChannelResponse parses an HTTP response from a CreateAlertChannelWithResponse call +func ParseCreateAlertChannelResponse(rsp *http.Response) (*CreateAlertChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateAlertChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest DtoAlertChannelWithSecret + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + } + + return response, nil +} + +// ParseDeleteAlertChannelResponse parses an HTTP response from a DeleteAlertChannelWithResponse call +func ParseDeleteAlertChannelResponse(rsp *http.Response) (*DeleteAlertChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteAlertChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseGetAlertChannelResponse parses an HTTP response from a GetAlertChannelWithResponse call +func ParseGetAlertChannelResponse(rsp *http.Response) (*GetAlertChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetAlertChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DtoAlertChannel + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseUpdateAlertChannelResponse parses an HTTP response from a UpdateAlertChannelWithResponse call +func ParseUpdateAlertChannelResponse(rsp *http.Response) (*UpdateAlertChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateAlertChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DtoAlertChannelWithSecret + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseListAlertChannelDeliveriesResponse parses an HTTP response from a ListAlertChannelDeliveriesWithResponse call +func ParseListAlertChannelDeliveriesResponse(rsp *http.Response) (*ListAlertChannelDeliveriesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListAlertChannelDeliveriesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoChannelDelivery `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseTestAlertChannelResponse parses an HTTP response from a TestAlertChannelWithResponse call +func ParseTestAlertChannelResponse(rsp *http.Response) (*TestAlertChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &TestAlertChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DtoAlertChannelTestResult + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON503 = &dest + + } + + return response, nil +} + +// ParseSendAlertChannelVerificationResponse parses an HTTP response from a SendAlertChannelVerificationWithResponse call +func ParseSendAlertChannelVerificationResponse(rsp *http.Response) (*SendAlertChannelVerificationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SendAlertChannelVerificationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON402 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + } - return ParseUnpublishStatusPageResponse(rsp) + + return response, nil } -// ParseListAlertChannelsResponse parses an HTTP response from a ListAlertChannelsWithResponse call -func ParseListAlertChannelsResponse(rsp *http.Response) (*ListAlertChannelsResponse, error) { +// ParseConfirmAlertChannelVerificationResponse parses an HTTP response from a ConfirmAlertChannelVerificationWithResponse call +func ParseConfirmAlertChannelVerificationResponse(rsp *http.Response) (*ConfirmAlertChannelVerificationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAlertChannelsResponse{ + response := &ConfirmAlertChannelVerificationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoAlertChannel `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` - } + var dest DtoAlertChannel if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10461,31 +12416,49 @@ func ParseListAlertChannelsResponse(rsp *http.Response) (*ListAlertChannelsRespo } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + } return response, nil } -// ParseCreateAlertChannelResponse parses an HTTP response from a CreateAlertChannelWithResponse call -func ParseCreateAlertChannelResponse(rsp *http.Response) (*CreateAlertChannelResponse, error) { +// ParseListIncidentsResponse parses an HTTP response from a ListIncidentsWithResponse call +func ParseListIncidentsResponse(rsp *http.Response) (*ListIncidentsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateAlertChannelResponse{ + response := &ListIncidentsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest DtoAlertChannelWithSecret + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` + List []DtoIncident `json:"list"` + Meta ResponseAPIResponsePaginationMeta `json:"meta"` + } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest ResponseProblem @@ -10513,62 +12486,62 @@ func ParseCreateAlertChannelResponse(rsp *http.Response) (*CreateAlertChannelRes return response, nil } -// ParseDeleteAlertChannelResponse parses an HTTP response from a DeleteAlertChannelWithResponse call -func ParseDeleteAlertChannelResponse(rsp *http.Response) (*DeleteAlertChannelResponse, error) { +// ParseGetIncidentSummaryResponse parses an HTTP response from a GetIncidentSummaryWithResponse call +func ParseGetIncidentSummaryResponse(rsp *http.Response) (*GetIncidentSummaryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAlertChannelResponse{ + response := &GetIncidentSummaryResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest ResponseProblem + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DtoIncidentSummary if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON403 = &dest } return response, nil } -// ParseGetAlertChannelResponse parses an HTTP response from a GetAlertChannelWithResponse call -func ParseGetAlertChannelResponse(rsp *http.Response) (*GetAlertChannelResponse, error) { +// ParseGetIncidentResponse parses an HTTP response from a GetIncidentWithResponse call +func ParseGetIncidentResponse(rsp *http.Response) (*GetIncidentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAlertChannelResponse{ + response := &GetIncidentResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DtoAlertChannel + var dest DtoIncidentDetail if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10600,34 +12573,27 @@ func ParseGetAlertChannelResponse(rsp *http.Response) (*GetAlertChannelResponse, return response, nil } -// ParseUpdateAlertChannelResponse parses an HTTP response from a UpdateAlertChannelWithResponse call -func ParseUpdateAlertChannelResponse(rsp *http.Response) (*UpdateAlertChannelResponse, error) { +// ParseAcknowledgeIncidentResponse parses an HTTP response from a AcknowledgeIncidentWithResponse call +func ParseAcknowledgeIncidentResponse(rsp *http.Response) (*AcknowledgeIncidentResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAlertChannelResponse{ + response := &AcknowledgeIncidentResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DtoAlertChannelWithSecret + var dest DtoIncidentDetail if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest ResponseProblem - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10654,15 +12620,15 @@ func ParseUpdateAlertChannelResponse(rsp *http.Response) (*UpdateAlertChannelRes return response, nil } -// ParseListAlertChannelDeliveriesResponse parses an HTTP response from a ListAlertChannelDeliveriesWithResponse call -func ParseListAlertChannelDeliveriesResponse(rsp *http.Response) (*ListAlertChannelDeliveriesResponse, error) { +// ParseListMaintenanceWindowsResponse parses an HTTP response from a ListMaintenanceWindowsWithResponse call +func ParseListMaintenanceWindowsResponse(rsp *http.Response) (*ListMaintenanceWindowsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAlertChannelDeliveriesResponse{ + response := &ListMaintenanceWindowsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -10671,7 +12637,7 @@ func ParseListAlertChannelDeliveriesResponse(rsp *http.Response) (*ListAlertChan case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoChannelDelivery `json:"list"` + List []DtoMaintenanceWindow `json:"list"` Meta ResponseAPIResponsePaginationMeta `json:"meta"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10700,52 +12666,45 @@ func ParseListAlertChannelDeliveriesResponse(rsp *http.Response) (*ListAlertChan } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest ResponseProblem - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - } return response, nil } -// ParseTestAlertChannelResponse parses an HTTP response from a TestAlertChannelWithResponse call -func ParseTestAlertChannelResponse(rsp *http.Response) (*TestAlertChannelResponse, error) { +// ParseCreateMaintenanceWindowResponse parses an HTTP response from a CreateMaintenanceWindowWithResponse call +func ParseCreateMaintenanceWindowResponse(rsp *http.Response) (*CreateMaintenanceWindowResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &TestAlertChannelResponse{ + response := &CreateMaintenanceWindowResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DtoAlertChannelTestResult + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest DtoMaintenanceWindow if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON402 = &dest + response.JSON401 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest ResponseProblem @@ -10754,26 +12713,59 @@ func ParseTestAlertChannelResponse(rsp *http.Response) (*TestAlertChannelRespons } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON409 = &dest + response.JSON503 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + } + + return response, nil +} + +// ParseGetMaintenanceTargetsResponse parses an HTTP response from a GetMaintenanceTargetsWithResponse call +func ParseGetMaintenanceTargetsResponse(rsp *http.Response) (*GetMaintenanceTargetsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetMaintenanceTargetsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DtoMaintenanceTargets + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON429 = &dest + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ResponseProblem @@ -10787,15 +12779,15 @@ func ParseTestAlertChannelResponse(rsp *http.Response) (*TestAlertChannelRespons return response, nil } -// ParseSendAlertChannelVerificationResponse parses an HTTP response from a SendAlertChannelVerificationWithResponse call -func ParseSendAlertChannelVerificationResponse(rsp *http.Response) (*SendAlertChannelVerificationResponse, error) { +// ParseDeleteMaintenanceWindowResponse parses an HTTP response from a DeleteMaintenanceWindowWithResponse call +func ParseDeleteMaintenanceWindowResponse(rsp *http.Response) (*DeleteMaintenanceWindowResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &SendAlertChannelVerificationResponse{ + response := &DeleteMaintenanceWindowResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -10808,13 +12800,6 @@ func ParseSendAlertChannelVerificationResponse(rsp *http.Response) (*SendAlertCh } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 402: - var dest ResponseProblem - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON402 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10841,34 +12826,27 @@ func ParseSendAlertChannelVerificationResponse(rsp *http.Response) (*SendAlertCh return response, nil } -// ParseConfirmAlertChannelVerificationResponse parses an HTTP response from a ConfirmAlertChannelVerificationWithResponse call -func ParseConfirmAlertChannelVerificationResponse(rsp *http.Response) (*ConfirmAlertChannelVerificationResponse, error) { +// ParseGetMaintenanceWindowResponse parses an HTTP response from a GetMaintenanceWindowWithResponse call +func ParseGetMaintenanceWindowResponse(rsp *http.Response) (*GetMaintenanceWindowResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ConfirmAlertChannelVerificationResponse{ + response := &GetMaintenanceWindowResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DtoAlertChannel + var dest DtoMaintenanceWindow if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest ResponseProblem - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -10890,38 +12868,27 @@ func ParseConfirmAlertChannelVerificationResponse(rsp *http.Response) (*ConfirmA } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest ResponseProblem - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - } return response, nil } -// ParseListIncidentsResponse parses an HTTP response from a ListIncidentsWithResponse call -func ParseListIncidentsResponse(rsp *http.Response) (*ListIncidentsResponse, error) { +// ParseUpdateMaintenanceWindowResponse parses an HTTP response from a UpdateMaintenanceWindowWithResponse call +func ParseUpdateMaintenanceWindowResponse(rsp *http.Response) (*UpdateMaintenanceWindowResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListIncidentsResponse{ + response := &UpdateMaintenanceWindowResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Cursors ResponseAPIResponsePaginationCursors `json:"cursors"` - List []DtoIncident `json:"list"` - Meta ResponseAPIResponsePaginationMeta `json:"meta"` - } + var dest DtoMaintenanceWindow if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -10948,67 +12915,55 @@ func ParseListIncidentsResponse(rsp *http.Response) (*ListIncidentsResponse, err } response.JSON403 = &dest - } - - return response, nil -} - -// ParseGetIncidentSummaryResponse parses an HTTP response from a GetIncidentSummaryWithResponse call -func ParseGetIncidentSummaryResponse(rsp *http.Response) (*GetIncidentSummaryResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetIncidentSummaryResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DtoIncidentSummary + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503: var dest ResponseProblem if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON503 = &dest } return response, nil } -// ParseGetIncidentResponse parses an HTTP response from a GetIncidentWithResponse call -func ParseGetIncidentResponse(rsp *http.Response) (*GetIncidentResponse, error) { +// ParseCancelMaintenanceWindowResponse parses an HTTP response from a CancelMaintenanceWindowWithResponse call +func ParseCancelMaintenanceWindowResponse(rsp *http.Response) (*CancelMaintenanceWindowResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetIncidentResponse{ + response := &CancelMaintenanceWindowResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DtoIncidentDetail + var dest DtoMaintenanceWindow if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11035,27 +12990,34 @@ func ParseGetIncidentResponse(rsp *http.Response) (*GetIncidentResponse, error) } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + } return response, nil } -// ParseAcknowledgeIncidentResponse parses an HTTP response from a AcknowledgeIncidentWithResponse call -func ParseAcknowledgeIncidentResponse(rsp *http.Response) (*AcknowledgeIncidentResponse, error) { +// ParseFinishMaintenanceWindowResponse parses an HTTP response from a FinishMaintenanceWindowWithResponse call +func ParseFinishMaintenanceWindowResponse(rsp *http.Response) (*FinishMaintenanceWindowResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AcknowledgeIncidentResponse{ + response := &FinishMaintenanceWindowResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DtoIncidentDetail + var dest DtoMaintenanceWindow if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -11082,6 +13044,13 @@ func ParseAcknowledgeIncidentResponse(rsp *http.Response) (*AcknowledgeIncidentR } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ResponseProblem + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + } return response, nil diff --git a/specs/monitor.openapi.json b/specs/monitor.openapi.json index 3ee32c1..fcfb836 100644 --- a/specs/monitor.openapi.json +++ b/specs/monitor.openapi.json @@ -6,6 +6,7 @@ "INTERNAL_ERROR", "VALIDATION_FAILED", "INVALID_PAYLOAD", + "UNPROCESSABLE", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", @@ -24,6 +25,7 @@ "ErrorCodeInternal", "ErrorCodeValidationFailed", "ErrorCodeInvalidPayload", + "ErrorCodeUnprocessable", "ErrorCodeUnauthorized", "ErrorCodeForbidden", "ErrorCodeNotFound", @@ -45,10 +47,13 @@ "UNVERIFIED_CHANNEL_LIMIT", "STATUS_PAGE_LIMIT", "STATUS_PAGE_DOMAIN_LIMIT", + "MAINTENANCE_WINDOW_LIMIT", "SLUG_TAKEN", "DOMAIN_TAKEN", "DOMAINS_DISABLED", "DOMAIN_NOT_SET", + "MAINTENANCE_WINDOW_STATE", + "MAINTENANCE_PUBLISH_DENIED", "INCIDENT_RESOLVED", "MISSING_ORGANIZATION_ID", "INSUFFICIENT_SCOPE", @@ -69,10 +74,13 @@ "ErrorReasonUnverifiedChannelLimit", "ErrorReasonStatusPageLimit", "ErrorReasonStatusPageDomainLimit", + "ErrorReasonMaintenanceWindowLimit", "ErrorReasonSlugTaken", "ErrorReasonDomainTaken", "ErrorReasonDomainsDisabled", "ErrorReasonDomainNotSet", + "ErrorReasonMaintenanceWindowState", + "ErrorReasonMaintenancePublishDenied", "ErrorReasonIncidentResolved", "ErrorReasonMissingOrganizationID", "ErrorReasonInsufficientScope", @@ -342,6 +350,14 @@ "inconclusive": { "type": "integer" }, + "maintenance": { + "description": "Maintenance counts the checks inside a maintenance window, whatever they\nfound. They are billed; the other counts cover only what ran outside.", + "type": "integer" + }, + "maintenanceMinutes": { + "description": "MaintenanceMinutes is how long maintenance windows held the monitor in\nthese days, not counted as downtime.", + "type": "integer" + }, "ok": { "type": "integer" }, @@ -364,6 +380,8 @@ "downtimeMinutes", "from", "inconclusive", + "maintenance", + "maintenanceMinutes", "ok", "to", "warning" @@ -701,14 +719,22 @@ "type": "string" }, "downtimeMinutes": { - "description": "DowntimeMinutes estimates the time spent down: the share of\ncritical checks among the conclusive ones times the minutes the\nday's checks cover. A warning is not downtime.", + "description": "DowntimeMinutes estimates the time spent down: the share of\ncritical checks among the conclusive ones times the minutes the\nday's checks cover outside maintenance. A warning is not downtime.", "type": "integer" }, "inconclusive": { "type": "integer" }, + "maintenance": { + "description": "Maintenance counts the checks inside a maintenance window, whatever they\nfound. They are billed; the other counts cover only what ran outside.", + "type": "integer" + }, + "maintenanceMinutes": { + "description": "MaintenanceMinutes is how much of the day maintenance windows covered.", + "type": "integer" + }, "noData": { - "description": "NoData: no checks that day (draw it gray, never as up).", + "description": "NoData: no checks that day, inside or outside maintenance (draw it\ngray, never as up).", "type": "boolean" }, "ok": { @@ -728,6 +754,8 @@ "date", "downtimeMinutes", "inconclusive", + "maintenance", + "maintenanceMinutes", "noData", "ok", "warning" @@ -1126,6 +1154,10 @@ "example": "unexpected_status", "type": "string" }, + "maintenance": { + "description": "Maintenance says a window held this check when it ran: it is out of uptime and\ncouldn't alert.", + "type": "boolean" + }, "responseTimeMs": { "type": "integer" }, @@ -1149,6 +1181,7 @@ "required": [ "checkedAt", "condition", + "maintenance", "responseTimeMs", "resultId", "severity" @@ -1189,6 +1222,10 @@ "format": "uuid", "type": "string" }, + "maintenanceHeld": { + "description": "MaintenanceHeld says a maintenance window held it open at some point, so its alerts\nwere paused for that time; a resolved one doesn't count towards time to recover.", + "type": "boolean" + }, "monitorId": { "format": "uuid", "type": "string" @@ -1261,6 +1298,7 @@ "durationSeconds", "facts", "id", + "maintenanceHeld", "monitorId", "monitorName", "monitorTarget", @@ -1383,6 +1421,10 @@ "format": "uuid", "type": "string" }, + "maintenanceHeld": { + "description": "MaintenanceHeld says a maintenance window held it open at some point, so its alerts\nwere paused for that time; a resolved one doesn't count towards time to recover.", + "type": "boolean" + }, "monitorId": { "format": "uuid", "type": "string" @@ -1462,6 +1504,7 @@ "durationSeconds", "facts", "id", + "maintenanceHeld", "monitorId", "monitorName", "monitorTarget", @@ -1495,7 +1538,8 @@ "reminder", "acknowledged", "resolved", - "delivery_failed" + "delivery_failed", + "maintenance_hold" ], "type": "string" } @@ -1512,6 +1556,10 @@ "example": 1, "type": "integer" }, + "inMaintenance": { + "example": 1, + "type": "integer" + }, "total": { "example": 3, "type": "integer" @@ -1527,6 +1575,7 @@ }, "required": [ "critical", + "inMaintenance", "total", "unacknowledged", "warning" @@ -1544,7 +1593,7 @@ "$ref": "#/components/schemas/dto.IncidentOpenCounts" }, "resolvedLast30d": { - "description": "ResolvedLast30d counts incidents resolved in the last 30 days, the\nones mttrLast30dSeconds averages.", + "description": "ResolvedLast30d counts incidents resolved in the last 30 days, the\nones mttrLast30dSeconds averages: not those a maintenance window held\nopen at some point, whose duration is mostly the planned work.", "example": 12, "type": "integer" }, @@ -1590,550 +1639,515 @@ ], "type": "object" }, - "dto.Monitor": { + "dto.MaintenanceTargetComponent": { "properties": { - "aspects": { - "description": "Aspects are the monitor's watched aspects (an HTTP monitor's\ncertificate and domain watches that are on), on list rows too; []\nwithout watches.", - "items": { - "$ref": "#/components/schemas/dto.MonitorAspect" - }, - "type": "array" - }, - "condition": { - "allOf": [ - { - "$ref": "#/components/schemas/dto.MonitorCondition" - } - ], - "description": "Condition explains status; absent while pending." - }, - "createdAt": { - "type": "string" - }, - "createdBy": { - "format": "uuid", - "type": "string" - }, - "description": { - "type": "string" - }, - "domain": { - "$ref": "#/components/schemas/dto.DomainSettings" - }, - "history": { - "description": "History is set on list rows with include=history: the newest\nresults (at most 60), newest first; [] for a monitor never checked.", - "items": { - "$ref": "#/components/schemas/dto.HistoryBeat" - }, - "type": "array" - }, - "http": { - "$ref": "#/components/schemas/dto.HTTPSettings" - }, "id": { "format": "uuid", "type": "string" }, - "intervalSeconds": { - "type": "integer" - }, - "last24h": { - "allOf": [ - { - "$ref": "#/components/schemas/dto.WindowSummary" - } - ], - "description": "Last24h is set on list rows of monitors that track uptime (HTTP):\nthe last 24 full hours plus the current one. SSL and domain monitors\nshow days left (condition.facts) instead." - }, - "lastCheck": { - "$ref": "#/components/schemas/dto.LastCheck" - }, "name": { "type": "string" }, - "nextCheckAt": { - "type": "string" - }, - "overallStatus": { - "description": "OverallStatus is the worst of status and the statuses of the\nmonitor's watched aspects (critical, warning, pending, ok), paused\nwhile disabled. The list status filter and sort use it.", - "enum": [ - "pending", - "ok", - "warning", - "critical", - "paused" - ], - "type": "string" - }, - "parentResource": { - "description": "ParentResource is set when the monitor belongs to a resource of\nanother Norcube service (\"domainradar:saved_domain:example.com\"). It\ncan't be deleted here, and its domain can't change.", - "example": "domainradar:saved_domain:example.com", + "statusPageId": { + "format": "uuid", "type": "string" + } + }, + "required": [ + "id", + "name", + "statusPageId" + ], + "type": "object" + }, + "dto.MaintenanceTargetMonitor": { + "properties": { + "enabled": { + "type": "boolean" }, - "regions": { - "description": "Regions are where the monitor is checked from, on list rows too.\nToday every monitor is checked from the one region the service runs\nin; with probes in more regions (planned) a monitor may list\nseveral. Each result says which region checked it (region).", - "items": { - "$ref": "#/components/schemas/dto.CheckRegion" - }, - "type": "array" - }, - "ssl": { - "$ref": "#/components/schemas/dto.SSLSettings" - }, - "status": { - "description": "Status is the primary aspect's: the severity of the last conclusive\ncheck, pending before one, paused while disabled. An inconclusive\ncheck (a failed registry lookup) never changes it.", - "enum": [ - "pending", - "ok", - "warning", - "critical", - "paused" - ], + "id": { + "format": "uuid", "type": "string" }, - "statusSince": { + "name": { "type": "string" }, "target": { - "example": "https://example.com/health", "type": "string" }, "type": { "enum": [ "http", - "ssl", - "domain" - ], - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "variant": { - "description": "Variant is what the monitor does in one word, on list rows too\n(which carry no settings): keyword for an HTTP monitor that looks for\na keyword in the body, otherwise the type.", - "enum": [ - "http", - "keyword", - "ssl", - "domain" + "ssl" ], - "example": "keyword", "type": "string" } }, "required": [ - "aspects", - "createdAt", - "createdBy", - "description", + "enabled", "id", - "intervalSeconds", "name", - "overallStatus", - "regions", - "status", - "statusSince", "target", - "type", - "updatedAt", - "variant" + "type" ], "type": "object" }, - "dto.MonitorAlertRoute": { + "dto.MaintenanceTargetStatusPage": { "properties": { - "channelId": { + "canPublish": { + "description": "CanPublish says you may show a window here. On a published page it decides\nwhether a window showing here can be saved.", + "type": "boolean" + }, + "componentIds": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "id": { "format": "uuid", "type": "string" }, - "events": { - "example": [ - "down", - "recovered" - ], + "monitorIds": { + "description": "MonitorIDs are the monitors that make a window show on this page; a monitor the\npage shows only for its certificate or domain isn't among them. ComponentIDs are\nits manual components.", "items": { - "enum": [ - "down", - "warning", - "expiring", - "expired", - "recovered" - ], + "format": "uuid", "type": "string" }, "type": "array" + }, + "name": { + "type": "string" + }, + "published": { + "type": "boolean" + }, + "subscribers": { + "description": "Subscribers are its confirmed subscribers; absent when you can't read the page.", + "type": "integer" } }, "required": [ - "channelId", - "events" + "canPublish", + "componentIds", + "id", + "monitorIds", + "name", + "published" ], "type": "object" }, - "dto.MonitorAlerts": { + "dto.MaintenanceTargets": { "properties": { - "applicableEvents": { - "description": "ApplicableEvents are the events monitors of this type can send\n(offer only these in a routing form).", - "example": [ - "down", - "warning", - "recovered" - ], + "components": { "items": { - "enum": [ - "down", - "warning", - "expiring", - "expired", - "recovered" - ], - "type": "string" + "$ref": "#/components/schemas/dto.MaintenanceTargetComponent" }, "type": "array" }, - "confirmFailures": { - "type": "integer" - }, - "confirmSuccesses": { - "type": "integer" - }, - "reminderMinutes": { - "type": "integer" - }, - "routes": { + "monitors": { "items": { - "$ref": "#/components/schemas/dto.MonitorAlertRoute" + "$ref": "#/components/schemas/dto.MaintenanceTargetMonitor" }, "type": "array" }, - "useDefaults": { - "type": "boolean" + "statusPages": { + "items": { + "$ref": "#/components/schemas/dto.MaintenanceTargetStatusPage" + }, + "type": "array" } }, "required": [ - "applicableEvents", - "confirmFailures", - "confirmSuccesses", - "reminderMinutes", - "routes", - "useDefaults" + "components", + "monitors", + "statusPages" ], "type": "object" }, - "dto.MonitorAlertsUpdate": { + "dto.MaintenanceWindow": { "properties": { - "confirmFailures": { - "example": 2, - "maximum": 10, - "minimum": 1, - "type": "integer" + "cancelledAt": { + "description": "CancelledAt is set once cancelled; cancelledBy stays absent when the system did it,\nevery target having gone before the start.", + "type": "string" }, - "confirmSuccesses": { - "example": 1, - "maximum": 10, - "minimum": 1, - "type": "integer" + "cancelledBy": { + "format": "uuid", + "type": "string" }, - "reminderMinutes": { - "example": 60, - "type": "integer" + "cancelledByName": { + "description": "CancelledByName names who cancelled it (their name, else their email); only when\nreading one window, and absent when Norcube Auth can't say. So do the other names.", + "example": "Dev Owner", + "type": "string" }, - "routes": { - "items": { - "$ref": "#/components/schemas/dto.MonitorAlertRoute" - }, - "type": "array" - }, - "useDefaults": { - "type": "boolean" - } - }, - "type": "object" - }, - "dto.MonitorAspect": { - "properties": { - "alertedThresholds": { - "description": "AlertedThresholds are the expiry thresholds already alerted for the\ncurrent expiry, oldest first; [] before the first (or once renewed).", - "items": { - "$ref": "#/components/schemas/dto.ThresholdAlert" - }, - "type": "array" + "createdAt": { + "type": "string" }, - "aspect": { - "enum": [ - "certificate", - "domain" - ], + "createdBy": { + "format": "uuid", "type": "string" }, - "checkedAt": { - "description": "CheckedAt is the last observation, conclusive or not; absent before\nthe first.", + "createdByName": { + "example": "Dev Owner", "type": "string" }, - "condition": { - "description": "Condition explains status (\"ok\", \"cert_expiring\", \"domain_expired\",\n...); absent while pending.", - "example": "cert_expiring", + "description": { "type": "string" }, - "daysRemaining": { - "description": "DaysRemaining is counted when read from expiresAt, negative once\nexpired.", - "example": 12, - "type": "integer" + "endsAt": { + "description": "EndsAt is when it ended, if someone finished it early (finishedEarly).", + "type": "string" }, - "expiresAt": { + "finishedBy": { + "format": "uuid", "type": "string" }, - "message": { - "example": "certificate expires in 12 days (2026-11-12), within the 14-day threshold", + "finishedByName": { + "example": "Dev Owner", "type": "string" }, - "status": { - "enum": [ - "pending", - "ok", - "warning", - "critical" - ], + "finishedEarly": { + "type": "boolean" + }, + "id": { + "format": "uuid", "type": "string" }, - "subject": { - "description": "Subject is what the aspect is about: the URL's host for the\ncertificate, its registrable domain for the domain.", - "example": "example.com", + "notifyFinished": { + "type": "boolean" + }, + "notifyScheduled": { + "type": "boolean" + }, + "notifyStarted": { + "type": "boolean" + }, + "startsAt": { "type": "string" }, - "thresholdsDays": { - "example": [ - 30, - 14, - 7 + "state": { + "description": "State follows from the times: scheduled before the start, in_progress until the\nend, then completed; cancelled once called off.", + "enum": [ + "scheduled", + "in_progress", + "completed", + "cancelled" ], + "type": "string" + }, + "statusPages": { + "description": "StatusPages are the pages it shows on, published or not: every page showing a\ntarget, which nobody chooses. Published ones show it publicly.", "items": { - "type": "integer" + "$ref": "#/components/schemas/dto.MaintenanceWindowStatusPage" }, "type": "array" + }, + "targets": { + "$ref": "#/components/schemas/dto.MaintenanceWindowResponseTargets" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" } }, "required": [ - "alertedThresholds", - "aspect", - "status", - "subject", - "thresholdsDays" + "createdAt", + "description", + "endsAt", + "finishedEarly", + "id", + "notifyFinished", + "notifyScheduled", + "notifyStarted", + "startsAt", + "state", + "statusPages", + "targets", + "title", + "updatedAt" ], "type": "object" }, - "dto.MonitorBulkItem": { + "dto.MaintenanceWindowCreate": { "properties": { - "code": { - "example": "MANAGED_RESOURCE", + "description": { + "description": "Description is public: it shows on status pages and in mails.", + "example": "Short interruptions are expected.", + "maxLength": 2000, "type": "string" }, - "detail": { + "endsAt": { + "description": "EndsAt is at most 30 days after the start.", "type": "string" }, - "monitorId": { - "format": "uuid", - "type": "string" + "notifyFinished": { + "type": "boolean" }, - "ok": { + "notifyScheduled": { + "description": "NotifyScheduled, NotifyStarted and NotifyFinished say which mails go to the\nsubscribers of the status pages it shows on. A cancellation always tells whoever\nwas told.", + "type": "boolean" + }, + "notifyStarted": { "type": "boolean" + }, + "startsAt": { + "description": "StartsAt may be up to a year ahead; up to five minutes in the past reads as now.", + "type": "string" + }, + "targets": { + "$ref": "#/components/schemas/dto.MaintenanceWindowTargets" + }, + "title": { + "example": "Database upgrade", + "maxLength": 200, + "type": "string" } }, "required": [ - "monitorId", - "ok" + "endsAt", + "notifyFinished", + "notifyScheduled", + "notifyStarted", + "startsAt", + "targets", + "title" ], "type": "object" }, - "dto.MonitorBulkRequest": { + "dto.MaintenanceWindowResponseTargets": { "properties": { - "action": { - "enum": [ - "pause", - "resume", - "delete" - ], - "example": "pause", - "type": "string" + "componentIds": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" }, "monitorIds": { - "example": [ - "7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f" - ], "items": { + "format": "uuid", "type": "string" }, "type": "array" } }, "required": [ - "action", + "componentIds", "monitorIds" ], "type": "object" }, - "dto.MonitorBulkResult": { + "dto.MaintenanceWindowStatusPage": { "properties": { - "action": { - "enum": [ - "pause", - "resume", - "delete" - ], - "type": "string" - }, - "failed": { - "type": "integer" - }, - "items": { + "componentIds": { + "description": "ComponentIDs are the page's components it affects.", "items": { - "$ref": "#/components/schemas/dto.MonitorBulkItem" + "format": "uuid", + "type": "string" }, "type": "array" }, - "succeeded": { - "type": "integer" + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "type": "string" + }, + "published": { + "type": "boolean" } }, "required": [ - "action", - "failed", - "items", - "succeeded" + "componentIds", + "id", + "name", + "published" ], "type": "object" }, - "dto.MonitorCertificate": { + "dto.MaintenanceWindowTargets": { "properties": { - "alertWindowStart": { - "description": "AlertWindowStart is when the largest threshold is crossed (notAfter\nminus it): shade from here to notAfter.", - "type": "string" - }, - "certificate": { - "$ref": "#/components/schemas/dto.Certificate" + "componentIds": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" }, - "checkedAt": { - "type": "string" + "monitorIds": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" }, - "condition": { - "example": "cert_expiring", + "statusPageIds": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "dto.MaintenanceWindowUpdate": { + "properties": { + "description": { + "maxLength": 2000, "type": "string" }, - "daysRemaining": { - "description": "DaysRemaining counts from now (certificate.daysRemaining from the\ncheck).", - "example": 41, - "type": "integer" - }, - "errorMessage": { + "endsAt": { + "description": "EndsAt: until it ends, and to a time still to come. To end it now, use finish.", "type": "string" }, - "nextThresholdAt": { - "type": "string" + "notifyFinished": { + "type": "boolean" }, - "nextThresholdDays": { - "description": "NextThresholdDays / NextThresholdAt: the next threshold to cross\nand when; absent once past the smallest.", - "example": 30, - "type": "integer" + "notifyScheduled": { + "type": "boolean" }, - "resultId": { - "type": "integer" + "notifyStarted": { + "type": "boolean" }, - "severity": { - "enum": [ - "ok", - "warning", - "critical", - "inconclusive" - ], + "startsAt": { + "description": "StartsAt: only before it starts, and to a time still to come.", "type": "string" }, - "thresholdsDays": { - "description": "ThresholdsDays are the SSL monitor's expiry thresholds, largest\nfirst; empty for an HTTP monitor (no expiry alerts).", - "example": [ - 30, - 14, - 7 + "targets": { + "allOf": [ + { + "$ref": "#/components/schemas/dto.MaintenanceWindowTargets" + } ], - "items": { - "type": "integer" - }, - "type": "array" + "description": "Targets replaces them as a whole, only before it starts." + }, + "title": { + "maxLength": 200, + "type": "string" } }, - "required": [ - "certificate", - "checkedAt", - "condition", - "daysRemaining", - "resultId", - "severity", - "thresholdsDays" - ], "type": "object" }, - "dto.MonitorCondition": { + "dto.Monitor": { "properties": { - "alertedThresholds": { - "description": "AlertedThresholds are the expiry thresholds already alerted for the\ncurrent expiry (SSL and domain monitors), oldest first; [] otherwise.\nAn HTTP monitor's watched certificate and domain have theirs on\naspects.", + "aspects": { + "description": "Aspects are the monitor's watched aspects (an HTTP monitor's\ncertificate and domain watches that are on), on list rows too; []\nwithout watches.", "items": { - "$ref": "#/components/schemas/dto.ThresholdAlert" + "$ref": "#/components/schemas/dto.MonitorAspect" }, "type": "array" }, - "code": { - "description": "Code is the condition (\"ok\", \"slow_response\", \"cert_expiring\", ...),\nworded per monitor type by the dashboard.", - "example": "cert_expiring", - "type": "string" + "condition": { + "allOf": [ + { + "$ref": "#/components/schemas/dto.MonitorCondition" + } + ], + "description": "Condition explains status; absent while pending." }, - "conclusiveAt": { - "description": "ConclusiveAt is when a check last confirmed it; older than\nlastCheck.at when the newest checks couldn't tell.", + "createdAt": { "type": "string" }, - "facts": { - "$ref": "#/components/schemas/dto.ConditionFacts" - }, - "message": { - "example": "certificate expires in 5 days (2026-11-05), within the 7-day threshold", + "createdBy": { + "format": "uuid", "type": "string" }, - "since": { - "description": "Since is when the status began (statusSince).", - "type": "string" - } - }, - "required": [ - "alertedThresholds", - "code", - "facts", - "since" - ], - "type": "object" - }, - "dto.MonitorCreate": { - "properties": { "description": { - "example": "Homepage, checked from Frankfurt", "type": "string" }, "domain": { - "$ref": "#/components/schemas/dto.DomainSettingsInput" + "$ref": "#/components/schemas/dto.DomainSettings" + }, + "history": { + "description": "History is set on list rows with include=history: the newest\nresults (at most 60), newest first; [] for a monitor never checked.", + "items": { + "$ref": "#/components/schemas/dto.HistoryBeat" + }, + "type": "array" }, "http": { - "$ref": "#/components/schemas/dto.HTTPSettingsInput" + "$ref": "#/components/schemas/dto.HTTPSettings" + }, + "id": { + "format": "uuid", + "type": "string" }, "intervalSeconds": { - "description": "The org's plan can require more than the 30-second floor (60 s by\ndefault), and domain monitors run at most hourly (3600); the error\nmessage names the minimum.", - "example": 60, - "maximum": 86400, - "minimum": 30, "type": "integer" }, + "last24h": { + "allOf": [ + { + "$ref": "#/components/schemas/dto.WindowSummary" + } + ], + "description": "Last24h is set on list rows of monitors that track uptime (HTTP):\nthe last 24 full hours plus the current one. SSL and domain monitors\nshow days left (condition.facts) instead." + }, + "lastCheck": { + "$ref": "#/components/schemas/dto.LastCheck" + }, + "maintenance": { + "allOf": [ + { + "$ref": "#/components/schemas/dto.MonitorMaintenance" + } + ], + "description": "Maintenance is the window holding the monitor right now (list and detail): alerts\nare paused and the time is out of uptime. Status stays what was measured." + }, "name": { - "example": "Marketing site", "type": "string" }, + "nextCheckAt": { + "type": "string" + }, + "overallStatus": { + "description": "OverallStatus is the worst of status and the statuses of the\nmonitor's watched aspects (critical, warning, pending, ok), paused\nwhile disabled. The list status filter and sort use it.", + "enum": [ + "pending", + "ok", + "warning", + "critical", + "paused" + ], + "type": "string" + }, + "parentResource": { + "description": "ParentResource is set when the monitor belongs to a resource of\nanother Norcube service (\"domainradar:saved_domain:example.com\"). It\ncan't be deleted here, and its domain can't change.", + "example": "domainradar:saved_domain:example.com", + "type": "string" + }, + "regions": { + "description": "Regions are where the monitor is checked from, on list rows too.\nToday every monitor is checked from the one region the service runs\nin; with probes in more regions (planned) a monitor may list\nseveral. Each result says which region checked it (region).", + "items": { + "$ref": "#/components/schemas/dto.CheckRegion" + }, + "type": "array" + }, "ssl": { - "$ref": "#/components/schemas/dto.SSLSettingsInput" + "$ref": "#/components/schemas/dto.SSLSettings" + }, + "status": { + "description": "Status is the primary aspect's: the severity of the last conclusive\ncheck, pending before one, paused while disabled. An inconclusive\ncheck (a failed registry lookup) never changes it.", + "enum": [ + "pending", + "ok", + "warning", + "critical", + "paused" + ], + "type": "string" + }, + "statusSince": { + "type": "string" + }, + "target": { + "example": "https://example.com/health", + "type": "string" }, "type": { "enum": [ @@ -2141,635 +2155,525 @@ "ssl", "domain" ], - "example": "http", + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "variant": { + "description": "Variant is what the monitor does in one word, on list rows too\n(which carry no settings): keyword for an HTTP monitor that looks for\na keyword in the body, otherwise the type.", + "enum": [ + "http", + "keyword", + "ssl", + "domain" + ], + "example": "keyword", "type": "string" } }, "required": [ + "aspects", + "createdAt", + "createdBy", + "description", + "id", "intervalSeconds", "name", - "type" + "overallStatus", + "regions", + "status", + "statusSince", + "target", + "type", + "updatedAt", + "variant" ], "type": "object" }, - "dto.MonitorEvent": { + "dto.MonitorAlertRoute": { "properties": { - "aspect": { - "enum": [ - "availability", - "certificate", - "domain" - ], - "example": "certificate", - "type": "string" - }, - "at": { + "channelId": { + "format": "uuid", "type": "string" }, - "checkResultId": { - "description": "CheckResultID is the check that saw it.", - "type": "integer" - }, - "id": { - "type": "integer" - }, - "renewal": { - "allOf": [ - { - "$ref": "#/components/schemas/dto.CertificateRenewal" - } - ], - "description": "Renewal is set on certificate_renewed." - }, - "type": { - "description": "Type: certificate_renewed, a check saw a certificate other than the\nnewest one so far, expiring later (SSL monitors and HTTP monitors\nthat watch their certificate; an older certificate, say from a node\nbehind on renewals, is not one).", - "enum": [ - "certificate_renewed" + "events": { + "example": [ + "down", + "recovered" ], - "type": "string" + "items": { + "enum": [ + "down", + "warning", + "expiring", + "expired", + "recovered" + ], + "type": "string" + }, + "type": "array" } }, "required": [ - "aspect", - "at", - "checkResultId", - "id", - "type" + "channelId", + "events" ], "type": "object" }, - "dto.MonitorStats": { + "dto.MonitorAlerts": { "properties": { - "avgMs": { - "type": "integer" - }, - "checks": { - "type": "integer" - }, - "critical": { - "type": "integer" - }, - "from": { - "type": "string" - }, - "granularity": { - "enum": [ - "hour", - "day" + "applicableEvents": { + "description": "ApplicableEvents are the events monitors of this type can send\n(offer only these in a routing form).", + "example": [ + "down", + "warning", + "recovered" ], - "type": "string" + "items": { + "enum": [ + "down", + "warning", + "expiring", + "expired", + "recovered" + ], + "type": "string" + }, + "type": "array" }, - "inconclusive": { + "confirmFailures": { "type": "integer" }, - "maxMs": { + "confirmSuccesses": { "type": "integer" }, - "ok": { + "reminderMinutes": { "type": "integer" }, - "series": { + "routes": { "items": { - "$ref": "#/components/schemas/dto.StatsBucket" + "$ref": "#/components/schemas/dto.MonitorAlertRoute" }, "type": "array" }, - "to": { - "type": "string" - }, - "uptimePercent": { - "description": "UptimePercent is (ok + warning) / (ok + warning + critical); absent\nwithout conclusive checks and for SSL and domain monitors.", - "example": 99.95, - "type": "number" - }, - "warning": { - "type": "integer" + "useDefaults": { + "type": "boolean" } }, "required": [ - "checks", - "critical", - "from", - "granularity", - "inconclusive", - "ok", - "series", - "to", - "warning" + "applicableEvents", + "confirmFailures", + "confirmSuccesses", + "reminderMinutes", + "routes", + "useDefaults" ], "type": "object" }, - "dto.MonitorUpdate": { + "dto.MonitorAlertsUpdate": { "properties": { - "description": { - "type": "string" - }, - "domain": { - "$ref": "#/components/schemas/dto.DomainSettingsInput" + "confirmFailures": { + "example": 2, + "maximum": 10, + "minimum": 1, + "type": "integer" }, - "http": { - "$ref": "#/components/schemas/dto.HTTPSettingsInput" + "confirmSuccesses": { + "example": 1, + "maximum": 10, + "minimum": 1, + "type": "integer" }, - "intervalSeconds": { - "maximum": 86400, - "minimum": 30, + "reminderMinutes": { + "example": 60, "type": "integer" }, - "name": { - "type": "string" + "routes": { + "items": { + "$ref": "#/components/schemas/dto.MonitorAlertRoute" + }, + "type": "array" }, - "ssl": { - "$ref": "#/components/schemas/dto.SSLSettingsInput" + "useDefaults": { + "type": "boolean" } }, "type": "object" }, - "dto.PublicStatusAffected": { + "dto.MonitorAspect": { "properties": { - "id": { - "format": "uuid", - "type": "string" - }, - "name": { - "type": "string" + "alertedThresholds": { + "description": "AlertedThresholds are the expiry thresholds already alerted for the\ncurrent expiry, oldest first; [] before the first (or once renewed).", + "items": { + "$ref": "#/components/schemas/dto.ThresholdAlert" + }, + "type": "array" }, - "status": { + "aspect": { "enum": [ - "operational", - "degraded_performance", - "partial_outage", - "major_outage" + "certificate", + "domain" ], "type": "string" - } - }, - "required": [ - "id", - "name", - "status" - ], - "type": "object" - }, - "dto.PublicStatusComponent": { - "properties": { - "avgResponseMs": { - "description": "AvgResponseMs over the page's range, when the page shows response\ntimes.", - "type": "integer" }, - "days": { - "description": "Days are the bar, oldest first, when the page shows bars and the\ncomponent counts availability.", - "items": { - "$ref": "#/components/schemas/dto.PublicStatusDay" - }, - "type": "array" + "checkedAt": { + "description": "CheckedAt is the last observation, conclusive or not; absent before\nthe first.", + "type": "string" }, - "description": { + "condition": { + "description": "Condition explains status (\"ok\", \"cert_expiring\", \"domain_expired\",\n...); absent while pending.", + "example": "cert_expiring", "type": "string" }, - "id": { - "format": "uuid", + "daysRemaining": { + "description": "DaysRemaining is counted when read from expiresAt, negative once\nexpired.", + "example": 12, + "type": "integer" + }, + "expiresAt": { "type": "string" }, - "name": { + "message": { + "example": "certificate expires in 12 days (2026-11-12), within the 14-day threshold", "type": "string" }, "status": { "enum": [ - "operational", - "degraded_performance", - "partial_outage", - "major_outage", - "unknown" + "pending", + "ok", + "warning", + "critical" ], "type": "string" }, - "uptimePercent": { - "description": "UptimePercent over the page's range, when the page shows it.", - "type": "number" + "subject": { + "description": "Subject is what the aspect is about: the URL's host for the\ncertificate, its registrable domain for the domain.", + "example": "example.com", + "type": "string" + }, + "thresholdsDays": { + "example": [ + 30, + 14, + 7 + ], + "items": { + "type": "integer" + }, + "type": "array" } }, "required": [ - "description", - "id", - "name", - "status" + "alertedThresholds", + "aspect", + "status", + "subject", + "thresholdsDays" ], "type": "object" }, - "dto.PublicStatusDay": { + "dto.MonitorBulkItem": { "properties": { - "avgResponseMs": { - "description": "AvgResponseMs: when the page shows response times.", - "type": "integer" - }, - "day": { - "example": "2026-11-10", + "code": { + "example": "MANAGED_RESOURCE", "type": "string" }, - "downtimeMinutes": { - "type": "integer" + "detail": { + "type": "string" }, - "grade": { - "enum": [ - "no_data", - "unknown", - "ok", - "warning", - "minor", - "partial", - "major" - ], + "monitorId": { + "format": "uuid", "type": "string" }, - "uptimePercent": { - "type": "number" + "ok": { + "type": "boolean" } }, "required": [ - "day", - "grade" + "monitorId", + "ok" ], "type": "object" }, - "dto.PublicStatusGroup": { + "dto.MonitorBulkRequest": { "properties": { - "collapsed": { - "type": "boolean" + "action": { + "enum": [ + "pause", + "resume", + "delete" + ], + "example": "pause", + "type": "string" }, - "components": { + "monitorIds": { + "example": [ + "7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f" + ], "items": { - "$ref": "#/components/schemas/dto.PublicStatusComponent" + "type": "string" }, "type": "array" - }, - "description": { - "type": "string" - }, - "id": { - "format": "uuid", - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "enum": [ - "operational", - "degraded_performance", - "partial_outage", - "major_outage", - "unknown" - ], - "type": "string" } }, "required": [ - "collapsed", - "components", - "description", - "id", - "name", - "status" + "action", + "monitorIds" ], "type": "object" }, - "dto.PublicStatusHistory": { + "dto.MonitorBulkResult": { "properties": { - "incidents": { + "action": { + "enum": [ + "pause", + "resume", + "delete" + ], + "type": "string" + }, + "failed": { + "type": "integer" + }, + "items": { "items": { - "$ref": "#/components/schemas/dto.PublicStatusIncident" + "$ref": "#/components/schemas/dto.MonitorBulkItem" }, "type": "array" }, - "schemaVersion": { - "example": 1, + "succeeded": { "type": "integer" } }, "required": [ - "incidents", - "schemaVersion" - ], - "type": "object" + "action", + "failed", + "items", + "succeeded" + ], + "type": "object" }, - "dto.PublicStatusIncident": { + "dto.MonitorCertificate": { "properties": { - "components": { - "items": { - "$ref": "#/components/schemas/dto.PublicStatusAffected" - }, - "type": "array" - }, - "fixedTitle": { - "description": "FixedTitle is the code of a fixed wording the renderer translates; Title holds\nits English. Absent on anything a person wrote.", - "enum": [ - "auto_title" - ], + "alertWindowStart": { + "description": "AlertWindowStart is when the largest threshold is crossed (notAfter\nminus it): shade from here to notAfter.", "type": "string" }, - "id": { - "format": "uuid", + "certificate": { + "$ref": "#/components/schemas/dto.Certificate" + }, + "checkedAt": { "type": "string" }, - "impact": { - "enum": [ - "none", - "minor", - "major", - "critical" - ], + "condition": { + "example": "cert_expiring", "type": "string" }, - "resolvedAt": { + "daysRemaining": { + "description": "DaysRemaining counts from now (certificate.daysRemaining from the\ncheck).", + "example": 41, + "type": "integer" + }, + "errorMessage": { "type": "string" }, - "startedAt": { + "nextThresholdAt": { "type": "string" }, - "status": { + "nextThresholdDays": { + "description": "NextThresholdDays / NextThresholdAt: the next threshold to cross\nand when; absent once past the smallest.", + "example": 30, + "type": "integer" + }, + "resultId": { + "type": "integer" + }, + "severity": { "enum": [ - "investigating", - "identified", - "monitoring", - "resolved" + "ok", + "warning", + "critical", + "inconclusive" ], "type": "string" }, - "title": { - "type": "string" - }, - "updates": { + "thresholdsDays": { + "description": "ThresholdsDays are the SSL monitor's expiry thresholds, largest\nfirst; empty for an HTTP monitor (no expiry alerts).", + "example": [ + 30, + 14, + 7 + ], "items": { - "$ref": "#/components/schemas/dto.PublicStatusUpdate" + "type": "integer" }, "type": "array" } }, "required": [ - "components", - "id", - "impact", - "startedAt", - "status", - "title", - "updates" + "certificate", + "checkedAt", + "condition", + "daysRemaining", + "resultId", + "severity", + "thresholdsDays" ], "type": "object" }, - "dto.PublicStatusPage": { + "dto.MonitorCondition": { "properties": { - "active": { - "description": "Active are the open posts, newest first.", + "alertedThresholds": { + "description": "AlertedThresholds are the expiry thresholds already alerted for the\ncurrent expiry (SSL and domain monitors), oldest first; [] otherwise.\nAn HTTP monitor's watched certificate and domain have theirs on\naspects.", "items": { - "$ref": "#/components/schemas/dto.PublicStatusIncident" + "$ref": "#/components/schemas/dto.ThresholdAlert" }, "type": "array" }, - "asOf": { - "description": "AsOf is when the content last changed.", - "type": "string" - }, - "canonicalUrl": { - "description": "CanonicalURL is the page's address on its active custom domain, where\nsearch engines should credit it.", - "example": "https://status.acme.com", + "code": { + "description": "Code is the condition (\"ok\", \"slow_response\", \"cert_expiring\", ...),\nworded per monitor type by the dashboard.", + "example": "cert_expiring", "type": "string" }, - "components": { - "items": { - "$ref": "#/components/schemas/dto.PublicStatusComponent" - }, - "type": "array" - }, - "description": { + "conclusiveAt": { + "description": "ConclusiveAt is when a check last confirmed it; older than\nlastCheck.at when the newest checks couldn't tell.", "type": "string" }, - "groups": { - "items": { - "$ref": "#/components/schemas/dto.PublicStatusGroup" - }, - "type": "array" + "facts": { + "$ref": "#/components/schemas/dto.ConditionFacts" }, - "id": { - "format": "uuid", + "message": { + "example": "certificate expires in 5 days (2026-11-05), within the 7-day threshold", "type": "string" }, - "indicator": { - "description": "Indicator is the page's one-word verdict.", - "enum": [ - "none", - "minor", - "major", - "critical" - ], + "since": { + "description": "Since is when the status began (statusSince).", "type": "string" - }, - "logo": { - "description": "Logo and LogoDark hold the images as data URIs where there is no public\nfile: a draft's snapshot, and the dashboard's preview.", + } + }, + "required": [ + "alertedThresholds", + "code", + "facts", + "since" + ], + "type": "object" + }, + "dto.MonitorCreate": { + "properties": { + "description": { + "example": "Homepage, checked from Frankfurt", "type": "string" }, - "logoDark": { - "type": "string" + "domain": { + "$ref": "#/components/schemas/dto.DomainSettingsInput" }, - "logoDarkFile": { - "example": "fedcba9876543210fedcba9876543210.svg", - "type": "string" + "http": { + "$ref": "#/components/schemas/dto.HTTPSettingsInput" }, - "logoFile": { - "description": "LogoFile and LogoDarkFile name a published page's logo images, each a file\nthe renderer serves at \u003cpage\u003e/logo/\u003cname\u003e: a hash of the content and an\nextension. Left out when it has none; LogoDarkFile is for dark mode.", - "example": "0123456789abcdef0123456789abcdef.png", - "type": "string" + "intervalSeconds": { + "description": "The org's plan can require more than the 30-second floor (60 s by\ndefault), and domain monitors run at most hourly (3600); the error\nmessage names the minimum.", + "example": 60, + "maximum": 86400, + "minimum": 30, + "type": "integer" }, "name": { - "example": "Acme status", + "example": "Marketing site", "type": "string" }, - "published": { - "description": "Published false: only preview links show it.", - "type": "boolean" - }, - "schemaVersion": { - "example": 1, - "type": "integer" - }, - "searchIndexing": { - "type": "boolean" - }, - "slug": { - "example": "acme", - "type": "string" + "ssl": { + "$ref": "#/components/schemas/dto.SSLSettingsInput" }, - "timeZone": { - "example": "Europe/Prague", + "type": { + "enum": [ + "http", + "ssl", + "domain" + ], + "example": "http", "type": "string" - }, - "uptimeDays": { - "description": "UptimeDays is how many days the bars cover.", - "example": 90, - "type": "integer" } }, "required": [ - "active", - "components", - "description", - "groups", - "id", - "indicator", + "intervalSeconds", "name", - "published", - "schemaVersion", - "searchIndexing", - "slug", - "timeZone", - "uptimeDays" - ], - "type": "object" - }, - "dto.PublicStatusPreview": { - "properties": { - "history": { - "$ref": "#/components/schemas/dto.PublicStatusHistory" - }, - "page": { - "$ref": "#/components/schemas/dto.PublicStatusPage" - } - }, - "required": [ - "history", - "page" + "type" ], "type": "object" }, - "dto.PublicStatusUpdate": { + "dto.MonitorEvent": { "properties": { - "body": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "fixedText": { - "description": "FixedText is the code of a fixed wording the renderer translates; Body holds\nits English. Absent on anything a person wrote.", + "aspect": { "enum": [ - "auto_opened", - "auto_resolved", - "auto_superseded" + "availability", + "certificate", + "domain" ], + "example": "certificate", "type": "string" }, - "id": { - "format": "uuid", + "at": { "type": "string" }, - "status": { - "enum": [ - "investigating", - "identified", - "monitoring", - "resolved" - ], - "type": "string" - } - }, - "required": [ - "body", - "createdAt", - "id", - "status" - ], - "type": "object" - }, - "dto.RenewedCertificate": { - "properties": { - "fingerprintSha256": { - "type": "string" - }, - "issuer": { - "type": "string" - }, - "notAfter": { - "type": "string" + "checkResultId": { + "description": "CheckResultID is the check that saw it.", + "type": "integer" }, - "notBefore": { - "type": "string" + "id": { + "type": "integer" }, - "serialNumber": { - "type": "string" + "renewal": { + "allOf": [ + { + "$ref": "#/components/schemas/dto.CertificateRenewal" + } + ], + "description": "Renewal is set on certificate_renewed." }, - "subject": { + "type": { + "description": "Type: certificate_renewed, a check saw a certificate other than the\nnewest one so far, expiring later (SSL monitors and HTTP monitors\nthat watch their certificate; an older certificate, say from a node\nbehind on renewals, is not one).", + "enum": [ + "certificate_renewed" + ], "type": "string" } }, "required": [ - "issuer", - "notAfter", - "notBefore", - "serialNumber", - "subject" + "aspect", + "at", + "checkResultId", + "id", + "type" ], "type": "object" }, - "dto.SSLSettings": { + "dto.MonitorMaintenance": { "properties": { - "expiryThresholdsDays": { - "items": { - "type": "integer" - }, - "type": "array" - }, - "host": { + "endsAt": { "type": "string" }, - "port": { - "type": "integer" - }, - "serverName": { + "startsAt": { "type": "string" - } - }, - "required": [ - "expiryThresholdsDays", - "host", - "port" - ], - "type": "object" - }, - "dto.SSLSettingsInput": { - "properties": { - "expiryThresholdsDays": { - "example": [ - 30, - 14, - 7 - ], - "items": { - "type": "integer" - }, - "type": "array" }, - "host": { - "example": "example.com", + "title": { "type": "string" }, - "port": { - "example": 443, - "maximum": 65535, - "minimum": 1, - "type": "integer" - }, - "serverName": { - "example": "example.com", + "windowId": { + "format": "uuid", "type": "string" } }, "required": [ - "expiryThresholdsDays", - "host", - "port" + "endsAt", + "startsAt", + "title", + "windowId" ], "type": "object" }, - "dto.StatsBucket": { + "dto.MonitorStats": { "properties": { "avgMs": { "type": "integer" @@ -2780,125 +2684,124 @@ "critical": { "type": "integer" }, + "from": { + "type": "string" + }, + "granularity": { + "enum": [ + "hour", + "day" + ], + "type": "string" + }, "inconclusive": { "type": "integer" }, - "maxMs": { + "maintenance": { + "description": "Maintenance counts the checks inside a maintenance window, whatever they\nfound. They are billed; the other counts cover only what ran outside.", "type": "integer" }, - "ok": { + "maxMs": { "type": "integer" }, - "p50Ms": { + "ok": { "type": "integer" }, - "p95Ms": { - "type": "integer" + "series": { + "items": { + "$ref": "#/components/schemas/dto.StatsBucket" + }, + "type": "array" }, - "region": { + "to": { "type": "string" }, - "start": { - "type": "string" + "uptimePercent": { + "description": "UptimePercent is (ok + warning) / (ok + warning + critical); absent\nwithout conclusive checks and for SSL and domain monitors.", + "example": 99.95, + "type": "number" }, "warning": { "type": "integer" } }, "required": [ - "avgMs", "checks", "critical", + "from", + "granularity", "inconclusive", - "maxMs", + "maintenance", "ok", - "p50Ms", - "p95Ms", - "region", - "start", + "series", + "to", "warning" ], "type": "object" }, - "dto.StatusChange": { + "dto.MonitorUpdate": { "properties": { - "changedAt": { + "description": { "type": "string" }, - "checkResultId": { - "description": "CheckResultID is the result that made the change (raw results are\nkept about 30 days, changes a year).", - "type": "integer" + "domain": { + "$ref": "#/components/schemas/dto.DomainSettingsInput" }, - "condition": { - "description": "Condition is what the check that made the change found.", - "example": "unexpected_status", - "type": "string" + "http": { + "$ref": "#/components/schemas/dto.HTTPSettingsInput" }, - "durationSeconds": { - "description": "DurationSeconds is how long the status lasted (until now for the\nnewest change).", + "intervalSeconds": { + "maximum": 86400, + "minimum": 30, "type": "integer" }, - "endedAt": { - "description": "EndedAt is when the next change happened; absent for the newest\nchange (the current status, unless the monitor is paused).", - "type": "string" - }, - "events": { - "description": "Events are what else happened while this status lasted (from\nchangedAt to endedAt), newest first: certificate renewals. [] when\nnothing did.", - "items": { - "$ref": "#/components/schemas/dto.MonitorEvent" - }, - "type": "array" - }, - "from": { - "enum": [ - "pending", - "ok", - "warning", - "critical" - ], + "name": { "type": "string" }, + "ssl": { + "$ref": "#/components/schemas/dto.SSLSettingsInput" + } + }, + "type": "object" + }, + "dto.PublicStatusAffected": { + "properties": { "id": { - "type": "integer" - }, - "message": { - "example": "status 503 is not accepted (2xx)", + "format": "uuid", "type": "string" }, - "statusCode": { - "example": 503, - "type": "integer" + "name": { + "type": "string" }, - "to": { + "status": { "enum": [ - "ok", - "warning", - "critical" + "operational", + "degraded_performance", + "partial_outage", + "major_outage" ], "type": "string" } }, "required": [ - "changedAt", - "checkResultId", - "condition", - "durationSeconds", - "events", - "from", "id", - "to" + "name", + "status" ], "type": "object" }, - "dto.StatusPage": { + "dto.PublicStatusComponent": { "properties": { - "createdAt": { - "type": "string" + "avgResponseMs": { + "description": "AvgResponseMs over the page's range, when the page shows response\ntimes.", + "type": "integer" }, - "customDomain": { - "description": "CustomDomain is the page's custom domain once active. URL keeps working\nbeside it; GET /status-pages/{id}/domain tells about one still pending.", - "example": "status.acme.com", - "type": "string" + "days": { + "description": "Days are the bar, oldest first, when the page shows bars and the\ncomponent counts availability.", + "items": { + "$ref": "#/components/schemas/dto.PublicStatusDay" + }, + "type": "array" }, "description": { "type": "string" @@ -2908,436 +2811,410 @@ "type": "string" }, "name": { - "example": "Acme status", "type": "string" }, - "published": { - "description": "Published pages are public; others answer 404.", - "type": "boolean" + "status": { + "enum": [ + "operational", + "degraded_performance", + "partial_outage", + "major_outage", + "unknown", + "under_maintenance" + ], + "type": "string" }, - "publishedAt": { - "type": "string" - }, - "settings": { - "$ref": "#/components/schemas/dto.StatusPageSettings" - }, - "slug": { - "example": "acme", - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "url": { - "description": "URL is the page's public address.", - "example": "https://acme.norcubestatus.com", - "type": "string" + "uptimePercent": { + "description": "UptimePercent over the page's range, when the page shows it.", + "type": "number" } }, "required": [ - "createdAt", "description", "id", "name", - "published", - "settings", - "slug", - "updatedAt", - "url" + "status" ], "type": "object" }, - "dto.StatusPageAffected": { + "dto.PublicStatusDay": { "properties": { - "componentId": { - "format": "uuid", + "avgResponseMs": { + "description": "AvgResponseMs: when the page shows response times.", + "type": "integer" + }, + "day": { + "example": "2026-11-10", "type": "string" }, - "status": { + "downtimeMinutes": { + "type": "integer" + }, + "grade": { "enum": [ - "operational", - "degraded_performance", - "partial_outage", - "major_outage" + "no_data", + "unknown", + "ok", + "warning", + "minor", + "partial", + "major", + "maintenance" ], "type": "string" + }, + "maintenanceMinutes": { + "description": "MaintenanceMinutes is how much of the day a window covered. Those minutes\ndon't count towards the day's uptime.", + "type": "integer" + }, + "uptimePercent": { + "type": "number" } }, "required": [ - "componentId", - "status" + "day", + "grade" ], "type": "object" }, - "dto.StatusPageComponent": { + "dto.PublicStatusGroup": { "properties": { - "aspects": { - "description": "Aspects: what counts towards a monitor component's status.", + "collapsed": { + "type": "boolean" + }, + "components": { "items": { - "enum": [ - "availability", - "certificate", - "domain" - ], - "type": "string" + "$ref": "#/components/schemas/dto.PublicStatusComponent" }, "type": "array" }, "description": { - "maxLength": 300, "type": "string" }, "id": { "format": "uuid", "type": "string" }, - "kind": { - "enum": [ - "monitor", - "manual" - ], - "example": "monitor", + "name": { "type": "string" }, - "manualStatus": { - "description": "ManualStatus: a manual component's status.", + "status": { "enum": [ "operational", "degraded_performance", "partial_outage", - "major_outage" + "major_outage", + "unknown", + "under_maintenance" ], "type": "string" - }, - "monitorId": { - "description": "MonitorID: a monitor component's monitor. The public never sees it.", - "format": "uuid", - "type": "string" - }, - "name": { - "description": "Name is what the public sees; the monitor's name and target never are.", - "example": "Website", - "maxLength": 100, - "type": "string" } }, "required": [ - "kind", - "name" + "collapsed", + "components", + "description", + "id", + "name", + "status" ], "type": "object" }, - "dto.StatusPageCreate": { + "dto.PublicStatusHistory": { "properties": { - "description": { - "maxLength": 500, - "type": "string" - }, - "name": { - "example": "Acme status", - "maxLength": 100, - "type": "string" + "incidents": { + "items": { + "$ref": "#/components/schemas/dto.PublicStatusIncident" + }, + "type": "array" }, - "settings": { - "$ref": "#/components/schemas/dto.StatusPageSettings" + "maintenance": { + "description": "Maintenance are the past windows, newest first, including announced ones\nthat were cancelled, so links in mail and feeds keep working. Left out\nwhen there are none.", + "items": { + "$ref": "#/components/schemas/dto.PublicStatusMaintenance" + }, + "type": "array" }, - "slug": { - "description": "Slug is the page's address: lowercase letters, digits and hyphens.", - "example": "acme", - "maxLength": 40, - "minLength": 3, - "type": "string" + "schemaVersion": { + "example": 1, + "type": "integer" } }, "required": [ - "name", - "settings", - "slug" + "incidents", + "schemaVersion" ], "type": "object" }, - "dto.StatusPageDomain": { + "dto.PublicStatusIncident": { "properties": { - "createdAt": { + "components": { + "items": { + "$ref": "#/components/schemas/dto.PublicStatusAffected" + }, + "type": "array" + }, + "fixedTitle": { + "description": "FixedTitle is the code of a fixed wording the renderer translates; Title holds\nits English. Absent on anything a person wrote.", + "enum": [ + "auto_title" + ], "type": "string" }, - "error": { - "description": "Error is what is wrong, while there is something.", + "id": { + "format": "uuid", "type": "string" }, - "errorCode": { - "description": "ErrorCode: DOMAIN_TAKEN when another status page proved this hostname first.\nThe claim stays pending, in case they let it go.", + "impact": { "enum": [ - "DOMAIN_TAKEN" + "none", + "minor", + "major", + "critical" ], "type": "string" }, - "hostname": { - "example": "status.acme.com", + "resolvedAt": { "type": "string" }, - "lastCheckedAt": { + "startedAt": { "type": "string" }, - "records": { - "description": "Records are what the customer adds to their DNS.", - "items": { - "$ref": "#/components/schemas/dto.StatusPageDomainRecord" - }, - "type": "array" - }, "status": { - "description": "Status: pending_ownership until the TXT record proves the organization owns\nthe hostname; pending_dns until Cloudflare sees the CNAME;\npending_certificate until the certificate is live; then active. failed\nmeans given up: set the domain again to start over.", "enum": [ - "pending_ownership", - "pending_dns", - "pending_certificate", - "active", - "failed" + "investigating", + "identified", + "monitoring", + "resolved" ], "type": "string" }, - "updatedAt": { + "title": { "type": "string" + }, + "updates": { + "items": { + "$ref": "#/components/schemas/dto.PublicStatusUpdate" + }, + "type": "array" } }, "required": [ - "createdAt", - "hostname", - "records", + "components", + "id", + "impact", + "startedAt", "status", - "updatedAt" + "title", + "updates" ], "type": "object" }, - "dto.StatusPageDomainRecord": { + "dto.PublicStatusMaintenance": { "properties": { - "name": { - "example": "status.acme.com", + "components": { + "items": { + "$ref": "#/components/schemas/dto.PublicStatusMaintenanceComponent" + }, + "type": "array" + }, + "description": { "type": "string" }, - "required": { - "description": "Required false: not needed now. The ownership TXT record stops being\nrequired once the domain is active (it is needed again if the domain ever\nfalls back to pending), and Cloudflare's own TXT record only helps verify the\nhostname before moving the CNAME.", + "endsAt": { + "type": "string" + }, + "finishedEarly": { + "description": "FinishedEarly: someone ended it before it was due to end; EndsAt is when.", "type": "boolean" }, - "type": { + "id": { + "format": "uuid", + "type": "string" + }, + "startsAt": { + "type": "string" + }, + "status": { + "description": "Status is decided when the snapshot is pushed, because a window that was\nfinished early can't be told from its times alone.", "enum": [ - "CNAME", - "TXT" + "scheduled", + "in_progress", + "completed", + "cancelled" ], - "example": "CNAME", "type": "string" }, - "value": { - "example": "custom.norcubestatus.com", + "title": { + "type": "string" + }, + "updatedAt": { + "description": "UpdatedAt is when the window last changed, or the moment it started or\nended if that came later. Never in the future, so feeds can use it.", "type": "string" } }, "required": [ - "name", - "required", - "type", - "value" + "components", + "description", + "endsAt", + "finishedEarly", + "id", + "startsAt", + "status", + "title", + "updatedAt" ], "type": "object" }, - "dto.StatusPageDomainSet": { + "dto.PublicStatusMaintenanceComponent": { "properties": { - "hostname": { - "description": "Hostname is a subdomain the customer controls, not an apex.", - "example": "status.acme.com", - "maxLength": 253, - "type": "string" - } - }, - "required": [ - "hostname" - ], - "type": "object" - }, - "dto.StatusPageGroup": { - "properties": { - "collapsed": { - "type": "boolean" - }, - "components": { - "items": { - "$ref": "#/components/schemas/dto.StatusPageComponent" - }, - "type": "array" - }, - "description": { - "maxLength": 300, - "type": "string" - }, "id": { "format": "uuid", "type": "string" }, "name": { - "example": "API", - "maxLength": 100, "type": "string" } }, "required": [ - "components", + "id", "name" ], "type": "object" }, - "dto.StatusPageIncident": { + "dto.PublicStatusPage": { "properties": { - "autoManaged": { - "description": "AutoManaged: the system still runs it and resolves it by itself. A person's\nupdate or edit ends that for good.", - "type": "boolean" + "active": { + "description": "Active are the open posts, newest first.", + "items": { + "$ref": "#/components/schemas/dto.PublicStatusIncident" + }, + "type": "array" }, - "autoPosted": { - "description": "AutoPosted: the system wrote this post, in fixed wording.", - "type": "boolean" + "asOf": { + "description": "AsOf is when the content last changed.", + "type": "string" + }, + "canonicalUrl": { + "description": "CanonicalURL is the page's address on its active custom domain, where\nsearch engines should credit it.", + "example": "https://status.acme.com", + "type": "string" }, "components": { "items": { - "$ref": "#/components/schemas/dto.StatusPageAffected" + "$ref": "#/components/schemas/dto.PublicStatusComponent" }, "type": "array" }, - "createdAt": { + "description": { "type": "string" }, + "groups": { + "items": { + "$ref": "#/components/schemas/dto.PublicStatusGroup" + }, + "type": "array" + }, "id": { "format": "uuid", "type": "string" }, - "impact": { + "indicator": { + "description": "Indicator is the page's one-word verdict.", "enum": [ "none", "minor", "major", - "critical" + "critical", + "maintenance" ], "type": "string" }, - "monitorIncidentIds": { - "items": { - "type": "string" - }, - "type": "array" + "logo": { + "description": "Logo and LogoDark hold the images as data URIs where there is no public\nfile: a draft's snapshot, and the dashboard's preview.", + "type": "string" }, - "resolvedAt": { + "logoDark": { "type": "string" }, - "startedAt": { + "logoDarkFile": { + "example": "fedcba9876543210fedcba9876543210.svg", "type": "string" }, - "status": { - "enum": [ - "investigating", - "identified", - "monitoring", - "resolved" - ], + "logoFile": { + "description": "LogoFile and LogoDarkFile name a published page's logo images, each a file\nthe renderer serves at \u003cpage\u003e/logo/\u003cname\u003e: a hash of the content and an\nextension. Left out when it has none; LogoDarkFile is for dark mode.", + "example": "0123456789abcdef0123456789abcdef.png", "type": "string" }, - "statusPageId": { - "format": "uuid", + "maintenance": { + "description": "Maintenance are the windows in progress and the soonest scheduled ones.\nLeft out when there are none, and absent from snapshots pushed before\nwindows existed.", + "items": { + "$ref": "#/components/schemas/dto.PublicStatusMaintenance" + }, + "type": "array" + }, + "name": { + "example": "Acme status", "type": "string" }, - "title": { + "published": { + "description": "Published false: only preview links show it.", + "type": "boolean" + }, + "schemaVersion": { + "example": 1, + "type": "integer" + }, + "searchIndexing": { + "type": "boolean" + }, + "slug": { + "example": "acme", "type": "string" }, - "updatedAt": { + "timeZone": { + "example": "Europe/Prague", "type": "string" }, - "updates": { - "items": { - "$ref": "#/components/schemas/dto.StatusPageIncidentEntry" - }, - "type": "array" + "uptimeDays": { + "description": "UptimeDays is how many days the bars cover.", + "example": 90, + "type": "integer" } }, "required": [ - "autoManaged", - "autoPosted", + "active", "components", - "createdAt", + "description", + "groups", "id", - "impact", - "monitorIncidentIds", - "startedAt", - "status", - "statusPageId", - "title", - "updatedAt", - "updates" + "indicator", + "name", + "published", + "schemaVersion", + "searchIndexing", + "slug", + "timeZone", + "uptimeDays" ], "type": "object" }, - "dto.StatusPageIncidentCreate": { + "dto.PublicStatusPreview": { "properties": { - "body": { - "description": "Body is the first update's text.", - "example": "We are looking into it.", - "maxLength": 5000, - "type": "string" - }, - "components": { - "items": { - "$ref": "#/components/schemas/dto.StatusPageAffected" - }, - "type": "array" - }, - "impact": { - "enum": [ - "none", - "minor", - "major", - "critical" - ], - "example": "minor", - "type": "string" - }, - "monitorIncidentIds": { - "description": "MonitorIncidentIDs are the monitor incidents the post is about (for\nyour navigation, never published).", - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - }, - "notify": { - "description": "Notify mails this update to the page's subscribers. A draft page tells nobody.", - "type": "boolean" - }, - "startedAt": { - "description": "StartedAt defaults to now.", - "type": "string" - }, - "status": { - "enum": [ - "investigating", - "identified", - "monitoring", - "resolved" - ], - "example": "investigating", - "type": "string" + "history": { + "$ref": "#/components/schemas/dto.PublicStatusHistory" }, - "title": { - "example": "Elevated API errors", - "maxLength": 200, - "type": "string" + "page": { + "$ref": "#/components/schemas/dto.PublicStatusPage" } }, "required": [ - "body", - "impact", - "status", - "title" + "history", + "page" ], "type": "object" }, - "dto.StatusPageIncidentEntry": { + "dto.PublicStatusUpdate": { "properties": { "body": { "type": "string" @@ -3345,14 +3222,19 @@ "createdAt": { "type": "string" }, + "fixedText": { + "description": "FixedText is the code of a fixed wording the renderer translates; Body holds\nits English. Absent on anything a person wrote.", + "enum": [ + "auto_opened", + "auto_resolved", + "auto_superseded" + ], + "type": "string" + }, "id": { "format": "uuid", "type": "string" }, - "notifySubscribers": { - "description": "NotifySubscribers: whoever posted this update asked to mail it to the page's\nsubscribers. A draft page tells nobody, whatever this says.", - "type": "boolean" - }, "status": { "enum": [ "investigating", @@ -3367,659 +3249,1951 @@ "body", "createdAt", "id", - "notifySubscribers", "status" ], "type": "object" }, - "dto.StatusPageIncidentPost": { + "dto.RenewedCertificate": { "properties": { - "body": { - "example": "A fix is rolling out.", - "maxLength": 5000, + "fingerprintSha256": { "type": "string" }, - "components": { - "description": "Components, when given, replaces the affected components.", - "items": { - "$ref": "#/components/schemas/dto.StatusPageAffected" - }, - "type": "array" + "issuer": { + "type": "string" }, - "notify": { - "description": "Notify mails this update to the page's subscribers. A draft page tells nobody.", - "type": "boolean" + "notAfter": { + "type": "string" }, - "status": { - "enum": [ - "investigating", - "identified", - "monitoring", - "resolved" - ], - "example": "monitoring", + "notBefore": { + "type": "string" + }, + "serialNumber": { + "type": "string" + }, + "subject": { "type": "string" } }, "required": [ - "body", - "status" + "issuer", + "notAfter", + "notBefore", + "serialNumber", + "subject" ], "type": "object" }, - "dto.StatusPageIncidentUpdate": { + "dto.SSLSettings": { "properties": { - "components": { + "expiryThresholdsDays": { "items": { - "$ref": "#/components/schemas/dto.StatusPageAffected" + "type": "integer" }, "type": "array" }, - "impact": { - "enum": [ - "none", - "minor", - "major", - "critical" - ], + "host": { "type": "string" }, - "monitorIncidentIds": { - "items": { - "format": "uuid", - "type": "string" - }, - "type": "array" - }, - "startedAt": { - "type": "string" + "port": { + "type": "integer" }, - "title": { - "maxLength": 200, + "serverName": { "type": "string" } }, + "required": [ + "expiryThresholdsDays", + "host", + "port" + ], "type": "object" }, - "dto.StatusPageLayout": { + "dto.SSLSettingsInput": { "properties": { - "components": { + "expiryThresholdsDays": { + "example": [ + 30, + 14, + 7 + ], "items": { - "$ref": "#/components/schemas/dto.StatusPageComponent" + "type": "integer" }, "type": "array" }, - "groups": { - "items": { - "$ref": "#/components/schemas/dto.StatusPageGroup" - }, - "type": "array" - } - }, - "required": [ - "components", - "groups" - ], - "type": "object" - }, - "dto.StatusPageLogo": { - "properties": { - "dark": { + "host": { + "example": "example.com", "type": "string" }, - "light": { - "example": "data:image/svg+xml;base64,PHN2Zy8+", - "type": "string" - } - }, - "type": "object" - }, - "dto.StatusPageLogoSet": { - "properties": { - "dark": { - "description": "Dark is the image for dark mode, in the same form.", - "type": "string" + "port": { + "example": 443, + "maximum": 65535, + "minimum": 1, + "type": "integer" }, - "light": { - "description": "Light is the image, base64 encoded: PNG, JPEG, WebP or SVG, at most 48 KB.", + "serverName": { + "example": "example.com", "type": "string" } }, "required": [ - "light" + "expiryThresholdsDays", + "host", + "port" ], "type": "object" }, - "dto.StatusPagePreviewLink": { + "dto.StatsBucket": { "properties": { - "expiresAt": { - "type": "string" + "avgMs": { + "type": "integer" }, - "url": { - "type": "string" - } - }, - "required": [ - "expiresAt", - "url" - ], - "type": "object" - }, - "dto.StatusPageSettings": { - "properties": { - "autoPost": { - "description": "AutoPost posts a confirmed critical monitor incident on the page by itself, in\nfixed wording, and resolves it when the incident ends. Off unless asked for.", - "type": "boolean" + "checks": { + "type": "integer" }, - "historyDays": { - "description": "HistoryDays is how far back resolved incidents stay on the page.", - "example": 90, - "maximum": 365, - "minimum": 7, + "critical": { "type": "integer" }, - "searchIndexing": { - "description": "SearchIndexing false asks search engines to leave the page out.", - "type": "boolean" + "inconclusive": { + "type": "integer" }, - "showResponseTime": { - "type": "boolean" + "maintenance": { + "description": "Maintenance counts the checks inside a maintenance window, whatever they\nfound. They are billed; the other counts cover only what ran outside.", + "type": "integer" }, - "showUptimeBars": { - "type": "boolean" + "maxMs": { + "type": "integer" }, - "showUptimePercent": { - "type": "boolean" + "ok": { + "type": "integer" }, - "timeZone": { - "description": "TimeZone is the IANA zone times are shown in.", - "example": "Europe/Prague", + "p50Ms": { + "type": "integer" + }, + "p95Ms": { + "type": "integer" + }, + "region": { "type": "string" }, - "uptimeDays": { - "description": "UptimeDays is how many days the bars cover.", - "enum": [ - 30, - 60, - 90 - ], - "example": 90, + "start": { + "type": "string" + }, + "warning": { "type": "integer" } }, "required": [ - "historyDays", - "searchIndexing", - "showResponseTime", - "showUptimeBars", - "showUptimePercent", - "timeZone", - "uptimeDays" + "avgMs", + "checks", + "critical", + "inconclusive", + "maintenance", + "maxMs", + "ok", + "p50Ms", + "p95Ms", + "region", + "start", + "warning" ], "type": "object" }, - "dto.StatusPageSettingsUpdate": { + "dto.StatusChange": { "properties": { - "autoPost": { - "type": "boolean" + "changedAt": { + "type": "string" }, - "historyDays": { - "maximum": 365, - "minimum": 7, + "checkResultId": { + "description": "CheckResultID is the result that made the change (raw results are\nkept about 30 days, changes a year).", "type": "integer" }, - "searchIndexing": { - "type": "boolean" - }, - "showResponseTime": { - "type": "boolean" - }, - "showUptimeBars": { - "type": "boolean" + "condition": { + "description": "Condition is what the check that made the change found.", + "example": "unexpected_status", + "type": "string" }, - "showUptimePercent": { - "type": "boolean" + "durationSeconds": { + "description": "DurationSeconds is how long the status lasted (until now for the\nnewest change).", + "type": "integer" }, - "timeZone": { - "example": "Europe/Prague", + "endedAt": { + "description": "EndedAt is when the next change happened; absent for the newest\nchange (the current status, unless the monitor is paused).", "type": "string" }, - "uptimeDays": { - "enum": [ - 30, - 60, - 90 - ], - "type": "integer" - } - }, - "type": "object" - }, - "dto.StatusPageSubscriber": { - "properties": { - "componentIds": { - "description": "ComponentIDs are the components it wants to hear about. Empty: all of them.", + "events": { + "description": "Events are what else happened while this status lasted (from\nchangedAt to endedAt), newest first: certificate renewals. [] when\nnothing did.", "items": { - "type": "string" + "$ref": "#/components/schemas/dto.MonitorEvent" }, "type": "array" }, - "confirmedAt": { + "from": { + "enum": [ + "pending", + "ok", + "warning", + "critical" + ], "type": "string" }, - "createdAt": { - "type": "string" + "id": { + "type": "integer" }, - "email": { - "example": "jan@example.com", + "maintenanceWindowId": { + "description": "MaintenanceWindowID is the window the change happened in, absent outside one.", + "format": "uuid", "type": "string" }, - "id": { - "format": "uuid", + "message": { + "example": "status 503 is not accepted (2xx)", "type": "string" }, - "locale": { - "description": "Locale is the language its mail comes in.", + "statusCode": { + "example": 503, + "type": "integer" + }, + "to": { "enum": [ - "en", - "de", - "fr", - "it", - "es", - "pl", - "cs", - "zh-CN" - ], - "example": "en", - "type": "string" - }, - "status": { - "description": "Status: pending until the address confirms. A pending one is removed after 7 days.", - "enum": [ - "pending", - "confirmed" + "ok", + "warning", + "critical" ], "type": "string" } }, "required": [ - "componentIds", - "createdAt", - "email", + "changedAt", + "checkResultId", + "condition", + "durationSeconds", + "events", + "from", "id", - "locale", - "status" + "to" ], "type": "object" }, - "dto.StatusPageSubscriberCount": { + "dto.StatusPage": { "properties": { - "confirmed": { - "example": 120, - "type": "integer" + "createdAt": { + "type": "string" + }, + "customDomain": { + "description": "CustomDomain is the page's custom domain once active. URL keeps working\nbeside it; GET /status-pages/{id}/domain tells about one still pending.", + "example": "status.acme.com", + "type": "string" }, - "pending": { - "example": 3, - "type": "integer" - } - }, - "required": [ - "confirmed", - "pending" - ], - "type": "object" - }, - "dto.StatusPageUpdate": { - "properties": { "description": { - "maxLength": 500, + "type": "string" + }, + "glance": { + "allOf": [ + { + "$ref": "#/components/schemas/dto.StatusPageGlance" + } + ], + "description": "Glance is how the page is doing, on the list of pages only." + }, + "id": { + "format": "uuid", "type": "string" }, "name": { - "maxLength": 100, + "example": "Acme status", + "type": "string" + }, + "published": { + "description": "Published pages are public; others answer 404.", + "type": "boolean" + }, + "publishedAt": { "type": "string" }, "settings": { - "$ref": "#/components/schemas/dto.StatusPageSettingsUpdate" + "$ref": "#/components/schemas/dto.StatusPageSettings" }, "slug": { - "maxLength": 40, - "minLength": 3, + "example": "acme", + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "url": { + "description": "URL is the page's public address.", + "example": "https://acme.norcubestatus.com", "type": "string" } }, + "required": [ + "createdAt", + "description", + "id", + "name", + "published", + "settings", + "slug", + "updatedAt", + "url" + ], "type": "object" }, - "dto.ThresholdAlert": { + "dto.StatusPageAffected": { "properties": { - "alertedAt": { + "componentId": { + "format": "uuid", "type": "string" }, - "days": { - "example": 14, - "type": "integer" + "status": { + "enum": [ + "operational", + "degraded_performance", + "partial_outage", + "major_outage" + ], + "type": "string" } }, "required": [ - "alertedAt", - "days" + "componentId", + "status" ], "type": "object" }, - "dto.WindowSummary": { + "dto.StatusPageComponent": { "properties": { - "avgMs": { - "example": 182, - "type": "integer" - }, - "checks": { - "type": "integer" - }, - "critical": { - "type": "integer" + "aspects": { + "description": "Aspects: what counts towards a monitor component's status.", + "items": { + "enum": [ + "availability", + "certificate", + "domain" + ], + "type": "string" + }, + "type": "array" }, - "from": { + "description": { + "maxLength": 300, "type": "string" }, - "inconclusive": { - "type": "integer" - }, - "ok": { - "type": "integer" - }, - "p50Ms": { - "description": "P50Ms and P95Ms approximate the window's median and 95th percentile\nresponse time (the checks-weighted mean of the hourly percentiles).", - "example": 150, - "type": "integer" + "id": { + "format": "uuid", + "type": "string" }, - "p95Ms": { - "example": 420, - "type": "integer" + "kind": { + "enum": [ + "monitor", + "manual" + ], + "example": "monitor", + "type": "string" }, - "uptimePercent": { - "description": "UptimePercent is (ok + warning) / (ok + warning + critical): a\nwarning still answered, an inconclusive check counts neither way.\nWarningPercent is the warnings' share of the conclusive checks.", - "example": 99.93, - "type": "number" + "manualStatus": { + "description": "ManualStatus: a manual component's status.", + "enum": [ + "operational", + "degraded_performance", + "partial_outage", + "major_outage" + ], + "type": "string" }, - "warning": { - "type": "integer" + "monitorId": { + "description": "MonitorID: a monitor component's monitor. The public never sees it.", + "format": "uuid", + "type": "string" }, - "warningPercent": { - "example": 0.4, - "type": "number" + "name": { + "description": "Name is what the public sees; the monitor's name and target never are.", + "example": "Website", + "maxLength": 100, + "type": "string" } }, "required": [ - "checks", - "critical", - "from", - "inconclusive", - "ok", - "warning" + "kind", + "name" ], "type": "object" }, - "response.APIResponsePaginationCursors": { + "dto.StatusPageCreate": { "properties": { - "next": { - "example": "eyJpZCI6InUuLi4ifQ==", + "description": { + "maxLength": 500, "type": "string" }, - "prev": { - "example": "eyJpZCI6InUuLi4ifQ==", - "type": "string" - } - }, - "type": "object" - }, - "response.APIResponsePaginationMeta": { - "properties": { - "timestamp": { - "example": "2025-01-08T17:29:30.663Z", + "name": { + "example": "Acme status", + "maxLength": 100, "type": "string" - } - }, - "type": "object" - }, - "response.APIResponseWithPagination": { - "properties": { - "cursors": { - "$ref": "#/components/schemas/response.APIResponsePaginationCursors" }, - "list": {}, - "meta": { - "$ref": "#/components/schemas/response.APIResponsePaginationMeta" + "settings": { + "$ref": "#/components/schemas/dto.StatusPageSettings" + }, + "slug": { + "description": "Slug is the page's address: lowercase letters, digits and hyphens.", + "example": "acme", + "maxLength": 40, + "minLength": 3, + "type": "string" } }, "required": [ - "cursors", - "list", - "meta" + "name", + "settings", + "slug" ], "type": "object" }, - "response.Problem": { + "dto.StatusPageDomain": { "properties": { - "code": { - "allOf": [ - { - "$ref": "#/components/schemas/constants.ErrorCode" - } - ], - "example": "VALIDATION_FAILED" - }, - "data": { - "additionalProperties": { - "type": "string" - }, - "description": "Data holds stable facts about the error (\"limit\"), the same ones gRPC\nsends as ErrorInfo metadata.", - "type": "object" - }, - "detail": { - "description": "Detail is an English sentence for people.", - "example": "The request has invalid fields.", + "createdAt": { "type": "string" }, - "errors": { - "description": "Errors lists the field problems of a VALIDATION_FAILED problem.", - "items": { - "$ref": "#/components/schemas/validation.Violation" - }, - "type": "array" - }, - "instance": { - "description": "Instance identifies this occurrence: the request id the server\ngenerated, also sent as X-Request-ID and logged as request_id.", - "example": "urn:uuid:3f2c8a8e-6c1d-4a59-9a43-2b1f0f6f9d10", - "format": "uri", + "error": { + "description": "Error is what is wrong, while there is something.", "type": "string" }, - "reason": { - "allOf": [ - { - "$ref": "#/components/schemas/constants.ErrorReason" - } + "errorCode": { + "description": "ErrorCode: DOMAIN_TAKEN when another status page proved this hostname first.\nThe claim stays pending, in case they let it go.", + "enum": [ + "DOMAIN_TAKEN" ], - "description": "Reason is a finer stable cause within Code, when there is one." + "type": "string" }, - "status": { - "example": 400, - "type": "integer" + "hostname": { + "example": "status.acme.com", + "type": "string" }, - "timestamp": { + "lastCheckedAt": { "type": "string" }, - "title": { - "example": "Validation failed", + "records": { + "description": "Records are what the customer adds to their DNS.", + "items": { + "$ref": "#/components/schemas/dto.StatusPageDomainRecord" + }, + "type": "array" + }, + "status": { + "description": "Status: pending_ownership until the TXT record proves the organization owns\nthe hostname; pending_dns until Cloudflare sees the CNAME;\npending_certificate until the certificate is live; then active. failed\nmeans given up: set the domain again to start over.", + "enum": [ + "pending_ownership", + "pending_dns", + "pending_certificate", + "active", + "failed" + ], "type": "string" }, - "type": { - "description": "Type identifies the problem type (one per code); it may be\ndereferenced for documentation.", - "example": "https://docs.norcube.com/errors/validation-failed", - "format": "uri", + "updatedAt": { "type": "string" } }, "required": [ - "code", - "detail", - "instance", + "createdAt", + "hostname", + "records", "status", - "timestamp", - "title", - "type" + "updatedAt" ], "type": "object" }, - "validation.Params": { + "dto.StatusPageDomainRecord": { "properties": { - "allowed": { - "description": "Allowed: oneOf.", - "items": { - "type": "string" - }, - "type": "array" - }, - "expected": { - "description": "Expected: type, mismatch.", - "type": "string" - }, - "field": { - "description": "Field is the pointer of the other field: min and max compared with a\nfield, exclusive, dependsOn.", - "example": "/http/requestBody", + "name": { + "example": "status.acme.com", "type": "string" }, - "max": { - "description": "Max: range, max, maxLength, maxItems.", - "example": 30000, - "type": "integer" - }, - "min": { - "description": "Min: range, min.", - "example": 1000, - "type": "integer" + "required": { + "description": "Required false: not needed now. The ownership TXT record stops being\nrequired once the domain is active (it is needed again if the domain ever\nfalls back to pending), and Cloudflare's own TXT record only helps verify the\nhostname before moving the CNAME.", + "type": "boolean" }, - "unit": { - "allOf": [ - { - "$ref": "#/components/schemas/validation.Unit" - } + "type": { + "enum": [ + "CNAME", + "TXT" ], - "description": "Unit: maxLength." + "example": "CNAME", + "type": "string" }, "value": { - "description": "Value: unsupported.", + "example": "custom.norcubestatus.com", "type": "string" } }, - "type": "object" - }, - "validation.Rule": { - "enum": [ + "required": [ + "name", "required", - "min", - "max", - "range", - "maxLength", - "maxItems", - "oneOf", - "format", - "public", - "unique", - "exclusive", - "dependsOn", - "notAllowed", - "immutable", - "unknown", - "duplicate", "type", - "reference", - "unverified", - "unsupported", - "mismatch" + "value" ], - "type": "string", - "x-enum-varnames": [ - "RuleRequired", - "RuleMin", - "RuleMax", - "RuleRange", - "RuleMaxLength", - "RuleMaxItems", - "RuleOneOf", - "RuleFormat", - "RulePublic", - "RuleUnique", - "RuleExclusive", - "RuleDependsOn", - "RuleNotAllowed", - "RuleImmutable", - "RuleUnknown", - "RuleDuplicate", - "RuleType", - "RuleReference", - "RuleUnverified", - "RuleUnsupported", - "RuleMismatch" - ] + "type": "object" }, - "validation.Unit": { - "enum": [ - "characters", - "bytes" + "dto.StatusPageDomainSet": { + "properties": { + "hostname": { + "description": "Hostname is a subdomain the customer controls, not an apex.", + "example": "status.acme.com", + "maxLength": 253, + "type": "string" + } + }, + "required": [ + "hostname" ], - "type": "string", - "x-enum-varnames": [ - "UnitCharacters", - "UnitBytes" - ] + "type": "object" }, - "validation.Violation": { + "dto.StatusPageGlance": { "properties": { - "detail": { - "example": "must be between 1000 and 30000", - "type": "string" - }, - "params": { - "$ref": "#/components/schemas/validation.Params" - }, - "pointer": { - "example": "/http/timeoutMs", - "type": "string" + "components": { + "description": "Components are all of the page's components in layout order, groups flattened.", + "items": { + "$ref": "#/components/schemas/dto.StatusPageGlanceComponent" + }, + "type": "array" }, - "rule": { + "domain": { "allOf": [ { - "$ref": "#/components/schemas/validation.Rule" + "$ref": "#/components/schemas/dto.StatusPageGlanceDomain" } ], - "example": "range" + "description": "Domain is the custom domain in whatever state; left out without one." + }, + "incidents": { + "description": "Incidents are the open posts, newest first.", + "items": { + "$ref": "#/components/schemas/dto.StatusPageGlanceIncident" + }, + "type": "array" + }, + "indicator": { + "description": "Indicator is the page's one-word verdict.", + "enum": [ + "none", + "minor", + "major", + "critical", + "maintenance" + ], + "type": "string" + }, + "maintenance": { + "description": "Maintenance are the windows in progress and the soonest scheduled ones.", + "items": { + "$ref": "#/components/schemas/dto.StatusPageGlanceMaintenance" + }, + "type": "array" + }, + "subscribers": { + "description": "Subscribers counts confirmed addresses.", + "example": 120, + "type": "integer" } }, "required": [ - "detail", - "pointer", - "rule" + "components", + "incidents", + "indicator", + "maintenance", + "subscribers" ], "type": "object" - } - } - }, - "info": { - "contact": { - "email": "jan@jetlio.com", - "name": "Jan Švábík" - }, - "description": "Uptime, SSL certificate and domain expiry monitoring.", - "title": "Norcube Monitor API", - "version": "" - }, - "openapi": "3.0.3", - "paths": { - "/alert-channels": { + }, + "dto.StatusPageGlanceComponent": { + "properties": { + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "enum": [ + "operational", + "degraded_performance", + "partial_outage", + "major_outage", + "unknown", + "under_maintenance" + ], + "type": "string" + }, + "uptimePercent": { + "description": "UptimePercent over the page's range, when the page shows it and the\ncomponent counts availability.", + "type": "number" + } + }, + "required": [ + "id", + "name", + "status" + ], + "type": "object" + }, + "dto.StatusPageGlanceDomain": { + "properties": { + "errorCode": { + "description": "ErrorCode: DOMAIN_TAKEN when another status page proved this hostname first.", + "enum": [ + "DOMAIN_TAKEN" + ], + "type": "string" + }, + "hostname": { + "example": "status.acme.com", + "type": "string" + }, + "status": { + "description": "Status: the same words as GET /status-pages/{id}/domain.", + "enum": [ + "pending_ownership", + "pending_dns", + "pending_certificate", + "active", + "failed" + ], + "type": "string" + } + }, + "required": [ + "hostname", + "status" + ], + "type": "object" + }, + "dto.StatusPageGlanceIncident": { + "properties": { + "id": { + "format": "uuid", + "type": "string" + }, + "impact": { + "enum": [ + "none", + "minor", + "major", + "critical" + ], + "type": "string" + }, + "startedAt": { + "type": "string" + }, + "status": { + "enum": [ + "investigating", + "identified", + "monitoring", + "resolved" + ], + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "id", + "impact", + "startedAt", + "status", + "title" + ], + "type": "object" + }, + "dto.StatusPageGlanceMaintenance": { + "properties": { + "endsAt": { + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "startsAt": { + "type": "string" + }, + "status": { + "enum": [ + "scheduled", + "in_progress" + ], + "type": "string" + }, + "title": { + "type": "string" + } + }, + "required": [ + "endsAt", + "id", + "startsAt", + "status", + "title" + ], + "type": "object" + }, + "dto.StatusPageGroup": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "components": { + "items": { + "$ref": "#/components/schemas/dto.StatusPageComponent" + }, + "type": "array" + }, + "description": { + "maxLength": 300, + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "name": { + "example": "API", + "maxLength": 100, + "type": "string" + } + }, + "required": [ + "components", + "name" + ], + "type": "object" + }, + "dto.StatusPageIncident": { + "properties": { + "autoManaged": { + "description": "AutoManaged: the system still runs it and resolves it by itself. A person's\nupdate or edit ends that for good.", + "type": "boolean" + }, + "autoPosted": { + "description": "AutoPosted: the system wrote this post, in fixed wording.", + "type": "boolean" + }, + "components": { + "items": { + "$ref": "#/components/schemas/dto.StatusPageAffected" + }, + "type": "array" + }, + "createdAt": { + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "impact": { + "enum": [ + "none", + "minor", + "major", + "critical" + ], + "type": "string" + }, + "monitorIncidentIds": { + "items": { + "type": "string" + }, + "type": "array" + }, + "resolvedAt": { + "type": "string" + }, + "startedAt": { + "type": "string" + }, + "status": { + "enum": [ + "investigating", + "identified", + "monitoring", + "resolved" + ], + "type": "string" + }, + "statusPageId": { + "format": "uuid", + "type": "string" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "updates": { + "items": { + "$ref": "#/components/schemas/dto.StatusPageIncidentEntry" + }, + "type": "array" + } + }, + "required": [ + "autoManaged", + "autoPosted", + "components", + "createdAt", + "id", + "impact", + "monitorIncidentIds", + "startedAt", + "status", + "statusPageId", + "title", + "updatedAt", + "updates" + ], + "type": "object" + }, + "dto.StatusPageIncidentCreate": { + "properties": { + "body": { + "description": "Body is the first update's text.", + "example": "We are looking into it.", + "maxLength": 5000, + "type": "string" + }, + "components": { + "items": { + "$ref": "#/components/schemas/dto.StatusPageAffected" + }, + "type": "array" + }, + "impact": { + "enum": [ + "none", + "minor", + "major", + "critical" + ], + "example": "minor", + "type": "string" + }, + "monitorIncidentIds": { + "description": "MonitorIncidentIDs are the monitor incidents the post is about (for\nyour navigation, never published).", + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "notify": { + "description": "Notify mails this update to the page's subscribers. A draft page tells nobody.", + "type": "boolean" + }, + "startedAt": { + "description": "StartedAt defaults to now.", + "type": "string" + }, + "status": { + "enum": [ + "investigating", + "identified", + "monitoring", + "resolved" + ], + "example": "investigating", + "type": "string" + }, + "title": { + "example": "Elevated API errors", + "maxLength": 200, + "type": "string" + } + }, + "required": [ + "body", + "impact", + "status", + "title" + ], + "type": "object" + }, + "dto.StatusPageIncidentEntry": { + "properties": { + "body": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "notifySubscribers": { + "description": "NotifySubscribers: whoever posted this update asked to mail it to the page's\nsubscribers. A draft page tells nobody, whatever this says.", + "type": "boolean" + }, + "status": { + "enum": [ + "investigating", + "identified", + "monitoring", + "resolved" + ], + "type": "string" + } + }, + "required": [ + "body", + "createdAt", + "id", + "notifySubscribers", + "status" + ], + "type": "object" + }, + "dto.StatusPageIncidentPost": { + "properties": { + "body": { + "example": "A fix is rolling out.", + "maxLength": 5000, + "type": "string" + }, + "components": { + "description": "Components, when given, replaces the affected components.", + "items": { + "$ref": "#/components/schemas/dto.StatusPageAffected" + }, + "type": "array" + }, + "notify": { + "description": "Notify mails this update to the page's subscribers. A draft page tells nobody.", + "type": "boolean" + }, + "status": { + "enum": [ + "investigating", + "identified", + "monitoring", + "resolved" + ], + "example": "monitoring", + "type": "string" + } + }, + "required": [ + "body", + "status" + ], + "type": "object" + }, + "dto.StatusPageIncidentUpdate": { + "properties": { + "components": { + "items": { + "$ref": "#/components/schemas/dto.StatusPageAffected" + }, + "type": "array" + }, + "impact": { + "enum": [ + "none", + "minor", + "major", + "critical" + ], + "type": "string" + }, + "monitorIncidentIds": { + "items": { + "format": "uuid", + "type": "string" + }, + "type": "array" + }, + "startedAt": { + "type": "string" + }, + "title": { + "maxLength": 200, + "type": "string" + } + }, + "type": "object" + }, + "dto.StatusPageLayout": { + "properties": { + "components": { + "items": { + "$ref": "#/components/schemas/dto.StatusPageComponent" + }, + "type": "array" + }, + "groups": { + "items": { + "$ref": "#/components/schemas/dto.StatusPageGroup" + }, + "type": "array" + } + }, + "required": [ + "components", + "groups" + ], + "type": "object" + }, + "dto.StatusPageLogo": { + "properties": { + "dark": { + "type": "string" + }, + "light": { + "example": "data:image/svg+xml;base64,PHN2Zy8+", + "type": "string" + } + }, + "type": "object" + }, + "dto.StatusPageLogoSet": { + "properties": { + "dark": { + "description": "Dark is the image for dark mode, in the same form.", + "type": "string" + }, + "light": { + "description": "Light is the image, base64 encoded: PNG, JPEG, WebP or SVG, at most 48 KB.", + "type": "string" + } + }, + "required": [ + "light" + ], + "type": "object" + }, + "dto.StatusPagePreviewLink": { + "properties": { + "expiresAt": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "expiresAt", + "url" + ], + "type": "object" + }, + "dto.StatusPageSettings": { + "properties": { + "autoPost": { + "description": "AutoPost posts a confirmed critical monitor incident on the page by itself, in\nfixed wording, and resolves it when the incident ends. Off unless asked for.", + "type": "boolean" + }, + "historyDays": { + "description": "HistoryDays is how far back resolved incidents stay on the page.", + "example": 90, + "maximum": 365, + "minimum": 7, + "type": "integer" + }, + "searchIndexing": { + "description": "SearchIndexing false asks search engines to leave the page out.", + "type": "boolean" + }, + "showResponseTime": { + "type": "boolean" + }, + "showUptimeBars": { + "type": "boolean" + }, + "showUptimePercent": { + "type": "boolean" + }, + "timeZone": { + "description": "TimeZone is the IANA zone times are shown in.", + "example": "Europe/Prague", + "type": "string" + }, + "uptimeDays": { + "description": "UptimeDays is how many days the bars cover.", + "enum": [ + 30, + 60, + 90 + ], + "example": 90, + "type": "integer" + } + }, + "required": [ + "historyDays", + "searchIndexing", + "showResponseTime", + "showUptimeBars", + "showUptimePercent", + "timeZone", + "uptimeDays" + ], + "type": "object" + }, + "dto.StatusPageSettingsUpdate": { + "properties": { + "autoPost": { + "type": "boolean" + }, + "historyDays": { + "maximum": 365, + "minimum": 7, + "type": "integer" + }, + "searchIndexing": { + "type": "boolean" + }, + "showResponseTime": { + "type": "boolean" + }, + "showUptimeBars": { + "type": "boolean" + }, + "showUptimePercent": { + "type": "boolean" + }, + "timeZone": { + "example": "Europe/Prague", + "type": "string" + }, + "uptimeDays": { + "enum": [ + 30, + 60, + 90 + ], + "type": "integer" + } + }, + "type": "object" + }, + "dto.StatusPageSubscriber": { + "properties": { + "componentIds": { + "description": "ComponentIDs are the components it wants to hear about. Empty: all of them.", + "items": { + "type": "string" + }, + "type": "array" + }, + "confirmedAt": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "email": { + "example": "jan@example.com", + "type": "string" + }, + "id": { + "format": "uuid", + "type": "string" + }, + "locale": { + "description": "Locale is the language its mail comes in.", + "enum": [ + "en", + "de", + "fr", + "it", + "es", + "pl", + "cs", + "zh-CN" + ], + "example": "en", + "type": "string" + }, + "status": { + "description": "Status: pending until the address confirms. A pending one is removed after 7 days.", + "enum": [ + "pending", + "confirmed" + ], + "type": "string" + } + }, + "required": [ + "componentIds", + "createdAt", + "email", + "id", + "locale", + "status" + ], + "type": "object" + }, + "dto.StatusPageSubscriberCount": { + "properties": { + "confirmed": { + "example": 120, + "type": "integer" + }, + "pending": { + "example": 3, + "type": "integer" + } + }, + "required": [ + "confirmed", + "pending" + ], + "type": "object" + }, + "dto.StatusPageUpdate": { + "properties": { + "description": { + "maxLength": 500, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + }, + "settings": { + "$ref": "#/components/schemas/dto.StatusPageSettingsUpdate" + }, + "slug": { + "maxLength": 40, + "minLength": 3, + "type": "string" + } + }, + "type": "object" + }, + "dto.ThresholdAlert": { + "properties": { + "alertedAt": { + "type": "string" + }, + "days": { + "example": 14, + "type": "integer" + } + }, + "required": [ + "alertedAt", + "days" + ], + "type": "object" + }, + "dto.WindowSummary": { + "properties": { + "avgMs": { + "example": 182, + "type": "integer" + }, + "checks": { + "type": "integer" + }, + "critical": { + "type": "integer" + }, + "from": { + "type": "string" + }, + "inconclusive": { + "type": "integer" + }, + "maintenance": { + "description": "Maintenance counts the checks inside a maintenance window, whatever they\nfound. They are billed; the other counts cover only what ran outside.", + "type": "integer" + }, + "ok": { + "type": "integer" + }, + "p50Ms": { + "description": "P50Ms and P95Ms approximate the window's median and 95th percentile\nresponse time (the checks-weighted mean of the hourly percentiles).", + "example": 150, + "type": "integer" + }, + "p95Ms": { + "example": 420, + "type": "integer" + }, + "uptimePercent": { + "description": "UptimePercent is (ok + warning) / (ok + warning + critical): a\nwarning still answered, an inconclusive check counts neither way.\nWarningPercent is the warnings' share of the conclusive checks.", + "example": 99.93, + "type": "number" + }, + "warning": { + "type": "integer" + }, + "warningPercent": { + "example": 0.4, + "type": "number" + } + }, + "required": [ + "checks", + "critical", + "from", + "inconclusive", + "maintenance", + "ok", + "warning" + ], + "type": "object" + }, + "response.APIResponsePaginationCursors": { + "properties": { + "next": { + "example": "eyJpZCI6InUuLi4ifQ==", + "type": "string" + }, + "prev": { + "example": "eyJpZCI6InUuLi4ifQ==", + "type": "string" + } + }, + "type": "object" + }, + "response.APIResponsePaginationMeta": { + "properties": { + "timestamp": { + "example": "2025-01-08T17:29:30.663Z", + "type": "string" + } + }, + "type": "object" + }, + "response.APIResponseWithPagination": { + "properties": { + "cursors": { + "$ref": "#/components/schemas/response.APIResponsePaginationCursors" + }, + "list": {}, + "meta": { + "$ref": "#/components/schemas/response.APIResponsePaginationMeta" + } + }, + "required": [ + "cursors", + "list", + "meta" + ], + "type": "object" + }, + "response.Problem": { + "properties": { + "code": { + "allOf": [ + { + "$ref": "#/components/schemas/constants.ErrorCode" + } + ], + "example": "VALIDATION_FAILED" + }, + "data": { + "additionalProperties": { + "type": "string" + }, + "description": "Data holds stable facts about the error (\"limit\"), the same ones gRPC\nsends as ErrorInfo metadata.", + "type": "object" + }, + "detail": { + "description": "Detail is an English sentence for people.", + "example": "The request has invalid fields.", + "type": "string" + }, + "errors": { + "description": "Errors lists the field problems of a VALIDATION_FAILED problem.", + "items": { + "$ref": "#/components/schemas/validation.Violation" + }, + "type": "array" + }, + "instance": { + "description": "Instance identifies this occurrence: the request id the server\ngenerated, also sent as X-Request-ID and logged as request_id.", + "example": "urn:uuid:3f2c8a8e-6c1d-4a59-9a43-2b1f0f6f9d10", + "format": "uri", + "type": "string" + }, + "reason": { + "allOf": [ + { + "$ref": "#/components/schemas/constants.ErrorReason" + } + ], + "description": "Reason is a finer stable cause within Code, when there is one." + }, + "status": { + "example": 400, + "type": "integer" + }, + "timestamp": { + "type": "string" + }, + "title": { + "example": "Validation failed", + "type": "string" + }, + "type": { + "description": "Type identifies the problem type (one per code); it may be\ndereferenced for documentation.", + "example": "https://docs.norcube.com/errors/validation-failed", + "format": "uri", + "type": "string" + } + }, + "required": [ + "code", + "detail", + "instance", + "status", + "timestamp", + "title", + "type" + ], + "type": "object" + }, + "validation.Params": { + "properties": { + "allowed": { + "description": "Allowed: oneOf.", + "items": { + "type": "string" + }, + "type": "array" + }, + "expected": { + "description": "Expected: type, mismatch.", + "type": "string" + }, + "field": { + "description": "Field is the pointer of the other field: min and max compared with a\nfield, exclusive, dependsOn.", + "example": "/http/requestBody", + "type": "string" + }, + "max": { + "description": "Max: range, max, maxLength, maxItems.", + "example": 30000, + "type": "integer" + }, + "min": { + "description": "Min: range, min.", + "example": 1000, + "type": "integer" + }, + "unit": { + "allOf": [ + { + "$ref": "#/components/schemas/validation.Unit" + } + ], + "description": "Unit: maxLength." + }, + "value": { + "description": "Value: unsupported.", + "type": "string" + } + }, + "type": "object" + }, + "validation.Rule": { + "enum": [ + "required", + "min", + "max", + "range", + "maxLength", + "maxItems", + "oneOf", + "format", + "public", + "unique", + "exclusive", + "dependsOn", + "notAllowed", + "immutable", + "unknown", + "duplicate", + "type", + "reference", + "unverified", + "unsupported", + "mismatch" + ], + "type": "string", + "x-enum-varnames": [ + "RuleRequired", + "RuleMin", + "RuleMax", + "RuleRange", + "RuleMaxLength", + "RuleMaxItems", + "RuleOneOf", + "RuleFormat", + "RulePublic", + "RuleUnique", + "RuleExclusive", + "RuleDependsOn", + "RuleNotAllowed", + "RuleImmutable", + "RuleUnknown", + "RuleDuplicate", + "RuleType", + "RuleReference", + "RuleUnverified", + "RuleUnsupported", + "RuleMismatch" + ] + }, + "validation.Unit": { + "enum": [ + "characters", + "bytes" + ], + "type": "string", + "x-enum-varnames": [ + "UnitCharacters", + "UnitBytes" + ] + }, + "validation.Violation": { + "properties": { + "detail": { + "example": "must be between 1000 and 30000", + "type": "string" + }, + "params": { + "$ref": "#/components/schemas/validation.Params" + }, + "pointer": { + "example": "/http/timeoutMs", + "type": "string" + }, + "rule": { + "allOf": [ + { + "$ref": "#/components/schemas/validation.Rule" + } + ], + "example": "range" + } + }, + "required": [ + "detail", + "pointer", + "rule" + ], + "type": "object" + } + } + }, + "info": { + "contact": { + "email": "jan@jetlio.com", + "name": "Jan Švábík" + }, + "description": "Uptime, SSL certificate and domain expiry monitoring.", + "title": "Norcube Monitor API", + "version": "" + }, + "openapi": "3.0.3", + "paths": { + "/alert-channels": { + "get": { + "description": "The organization's alert channels, newest first. Credentials are never returned.", + "operationId": "listAlertChannels", + "parameters": [ + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "schema": { + "maximum": 100, + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/response.APIResponseWithPagination" + }, + { + "properties": { + "list": { + "items": { + "$ref": "#/components/schemas/dto.AlertChannel" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + } + }, + "summary": "List alert channels", + "tags": [ + "Alert channels" + ], + "x-norcube-scopes": [ + "monitor.read", + "monitor.check", + "monitor.write", + "monitor.channels", + "monitor.statuspages", + "monitor.maintenance" + ] + }, + "post": { + "description": "Creates a channel. A webhook's signing secret (Standard Webhooks, whsec_…) is returned this once; SMS channels get no alerts until their number is verified. Voice-call channels can't be created, nor SMS channels where no SMS provider is configured: 400 with reason CHANNEL_TYPE_UNAVAILABLE.", + "operationId": "createAlertChannel", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.AlertChannelCreate" + } + } + }, + "description": "Channel", + "required": true, + "x-originalParamName": "payload" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.AlertChannelWithSecret" + } + } + }, + "description": "Created" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Invalid fields (VALIDATION_FAILED), reason CHANNEL_TYPE_UNAVAILABLE when the kind isn't offered" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Forbidden, or channel limit reached (LIMIT_REACHED), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + } + }, + "summary": "Create an alert channel", + "tags": [ + "Alert channels" + ], + "x-norcube-scopes": [ + "monitor.channels" + ] + } + }, + "/alert-channels/{id}": { + "delete": { + "description": "Deletes the channel and removes it from every monitor's alert settings. Pending alerts to it are dropped.", + "operationId": "deleteAlertChannel", + "parameters": [ + { + "description": "Channel ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Not Found" + } + }, + "summary": "Delete an alert channel", + "tags": [ + "Alert channels" + ], + "x-norcube-scopes": [ + "monitor.channels" + ] + }, + "get": { + "description": "One alert channel: kind, name, whether it is a default channel, enabled and verified, and its settings without credentials (a Slack or Discord URL as a hint, a webhook's signing secret never).", + "operationId": "getAlertChannel", + "parameters": [ + { + "description": "Channel ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.AlertChannel" + } + } + }, + "description": "OK" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Not Found" + } + }, + "summary": "Get an alert channel", + "tags": [ + "Alert channels" + ], + "x-norcube-scopes": [ + "monitor.read", + "monitor.check", + "monitor.write", + "monitor.channels", + "monitor.statuspages", + "monitor.maintenance" + ] + }, + "patch": { + "description": "Changes the given fields. signingSecret is returned when a webhook's secret was rotated or replaced. A voice channel can be renamed but not enabled or given settings (400, reason CHANNEL_TYPE_UNAVAILABLE).", + "operationId": "updateAlertChannel", + "parameters": [ + { + "description": "Channel ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.AlertChannelUpdate" + } + } + }, + "description": "Changes", + "required": true, + "x-originalParamName": "payload" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.AlertChannelWithSecret" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Not Found" + } + }, + "summary": "Update an alert channel", + "tags": [ + "Alert channels" + ], + "x-norcube-scopes": [ + "monitor.channels" + ] + } + }, + "/alert-channels/{id}/deliveries": { "get": { - "description": "The organization's alert channels, newest first. Credentials are never returned.", - "operationId": "listAlertChannels", + "description": "Every alert given to this channel, newest first (kept 90 days): the event and monitor (and incident), status (pending: queued or waiting to retry; sent; dead: given up), attempts, the next attempt while pending, and the last error with URLs, email addresses, phone numbers and token-like strings removed. status=dead lists the failures nobody saw.", + "operationId": "listAlertChannelDeliveries", "parameters": [ + { + "description": "Alert channel ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + }, { "in": "query", "name": "cursor", @@ -4035,6 +5209,18 @@ "minimum": 1, "type": "integer" } + }, + { + "in": "query", + "name": "status", + "schema": { + "enum": [ + "pending", + "sent", + "dead" + ], + "type": "string" + } } ], "responses": { @@ -4050,7 +5236,7 @@ "properties": { "list": { "items": { - "$ref": "#/components/schemas/dto.AlertChannel" + "$ref": "#/components/schemas/dto.ChannelDelivery" }, "type": "array" } @@ -4061,9 +5247,211 @@ } } }, - "description": "OK" + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Bad Request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Not Found" + } + }, + "summary": "List a channel's deliveries", + "tags": [ + "Alert channels" + ], + "x-norcube-scopes": [ + "monitor.read", + "monitor.check", + "monitor.write", + "monitor.channels", + "monitor.statuspages", + "monitor.maintenance" + ] + } + }, + "/alert-channels/{id}/test": { + "post": { + "description": "Sends a test alert right away and returns the provider's reference. Rate limited; an SMS counts toward the daily SMS limit. Refused while the organization is blocked for unpaid invoices.", + "operationId": "testAlertChannel", + "parameters": [ + { + "description": "Channel ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.AlertChannelTestResult" + } + } + }, + "description": "OK" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "402": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Organization blocked for unpaid invoices" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "The provider refused it, the contact isn't verified, or a voice channel (CHANNEL_TYPE_UNAVAILABLE)" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Too Many Requests" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "The provider didn't answer; retry" + } + }, + "summary": "Send a test alert", + "tags": [ + "Alert channels" + ], + "x-norcube-scopes": [ + "monitor.channels" + ] + } + }, + "/alert-channels/{id}/verify": { + "post": { + "description": "Texts (or, for an email-address channel, emails) a 6-digit code valid for 10 minutes. At most once a minute; an SMS counts toward the daily SMS limit.", + "operationId": "sendAlertChannelVerification", + "parameters": [ + { + "description": "Channel ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "No Content" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" + }, + "402": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "ORG_BLOCKED: unpaid invoices" }, - "400": { + "403": { "content": { "application/json": { "schema": { @@ -4071,9 +5459,9 @@ } } }, - "description": "Bad Request" + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" }, - "401": { + "404": { "content": { "application/json": { "schema": { @@ -4081,9 +5469,9 @@ } } }, - "description": "Missing, invalid or expired token (UNAUTHORIZED)" + "description": "Not Found" }, - "403": { + "409": { "content": { "application/json": { "schema": { @@ -4091,46 +5479,56 @@ } } }, - "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + "description": "Nothing to verify, already verified, a code was just sent, or a voice channel (CHANNEL_TYPE_UNAVAILABLE)" } }, - "summary": "List alert channels", + "summary": "Send a verification code", "tags": [ "Alert channels" ], "x-norcube-scopes": [ - "monitor.read", - "monitor.check", - "monitor.write", - "monitor.channels", - "monitor.statuspages" + "monitor.channels" ] - }, + } + }, + "/alert-channels/{id}/verify/confirm": { "post": { - "description": "Creates a channel. A webhook's signing secret (Standard Webhooks, whsec_…) is returned this once; SMS channels get no alerts until their number is verified. Voice-call channels can't be created, nor SMS channels where no SMS provider is configured: 400 with reason CHANNEL_TYPE_UNAVAILABLE.", - "operationId": "createAlertChannel", + "description": "Verifies the channel's number with the code sent. Five wrong codes (or an expired one) need a new code.", + "operationId": "confirmAlertChannelVerification", + "parameters": [ + { + "description": "Channel ID", + "in": "path", + "name": "id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.AlertChannelCreate" + "$ref": "#/components/schemas/dto.AlertChannelVerifyConfirm" } } }, - "description": "Channel", + "description": "Code", "required": true, "x-originalParamName": "payload" }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.AlertChannelWithSecret" + "$ref": "#/components/schemas/dto.AlertChannel" } } }, - "description": "Created" + "description": "OK" }, "400": { "content": { @@ -4140,7 +5538,7 @@ } } }, - "description": "Invalid fields (VALIDATION_FAILED), reason CHANNEL_TYPE_UNAVAILABLE when the kind isn't offered" + "description": "Wrong code" }, "401": { "content": { @@ -4160,10 +5558,30 @@ } } }, - "description": "Forbidden, or channel limit reached (LIMIT_REACHED), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Expired, or too many attempts" } }, - "summary": "Create an alert channel", + "summary": "Confirm a verification code", "tags": [ "Alert channels" ], @@ -4172,25 +5590,145 @@ ] } }, - "/alert-channels/{id}": { - "delete": { - "description": "Deletes the channel and removes it from every monitor's alert settings. Pending alerts to it are dropped.", - "operationId": "deleteAlertChannel", + "/incidents": { + "get": { + "description": "The organization's incidents: open ones first (critical, then warning), then resolved ones, newest first within each. Filter by status (open, resolved), monitor, severity (an open incident's current severity, a resolved one's peak), aspect, acknowledged, q (part of the monitor's name or target, any case, at most 100 characters) and when it started (from inclusive, to exclusive). Every filter given must match. Rows carry the monitor's name, type, variant and target. An invalid filter is a VALIDATION_FAILED problem with the parameter's pointer (\"/severity\").", + "operationId": "listIncidents", "parameters": [ { - "description": "Channel ID", - "in": "path", - "name": "id", - "required": true, + "description": "Acknowledged: true for incidents someone acknowledged, false for\nthe others.", + "in": "query", + "name": "acknowledged", + "schema": { + "enum": [ + "true", + "false" + ], + "type": "string" + } + }, + { + "description": "Aspect is what the incident is about.", + "in": "query", + "name": "aspect", + "schema": { + "enum": [ + "availability", + "certificate", + "domain" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "cursor", + "schema": { + "type": "string" + } + }, + { + "description": "From and To bound when the incident started: from inclusive, to\nexclusive (RFC 3339).", + "in": "query", + "name": "from", + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "schema": { + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + { + "in": "query", + "name": "monitorId", "schema": { "format": "uuid", "type": "string" } + }, + { + "description": "Q is part of the monitor's name or target, any case.", + "in": "query", + "name": "q", + "schema": { + "maxLength": 100, + "type": "string" + } + }, + { + "description": "Severity matches an open incident's current severity and a resolved\none's peak severity (how bad it got).", + "in": "query", + "name": "severity", + "schema": { + "enum": [ + "warning", + "critical" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "schema": { + "enum": [ + "open", + "resolved" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "to", + "schema": { + "format": "date-time", + "type": "string" + } } ], "responses": { - "204": { - "description": "No Content" + "200": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/response.APIResponseWithPagination" + }, + { + "properties": { + "list": { + "items": { + "$ref": "#/components/schemas/dto.Incident" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Bad Request" }, "401": { "content": { @@ -4210,9 +5748,49 @@ } } }, - "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + } + }, + "summary": "List incidents", + "tags": [ + "Incidents" + ], + "x-norcube-scopes": [ + "monitor.read", + "monitor.check", + "monitor.write", + "monitor.channels", + "monitor.statuspages", + "monitor.maintenance" + ] + } + }, + "/incidents/summary": { + "get": { + "description": "The organization's incidents at a glance, for a page header: open incidents by current severity and those nobody acknowledged, incidents resolved in the last 7 days, and the mean time to resolve (opened to resolved) of incidents resolved in the last 30 days. Takes no filters: it describes the organization, not a list view.", + "operationId": "getIncidentSummary", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.IncidentSummary" + } + } + }, + "description": "OK" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Missing, invalid or expired token (UNAUTHORIZED)" }, - "404": { + "403": { "content": { "application/json": { "schema": { @@ -4220,23 +5798,30 @@ } } }, - "description": "Not Found" + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" } }, - "summary": "Delete an alert channel", + "summary": "Summarize incidents", "tags": [ - "Alert channels" + "Incidents" ], "x-norcube-scopes": [ - "monitor.channels" + "monitor.read", + "monitor.check", + "monitor.write", + "monitor.channels", + "monitor.statuspages", + "monitor.maintenance" ] - }, + } + }, + "/incidents/{id}": { "get": { - "description": "One alert channel: kind, name, whether it is a default channel, enabled and verified, and its settings without credentials (a Slack or Discord URL as a hint, a webhook's signing secret never).", - "operationId": "getAlertChannel", + "description": "An incident with its timeline and every alert sent for it (with delivery status, so a failing channel shows here).", + "operationId": "getIncident", "parameters": [ { - "description": "Channel ID", + "description": "Incident ID", "in": "path", "name": "id", "required": true, @@ -4251,7 +5836,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.AlertChannel" + "$ref": "#/components/schemas/dto.IncidentDetail" } } }, @@ -4288,24 +5873,27 @@ "description": "Not Found" } }, - "summary": "Get an alert channel", + "summary": "Get an incident", "tags": [ - "Alert channels" + "Incidents" ], "x-norcube-scopes": [ "monitor.read", "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] - }, - "patch": { - "description": "Changes the given fields. signingSecret is returned when a webhook's secret was rotated or replaced. A voice channel can be renamed but not enabled or given settings (400, reason CHANNEL_TYPE_UNAVAILABLE).", - "operationId": "updateAlertChannel", + } + }, + "/incidents/{id}/acknowledge": { + "post": { + "description": "Marks an open incident as being handled: its reminders stop. Idempotent; a resolved incident is returned unchanged.", + "operationId": "acknowledgeIncident", "parameters": [ { - "description": "Channel ID", + "description": "Incident ID", "in": "path", "name": "id", "required": true, @@ -4315,39 +5903,17 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/dto.AlertChannelUpdate" - } - } - }, - "description": "Changes", - "required": true, - "x-originalParamName": "payload" - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.AlertChannelWithSecret" + "$ref": "#/components/schemas/dto.IncidentDetail" } } }, "description": "OK" }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/response.Problem" - } - } - }, - "description": "Bad Request" - }, "401": { "content": { "application/json": { @@ -4379,30 +5945,20 @@ "description": "Not Found" } }, - "summary": "Update an alert channel", + "summary": "Acknowledge an incident", "tags": [ - "Alert channels" + "Incidents" ], "x-norcube-scopes": [ - "monitor.channels" + "monitor.write" ] } }, - "/alert-channels/{id}/deliveries": { + "/maintenance-windows": { "get": { - "description": "Every alert given to this channel, newest first (kept 90 days): the event and monitor (and incident), status (pending: queued or waiting to retry; sent; dead: given up), attempts, the next attempt while pending, and the last error with URLs, email addresses, phone numbers and token-like strings removed. status=dead lists the failures nobody saw.", - "operationId": "listAlertChannelDeliveries", + "description": "The organization's windows, latest start first; with `status=scheduled`, soonest first. `state` follows from the times. `statusPageId` keeps the windows showing on a page, `monitorId` those holding a monitor.", + "operationId": "listMaintenanceWindows", "parameters": [ - { - "description": "Alert channel ID", - "in": "path", - "name": "id", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - } - }, { "in": "query", "name": "cursor", @@ -4420,16 +5976,36 @@ } }, { + "description": "MonitorID keeps the windows holding that monitor.", + "in": "query", + "name": "monitorId", + "schema": { + "format": "uuid", + "type": "string" + } + }, + { + "description": "Status keeps the windows standing there; scheduled ones come soonest first, the\nothers latest start first.", "in": "query", "name": "status", "schema": { "enum": [ - "pending", - "sent", - "dead" + "scheduled", + "in_progress", + "completed", + "cancelled" ], "type": "string" } + }, + { + "description": "StatusPageID keeps the windows showing on that page.", + "in": "query", + "name": "statusPageId", + "schema": { + "format": "uuid", + "type": "string" + } } ], "responses": { @@ -4445,7 +6021,7 @@ "properties": { "list": { "items": { - "$ref": "#/components/schemas/dto.ChannelDelivery" + "$ref": "#/components/schemas/dto.MaintenanceWindow" }, "type": "array" } @@ -4487,57 +6063,56 @@ } }, "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" - }, - "404": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/response.Problem" - } - } - }, - "description": "Not Found" } }, - "summary": "List a channel's deliveries", + "summary": "List maintenance windows", "tags": [ - "Alert channels" + "Maintenance windows" ], "x-norcube-scopes": [ "monitor.read", "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] - } - }, - "/alert-channels/{id}/test": { + }, "post": { - "description": "Sends a test alert right away and returns the provider's reference. Rate limited; an SMS counts toward the daily SMS limit. Refused while the organization is blocked for unpaid invoices.", - "operationId": "testAlertChannel", - "parameters": [ - { - "description": "Channel ID", - "in": "path", - "name": "id", - "required": true, - "schema": { - "format": "uuid", - "type": "string" + "description": "Schedules a window, or starts one now. It pauses alerts for its monitors and leaves the time out of their uptime; checks keep running and are metered. It shows on every published status page displaying a target, by itself: there is no opt-out per page. Needs UpdateMonitor on each monitor (403 FORBIDDEN, `data.monitorIds`). Where it shows on a published page it needs PublishMaintenanceWindow there, and a scoped token also the monitor.statuspages scope (403 MAINTENANCE_PUBLISH_DENIED, naming the page, `data.statusPageIds`). A domain monitor is refused with 422 UNPROCESSABLE: a domain's registration isn't affected by maintenance; other invalid fields answer 400 VALIDATION_FAILED. At most 100 windows scheduled or in progress, 500 targets each, 30 days long, starting within a year (403 LIMIT_REACHED, reason MAINTENANCE_WINDOW_LIMIT).", + "operationId": "createMaintenanceWindow", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.MaintenanceWindowCreate" + } } - } - ], + }, + "description": "The window", + "required": true, + "x-originalParamName": "body" + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.AlertChannelTestResult" + "$ref": "#/components/schemas/dto.MaintenanceWindow" } } }, - "description": "OK" + "description": "Created" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Bad Request" }, "401": { "content": { @@ -4549,7 +6124,7 @@ }, "description": "Missing, invalid or expired token (UNAUTHORIZED)" }, - "402": { + "403": { "content": { "application/json": { "schema": { @@ -4557,9 +6132,9 @@ } } }, - "description": "Organization blocked for unpaid invoices" + "description": "No permission (FORBIDDEN), the token's scopes don't allow this (reason INSUFFICIENT_SCOPE), it would show on a page you can't publish on (reason MAINTENANCE_PUBLISH_DENIED), or a safety cap (LIMIT_REACHED)" }, - "403": { + "422": { "content": { "application/json": { "schema": { @@ -4567,9 +6142,9 @@ } } }, - "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + "description": "Unprocessable Entity" }, - "404": { + "503": { "content": { "application/json": { "schema": { @@ -4577,9 +6152,34 @@ } } }, - "description": "Not Found" + "description": "Permissions couldn't be checked (UNAVAILABLE)" + } + }, + "summary": "Schedule a maintenance window", + "tags": [ + "Maintenance windows" + ], + "x-norcube-scopes": [ + "monitor.maintenance" + ] + } + }, + "/maintenance-windows/targets": { + "get": { + "description": "Everything a window in the organization could target, in one request: monitors (domain monitors can't be held), manual components, and status pages with whether each is published, which monitors make a window show there, whether you may show it there (`canPublish`) and, where you can read the page, its confirmed subscribers. Enough to say what a window will do before it is saved.", + "operationId": "getMaintenanceTargets", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.MaintenanceTargets" + } + } + }, + "description": "OK" }, - "409": { + "401": { "content": { "application/json": { "schema": { @@ -4587,9 +6187,9 @@ } } }, - "description": "The provider refused it, the contact isn't verified, or a voice channel (CHANNEL_TYPE_UNAVAILABLE)" + "description": "Missing, invalid or expired token (UNAUTHORIZED)" }, - "429": { + "403": { "content": { "application/json": { "schema": { @@ -4597,7 +6197,7 @@ } } }, - "description": "Too Many Requests" + "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" }, "503": { "content": { @@ -4607,25 +6207,30 @@ } } }, - "description": "The provider didn't answer; retry" + "description": "Permissions couldn't be checked (UNAVAILABLE)" } }, - "summary": "Send a test alert", + "summary": "What a maintenance window can target", "tags": [ - "Alert channels" + "Maintenance windows" ], "x-norcube-scopes": [ - "monitor.channels" + "monitor.read", + "monitor.check", + "monitor.write", + "monitor.channels", + "monitor.statuspages", + "monitor.maintenance" ] } }, - "/alert-channels/{id}/verify": { - "post": { - "description": "Texts (or, for an email-address channel, emails) a 6-digit code valid for 10 minutes. At most once a minute; an SMS counts toward the daily SMS limit.", - "operationId": "sendAlertChannelVerification", + "/maintenance-windows/{id}": { + "delete": { + "description": "Only a cancelled window, once its cancellation has been announced (409, reason MAINTENANCE_WINDOW_STATE; within a minute of cancelling). A completed one explains a gap in uptime, and goes by itself two years after it ended.", + "operationId": "deleteMaintenanceWindow", "parameters": [ { - "description": "Channel ID", + "description": "Window ID", "in": "path", "name": "id", "required": true, @@ -4649,16 +6254,6 @@ }, "description": "Missing, invalid or expired token (UNAUTHORIZED)" }, - "402": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/response.Problem" - } - } - }, - "description": "ORG_BLOCKED: unpaid invoices" - }, "403": { "content": { "application/json": { @@ -4687,25 +6282,23 @@ } } }, - "description": "Nothing to verify, already verified, a code was just sent, or a voice channel (CHANNEL_TYPE_UNAVAILABLE)" + "description": "Conflict" } }, - "summary": "Send a verification code", + "summary": "Delete a cancelled maintenance window", "tags": [ - "Alert channels" + "Maintenance windows" ], "x-norcube-scopes": [ - "monitor.channels" + "monitor.maintenance" ] - } - }, - "/alert-channels/{id}/verify/confirm": { - "post": { - "description": "Verifies the channel's number with the code sent. Five wrong codes (or an expired one) need a new code.", - "operationId": "confirmAlertChannelVerification", + }, + "get": { + "description": "One window with where it stands, its targets and the pages it shows on.", + "operationId": "getMaintenanceWindow", "parameters": [ { - "description": "Channel ID", + "description": "Window ID", "in": "path", "name": "id", "required": true, @@ -4715,39 +6308,17 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/dto.AlertChannelVerifyConfirm" - } - } - }, - "description": "Code", - "required": true, - "x-originalParamName": "payload" - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.AlertChannel" + "$ref": "#/components/schemas/dto.MaintenanceWindow" } } }, "description": "OK" }, - "400": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/response.Problem" - } - } - }, - "description": "Wrong code" - }, "401": { "content": { "application/json": { @@ -4777,152 +6348,54 @@ } }, "description": "Not Found" - }, - "409": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/response.Problem" - } - } - }, - "description": "Expired, or too many attempts" } }, - "summary": "Confirm a verification code", + "summary": "Get a maintenance window", "tags": [ - "Alert channels" + "Maintenance windows" ], "x-norcube-scopes": [ - "monitor.channels" + "monitor.read", + "monitor.check", + "monitor.write", + "monitor.channels", + "monitor.statuspages", + "monitor.maintenance" ] - } - }, - "/incidents": { - "get": { - "description": "The organization's incidents: open ones first (critical, then warning), then resolved ones, newest first within each. Filter by status (open, resolved), monitor, severity (an open incident's current severity, a resolved one's peak), aspect, acknowledged, q (part of the monitor's name or target, any case, at most 100 characters) and when it started (from inclusive, to exclusive). Every filter given must match. Rows carry the monitor's name, type, variant and target. An invalid filter is a VALIDATION_FAILED problem with the parameter's pointer (\"/severity\").", - "operationId": "listIncidents", + }, + "patch": { + "description": "Changes the given fields, as far as where the window stands allows (409, reason MAINTENANCE_WINDOW_STATE, `data.state`). Before it starts everything can change; moving a time by 5 minutes or more tells subscribers who were told. Once started: text, mail switches and the end, silently, with targets frozen. Once over: text only. A cancelled window: nothing. A change to the times or targets needs UpdateMonitor on each monitor; any change to a window showing on a published page, before or after, needs the publish permission as on create.", + "operationId": "updateMaintenanceWindow", "parameters": [ { - "description": "Acknowledged: true for incidents someone acknowledged, false for\nthe others.", - "in": "query", - "name": "acknowledged", - "schema": { - "enum": [ - "true", - "false" - ], - "type": "string" - } - }, - { - "description": "Aspect is what the incident is about.", - "in": "query", - "name": "aspect", - "schema": { - "enum": [ - "availability", - "certificate", - "domain" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "cursor", - "schema": { - "type": "string" - } - }, - { - "description": "From and To bound when the incident started: from inclusive, to\nexclusive (RFC 3339).", - "in": "query", - "name": "from", - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "in": "query", - "name": "limit", - "schema": { - "maximum": 100, - "minimum": 1, - "type": "integer" - } - }, - { - "in": "query", - "name": "monitorId", + "description": "Window ID", + "in": "path", + "name": "id", + "required": true, "schema": { "format": "uuid", "type": "string" } - }, - { - "description": "Q is part of the monitor's name or target, any case.", - "in": "query", - "name": "q", - "schema": { - "maxLength": 100, - "type": "string" - } - }, - { - "description": "Severity matches an open incident's current severity and a resolved\none's peak severity (how bad it got).", - "in": "query", - "name": "severity", - "schema": { - "enum": [ - "warning", - "critical" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "status", - "schema": { - "enum": [ - "open", - "resolved" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "to", - "schema": { - "format": "date-time", - "type": "string" - } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dto.MaintenanceWindowUpdate" + } + } + }, + "description": "Changes", + "required": true, + "x-originalParamName": "body" + }, "responses": { "200": { "content": { "application/json": { "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/response.APIResponseWithPagination" - }, - { - "properties": { - "list": { - "items": { - "$ref": "#/components/schemas/dto.Incident" - }, - "type": "array" - } - }, - "type": "object" - } - ] + "$ref": "#/components/schemas/dto.MaintenanceWindow" } } }, @@ -4956,38 +6429,19 @@ } } }, - "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" - } - }, - "summary": "List incidents", - "tags": [ - "Incidents" - ], - "x-norcube-scopes": [ - "monitor.read", - "monitor.check", - "monitor.write", - "monitor.channels", - "monitor.statuspages" - ] - } - }, - "/incidents/summary": { - "get": { - "description": "The organization's incidents at a glance, for a page header: open incidents by current severity and those nobody acknowledged, incidents resolved in the last 7 days, and the mean time to resolve (opened to resolved) of incidents resolved in the last 30 days. Takes no filters: it describes the organization, not a list view.", - "operationId": "getIncidentSummary", - "responses": { - "200": { + "description": "No permission (FORBIDDEN), the token's scopes don't allow this (reason INSUFFICIENT_SCOPE), it shows on a page you can't publish on (reason MAINTENANCE_PUBLISH_DENIED), or a safety cap (LIMIT_REACHED)" + }, + "404": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.IncidentSummary" + "$ref": "#/components/schemas/response.Problem" } } }, - "description": "OK" + "description": "Not Found" }, - "401": { + "409": { "content": { "application/json": { "schema": { @@ -4995,9 +6449,9 @@ } } }, - "description": "Missing, invalid or expired token (UNAUTHORIZED)" + "description": "Conflict" }, - "403": { + "422": { "content": { "application/json": { "schema": { @@ -5005,29 +6459,35 @@ } } }, - "description": "No permission for this (FORBIDDEN), or the token's scopes don't allow this (reason INSUFFICIENT_SCOPE)" + "description": "Unprocessable Entity" + }, + "503": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Permissions couldn't be checked (UNAVAILABLE)" } }, - "summary": "Summarize incidents", + "summary": "Change a maintenance window", "tags": [ - "Incidents" + "Maintenance windows" ], "x-norcube-scopes": [ - "monitor.read", - "monitor.check", - "monitor.write", - "monitor.channels", - "monitor.statuspages" + "monitor.maintenance" ] } }, - "/incidents/{id}": { - "get": { - "description": "An incident with its timeline and every alert sent for it (with delivery status, so a failing channel shows here).", - "operationId": "getIncident", + "/maintenance-windows/{id}/cancel": { + "post": { + "description": "Calls off a window that hasn't started; subscribers who were told hear of it. One that has started gets 409 with reason MAINTENANCE_WINDOW_STATE: use finish. Needs only permission to update the window, not to publish.", + "operationId": "cancelMaintenanceWindow", "parameters": [ { - "description": "Incident ID", + "description": "Window ID", "in": "path", "name": "id", "required": true, @@ -5042,7 +6502,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.IncidentDetail" + "$ref": "#/components/schemas/dto.MaintenanceWindow" } } }, @@ -5077,28 +6537,34 @@ } }, "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Conflict" } }, - "summary": "Get an incident", + "summary": "Cancel a scheduled maintenance window", "tags": [ - "Incidents" + "Maintenance windows" ], "x-norcube-scopes": [ - "monitor.read", - "monitor.check", - "monitor.write", - "monitor.channels", - "monitor.statuspages" + "monitor.maintenance" ] } }, - "/incidents/{id}/acknowledge": { + "/maintenance-windows/{id}/finish": { "post": { - "description": "Marks an open incident as being handled: its reminders stop. Idempotent; a resolved incident is returned unchanged.", - "operationId": "acknowledgeIncident", + "description": "Ends a window in progress now: the very next check counts and alerts as usual, and subscribers hear it finished early. Monitors with an open incident it held are checked again within a minute. Needs only permission to update the window, so whoever can edit it can always end its silence. One that isn't in progress gets 409 with reason MAINTENANCE_WINDOW_STATE.", + "operationId": "finishMaintenanceWindow", "parameters": [ { - "description": "Incident ID", + "description": "Window ID", "in": "path", "name": "id", "required": true, @@ -5113,7 +6579,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/dto.IncidentDetail" + "$ref": "#/components/schemas/dto.MaintenanceWindow" } } }, @@ -5148,20 +6614,30 @@ } }, "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/response.Problem" + } + } + }, + "description": "Conflict" } }, - "summary": "Acknowledge an incident", + "summary": "Finish a maintenance window early", "tags": [ - "Incidents" + "Maintenance windows" ], "x-norcube-scopes": [ - "monitor.write" + "monitor.maintenance" ] } }, "/monitors": { "get": { - "description": "The organization's monitors with their current status, by default ordered by status severity (critical, warning, pending, ok, paused) then name; `sort` picks another order, and a cursor only continues the sort it came from. `status` is the severity of the last conclusive check (an inconclusive one, such as a failed registry lookup, never moves it) and `condition` its reason with facts (days left for SSL and domain monitors). Rows of HTTP monitors have `last24h` (checks by severity, uptime and warning share, approximate p50/p95 over the last 24 full hours plus the current one; no data is absent, not 100%). `include=history` adds each row's newest 60 results (`history`, newest first) for a heartbeat strip. Rows carry no settings; `variant` names what each monitor does (`keyword` for an HTTP monitor that looks for a keyword).", + "description": "The organization's monitors with their current status, by default ordered by status severity (critical, warning, pending, ok, paused) then name; `sort` picks another order, and a cursor only continues the sort it came from. `status` is the severity of the last conclusive check (an inconclusive one, such as a failed registry lookup, never moves it) and `condition` its reason with facts (days left for SSL and domain monitors). Rows of HTTP monitors have `last24h` (checks by severity, uptime and warning share, approximate p50/p95 over the last 24 full hours plus the current one; no data is absent, not 100%). `include=history` adds each row's newest 60 results (`history`, newest first) for a heartbeat strip. Rows carry no settings; `variant` names what each monitor does (`keyword` for an HTTP monitor that looks for a keyword). `maintenance` names the window holding a monitor right now, and such a monitor sorts with the healthy ones, whatever `status` says: status stays what was measured, and the `status` filter reads it as it is.", "operationId": "listMonitors", "parameters": [ { @@ -5307,7 +6783,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "post": { @@ -5618,7 +7095,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "patch": { @@ -5786,7 +7264,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "put": { @@ -5964,7 +7443,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] } }, @@ -6035,7 +7515,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] } }, @@ -6318,7 +7799,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] } }, @@ -6480,7 +7962,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] } }, @@ -6592,7 +8075,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] } }, @@ -6693,7 +8177,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "post": { @@ -6907,7 +8392,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "patch": { @@ -7133,7 +8619,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "put": { @@ -7374,7 +8861,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "post": { @@ -7542,7 +9030,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "patch": { @@ -7819,7 +9308,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "put": { @@ -8035,7 +9525,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] }, "put": { @@ -8193,7 +9684,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] } }, @@ -8516,7 +10008,8 @@ "monitor.check", "monitor.write", "monitor.channels", - "monitor.statuspages" + "monitor.statuspages", + "monitor.maintenance" ] } }, From 45733a2bb7a78e3dba29585adc85ce91e0b23d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0v=C3=A1b=C3=ADk?= Date: Fri, 6 Nov 2026 14:36:49 +0100 Subject: [PATCH 2/7] feat(output): add -o id to print only a result's id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lets a script capture what it creates with id=$(... -o id), which -o text can't do without cut once a result has more than one column. Signed-off-by: Jan Švábík --- internal/cli/commands.go | 2 +- internal/cli/commands_test.go | 4 +- internal/cli/root.go | 4 +- .../cli/testdata/golden/commands-billing.json | 32 ++++++---- .../cli/testdata/golden/commands-billing.yaml | 12 +++- internal/clictx/clictx.go | 4 +- internal/cmdutil/cmdutil.go | 7 ++- internal/output/id.go | 61 +++++++++++++++++++ internal/output/id_test.go | 35 +++++++++++ internal/output/output.go | 7 ++- internal/output/text.go | 2 +- internal/resolve/resolve.go | 4 +- 12 files changed, 149 insertions(+), 25 deletions(-) create mode 100644 internal/output/id.go create mode 100644 internal/output/id_test.go diff --git a/internal/cli/commands.go b/internal/cli/commands.go index 53e2811..ad4cc2f 100644 --- a/internal/cli/commands.go +++ b/internal/cli/commands.go @@ -100,7 +100,7 @@ type flagInfo struct { Deprecated string `json:"deprecated,omitempty"` } -var allOutputFormats = []string{output.FormatTable, output.FormatJSON, output.FormatYAML, output.FormatText} +var allOutputFormats = []string{output.FormatTable, output.FormatJSON, output.FormatYAML, output.FormatText, output.FormatID} func newCommandsCmd() *cobra.Command { var all bool diff --git a/internal/cli/commands_test.go b/internal/cli/commands_test.go index e433f94..96c90a6 100644 --- a/internal/cli/commands_test.go +++ b/internal/cli/commands_test.go @@ -80,7 +80,7 @@ func TestCommandsSchemaVersion(t *testing.T) { if tree.SchemaVersion != 1 { t.Errorf("schemaVersion %d, want 1", tree.SchemaVersion) } - if tree.CLIVersion == "" || len(tree.GlobalFlags) == 0 || len(tree.OutputFormats) != 4 { + if tree.CLIVersion == "" || len(tree.GlobalFlags) == 0 || len(tree.OutputFormats) != 5 { t.Errorf("header incomplete: version %q, %d global flags, formats %v", tree.CLIVersion, len(tree.GlobalFlags), tree.OutputFormats) } } @@ -237,7 +237,7 @@ func TestCommandsBehaviourFields(t *testing.T) { if c := byPath["norcube config edit"]; c.OutputFormats != nil { t.Errorf("config edit prints no result, but lists formats %v", c.OutputFormats) } - if c := byPath["norcube backup jobs list"]; len(c.OutputFormats) != 4 { + if c := byPath["norcube backup jobs list"]; len(c.OutputFormats) != 5 { t.Errorf("backup jobs list formats %v", c.OutputFormats) } if c := byPath["norcube backup jobs list"]; slices.ContainsFunc(c.Flags, func(f flagInfo) bool { return f.Name == "output" || f.Name == "help" }) { diff --git a/internal/cli/root.go b/internal/cli/root.go index 35da502..85699cf 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -74,8 +74,8 @@ func NewRootCmd() *cobra.Command { cmd.PersistentFlags().StringVar(&flags.Profile, "profile", "", "Use a named profile from the config file (env: NORCUBE_PROFILE)") cmd.PersistentFlags().StringVar(&flags.OrgOverride, "org", "", "Run this command against a specific organization, id or slug (env: NORCUBE_ORG)") - cmd.PersistentFlags().StringVarP(&flags.Output, "output", "o", "table", "Output format: table | json | yaml | text (env: NORCUBE_OUTPUT)") - cmdutil.FlagEnum(cmd, "output", output.FormatTable, output.FormatJSON, output.FormatYAML, output.FormatText) + cmd.PersistentFlags().StringVarP(&flags.Output, "output", "o", "table", "Output format: table | json | yaml | text | id (env: NORCUBE_OUTPUT)") + cmdutil.FlagEnum(cmd, "output", output.FormatTable, output.FormatJSON, output.FormatYAML, output.FormatText, output.FormatID) cmd.PersistentFlags().StringVar(&flags.Query, "query", "", "JMESPath expression applied to the result before it is printed, e.g. \"[?status=='failed'].jobId\"") cmd.PersistentFlags().StringArrayVar(&flags.EndpointURLs, "endpoint-url", nil, "Override a service endpoint, service=url (repeatable; services: "+strings.Join(registry.Keys(), ", ")+")") cmd.PersistentFlags().StringVar(&flags.TokenFile, "token-file", "", "Read an access token from this file instead of the profile's credentials (env: NORCUBE_TOKEN holds one directly)") diff --git a/internal/cli/testdata/golden/commands-billing.json b/internal/cli/testdata/golden/commands-billing.json index 8ddc10d..a5729d0 100644 --- a/internal/cli/testdata/golden/commands-billing.json +++ b/internal/cli/testdata/golden/commands-billing.json @@ -5,7 +5,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "globalFlags": [ { @@ -82,14 +83,15 @@ "shorthand": "o", "type": "string", "default": "table", - "description": "Output format: table | json | yaml | text (env: NORCUBE_OUTPUT)", + "description": "Output format: table | json | yaml | text | id (env: NORCUBE_OUTPUT)", "required": false, "repeatable": false, "enum": [ "table", "json", "yaml", - "text" + "text", + "id" ] }, { @@ -188,7 +190,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -218,7 +221,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -302,7 +306,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -340,7 +345,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -369,7 +375,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -422,7 +429,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -472,7 +480,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -502,7 +511,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] } diff --git a/internal/cli/testdata/golden/commands-billing.yaml b/internal/cli/testdata/golden/commands-billing.yaml index 5d8f350..45ef9d4 100644 --- a/internal/cli/testdata/golden/commands-billing.yaml +++ b/internal/cli/testdata/golden/commands-billing.yaml @@ -60,6 +60,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -117,6 +118,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -171,6 +173,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -200,6 +203,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -231,6 +235,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -278,6 +283,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -324,6 +330,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -354,6 +361,7 @@ commands: - json - yaml - text + - id paginated: false path: - billing @@ -419,12 +427,13 @@ globalFlags: required: false type: string - default: table - description: 'Output format: table | json | yaml | text (env: NORCUBE_OUTPUT)' + description: 'Output format: table | json | yaml | text | id (env: NORCUBE_OUTPUT)' enum: - table - json - yaml - text + - id name: output repeatable: false required: false @@ -455,4 +464,5 @@ outputFormats: - json - yaml - text + - id schemaVersion: 1 diff --git a/internal/clictx/clictx.go b/internal/clictx/clictx.go index 90d484d..0adfcb8 100644 --- a/internal/clictx/clictx.go +++ b/internal/clictx/clictx.go @@ -124,10 +124,10 @@ func (g *Flags) ApplyPreferences() error { func validOutput(v string) error { switch v { - case "table", "json", "yaml", "text": + case "table", "json", "yaml", "text", "id": return nil } - return clierr.Usage(fmt.Errorf("output format %q: want table, json, yaml or text", v)) + return clierr.Usage(fmt.Errorf("output format %q: want table, json, yaml, text or id", v)) } // Resolve loads the config file (migrating an old one) and resolves the diff --git a/internal/cmdutil/cmdutil.go b/internal/cmdutil/cmdutil.go index 9ead48c..78dad96 100644 --- a/internal/cmdutil/cmdutil.go +++ b/internal/cmdutil/cmdutil.go @@ -5,6 +5,7 @@ package cmdutil import ( + "errors" "io" "github.com/spf13/cobra" @@ -63,7 +64,11 @@ func Print(cmd *cobra.Command, value any) error { } value = g } - return output.PrintPaged(cmd.OutOrStdout(), format, noPager, value) + err := output.PrintPaged(cmd.OutOrStdout(), format, noPager, value) + if errors.Is(err, output.ErrNoID) { + return clierr.Usage(err) + } + return err } // Format is the output format of the running command. diff --git a/internal/output/id.go b/internal/output/id.go new file mode 100644 index 0000000..1e4996f --- /dev/null +++ b/internal/output/id.go @@ -0,0 +1,61 @@ +package output + +import ( + "errors" + "fmt" + "io" +) + +// FormatID prints only the result's id, one per line for a list, so a script +// can capture what it just created: id=$(... -o id). A result with nothing in +// it prints nothing. +const FormatID = "id" + +// ErrNoID says the result has no id to print. +var ErrNoID = errors.New("this result has no id: use -o json or -o text") + +func printID(w io.Writer, value any) error { + g, err := toGeneric(payload(value)) + if err != nil { + return err + } + ids, err := idsOf(g) + if err != nil { + return err + } + for _, id := range ids { + if _, err := fmt.Fprintln(w, id); err != nil { + return err + } + } + return nil +} + +// idsOf reads the ids of a value of JSON shape. A plain value is taken as an +// id, which is what --query leaves behind. +func idsOf(v any) ([]string, error) { + switch x := v.(type) { + case nil: + return nil, nil + case map[string]any: + id, ok := scalar(x["id"]) + if !ok || id == "" { + return nil, ErrNoID + } + return []string{id}, nil + case []any: + var out []string + for _, item := range x { + ids, err := idsOf(item) + if err != nil { + return nil, err + } + out = append(out, ids...) + } + return out, nil + } + if s, ok := scalar(v); ok { + return []string{s}, nil + } + return nil, ErrNoID +} diff --git a/internal/output/id_test.go b/internal/output/id_test.go new file mode 100644 index 0000000..322272f --- /dev/null +++ b/internal/output/id_test.go @@ -0,0 +1,35 @@ +package output + +import ( + "bytes" + "errors" + "testing" +) + +func TestPrintID(t *testing.T) { + type row struct { + ID string `json:"id"` + } + for _, tt := range []struct { + name string + v any + want string + }{ + {"object", Object{Value: row{"a"}}, "a\n"}, + {"done", Done{Message: "Made it.", Value: row{"a"}}, "a\n"}, + {"list", Table[row]{Items: []row{{"a"}, {"b"}}}, "a\nb\n"}, + {"empty list", Table[row]{Items: []row{}}, ""}, + {"nothing", Done{Message: "Done."}, ""}, + {"after --query", Generic{V: "a"}, "a\n"}, + {"a number", Generic{V: map[string]any{"id": float64(9002)}}, "9002\n"}, + } { + var b bytes.Buffer + if err := Print(&b, FormatID, tt.v); err != nil || b.String() != tt.want { + t.Errorf("%s: %q, %v; want %q", tt.name, b.String(), err, tt.want) + } + } + var b bytes.Buffer + if err := Print(&b, FormatID, Object{Value: map[string]any{"name": "x"}}); !errors.Is(err, ErrNoID) { + t.Errorf("no id: %v", err) + } +} diff --git a/internal/output/output.go b/internal/output/output.go index e35162c..0adf7d7 100644 --- a/internal/output/output.go +++ b/internal/output/output.go @@ -1,5 +1,6 @@ -// Package output renders command results in one of four user-selected -// formats: a human-friendly table, JSON, YAML, or tab-separated text. +// Package output renders command results in one of the user-selected +// formats: a human-friendly table, JSON, YAML, tab-separated text, or just +// the result's id. // // Every service command should hand its result to Print so the global // --output flag works uniformly. Table rendering is opt-in per command: @@ -65,6 +66,8 @@ func Print(w io.Writer, format string, value any) error { return printTable(w, value) case FormatText: return printText(w, value) + case FormatID: + return printID(w, value) default: return errUnknownFormat(format) } diff --git a/internal/output/text.go b/internal/output/text.go index 3b868a0..b08c0d9 100644 --- a/internal/output/text.go +++ b/internal/output/text.go @@ -322,7 +322,7 @@ func wholeNumbers(v any) any { // errUnknownFormat is the error for a format Print doesn't know. func errUnknownFormat(format string) error { - return fmt.Errorf("unknown output format %q (want table | json | yaml | text)", format) + return fmt.Errorf("unknown output format %q (want table | json | yaml | text | id)", format) } // Done is the result of an action. A table shows Message, the sentence a diff --git a/internal/resolve/resolve.go b/internal/resolve/resolve.go index 406e75b..14dccd0 100644 --- a/internal/resolve/resolve.go +++ b/internal/resolve/resolve.go @@ -206,9 +206,9 @@ func Resolve(in Input) (*Result, error) { r.Output = Value{"table", "default"} } switch r.Output.Value { - case "table", "json", "yaml", "text": + case "table", "json", "yaml", "text", "id": default: - return nil, clierr.Usage(fmt.Errorf("output format %q (from %s): want table, json, yaml or text", r.Output.Value, r.Output.Source)) + return nil, clierr.Usage(fmt.Errorf("output format %q (from %s): want table, json, yaml, text or id", r.Output.Value, r.Output.Source)) } return r, nil } From 4ec005b054144656c7424584b93019a06e35c768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0v=C3=A1b=C3=ADk?= Date: Fri, 6 Nov 2026 14:36:49 +0100 Subject: [PATCH 3/7] feat(cmdutil): add ParseFutureTimeArg and ParseDurationArg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Times ahead are an RFC 3339 timestamp, now or +2h. A bare 2h is refused with a hint, because ParseTimeArg reads that spelling as two hours ago. Signed-off-by: Jan Švábík --- internal/cmdutil/timearg.go | 53 ++++++++++++++++++++++++++++++++ internal/cmdutil/timearg_test.go | 50 ++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/internal/cmdutil/timearg.go b/internal/cmdutil/timearg.go index 3f2caf7..a1a1f55 100644 --- a/internal/cmdutil/timearg.go +++ b/internal/cmdutil/timearg.go @@ -30,3 +30,56 @@ func ParseTimeArg(flag, v string, now time.Time) (time.Time, error) { } return time.Time{}, clierr.Usage(fmt.Errorf("--%s: %q is not a time; use an RFC 3339 timestamp (2026-10-28T09:00:00Z), a date (2026-10-28) or an age (24h, 7d)", flag, v)) } + +// ParseFutureTimeArg reads a point in time from a flag that schedules +// something: an RFC 3339 timestamp, "now", or a span from now ("+2h", "+30m", +// "+7d"). The result is UTC. It leaves judging a timestamp to the API, which +// knows how far back or ahead the thing may be. +// +// A bare "2h" is refused: ParseTimeArg reads that as two hours ago, so taking +// it to mean two hours ahead here would make one spelling mean both. +func ParseFutureTimeArg(flag, v string, now time.Time) (time.Time, error) { + v = strings.TrimSpace(v) + if v == "now" { + return now.UTC(), nil + } + if t, err := time.Parse(time.RFC3339, v); err == nil { + return t.UTC(), nil + } + if span, ok := strings.CutPrefix(v, "+"); ok { + if d, ok := parseSpan(span); ok { + return now.Add(d).UTC(), nil + } + } + if _, ok := parseSpan(v); ok { + return time.Time{}, clierr.Usage(fmt.Errorf("--%s: %q has no direction; write +%s for that long from now", flag, v, v)) + } + return time.Time{}, clierr.Usage(fmt.Errorf("--%s: %q is not a time; use an RFC 3339 timestamp (2026-10-28T09:00:00Z), now, or a span from now (+2h, +7d)", flag, v)) +} + +// ParseDurationArg reads a length from a flag such as --duration: "15m", +// "2h", "7d". It must be more than zero. +func ParseDurationArg(flag, v string) (time.Duration, error) { + d, ok := parseSpan(strings.TrimSpace(v)) + if !ok { + return 0, clierr.Usage(fmt.Errorf("--%s: %q is not a length; use for example 15m, 2h or 7d", flag, v)) + } + return d, nil +} + +// parseSpan reads a length of time above zero, in whole days ("7d") or as a +// Go duration ("90m", "1h30m"). +func parseSpan(v string) (time.Duration, bool) { + if days, ok := strings.CutSuffix(v, "d"); ok { + n, err := strconv.Atoi(days) + if err != nil || n <= 0 { + return 0, false + } + return time.Duration(n) * 24 * time.Hour, true + } + d, err := time.ParseDuration(v) + if err != nil || d <= 0 { + return 0, false + } + return d, true +} diff --git a/internal/cmdutil/timearg_test.go b/internal/cmdutil/timearg_test.go index 411baaf..4bc164c 100644 --- a/internal/cmdutil/timearg_test.go +++ b/internal/cmdutil/timearg_test.go @@ -1,6 +1,7 @@ package cmdutil import ( + "strings" "testing" "time" @@ -28,3 +29,52 @@ func TestParseTimeArg(t *testing.T) { } } } + +func TestParseFutureTimeArg(t *testing.T) { + now := time.Date(2026, 10, 28, 12, 0, 0, 0, time.FixedZone("CET", 3600)) + for in, want := range map[string]time.Time{ + "now": now.UTC(), + " now ": now.UTC(), + "+2h": now.Add(2 * time.Hour).UTC(), + "+90m": now.Add(90 * time.Minute).UTC(), + "+1h30m": now.Add(90 * time.Minute).UTC(), + "+7d": now.Add(7 * 24 * time.Hour).UTC(), + "2026-10-29T09:30:00Z": time.Date(2026, 10, 29, 9, 30, 0, 0, time.UTC), + "2026-10-29T11:30:00+02:00": time.Date(2026, 10, 29, 9, 30, 0, 0, time.UTC), + } { + got, err := ParseFutureTimeArg("start", in, now) + if err != nil || !got.Equal(want) || got.Location() != time.UTC { + t.Errorf("%q: got %v, %v; want %v", in, got, err, want) + } + } + for _, in := range []string{"", "soon", "-2h", "+", "+0h", "+-2h", "+soon", "2026-10-29", "+-1d", "+0d"} { + if _, err := ParseFutureTimeArg("start", in, now); !clierr.IsUsage(err) { + t.Errorf("%q: want a usage error, got %v", in, err) + } + } +} + +// ParseTimeArg reads a bare span as an age, so here it is refused and the +// message shows the spelling that works. +func TestParseFutureTimeArgRefusesABareSpan(t *testing.T) { + now := time.Date(2026, 10, 28, 12, 0, 0, 0, time.UTC) + for _, in := range []string{"2h", "90m", "7d"} { + _, err := ParseFutureTimeArg("start", in, now) + if !clierr.IsUsage(err) || !strings.Contains(err.Error(), "+"+in) { + t.Errorf("%q: want a usage error naming +%s, got %v", in, in, err) + } + } +} + +func TestParseDurationArg(t *testing.T) { + for in, want := range map[string]time.Duration{"15m": 15 * time.Minute, "2h": 2 * time.Hour, "7d": 7 * 24 * time.Hour, " 1h ": time.Hour} { + if got, err := ParseDurationArg("duration", in); err != nil || got != want { + t.Errorf("%q: got %v, %v; want %v", in, got, err, want) + } + } + for _, in := range []string{"", "0", "0h", "-1h", "soon", "0d", "1.5d"} { + if _, err := ParseDurationArg("duration", in); !clierr.IsUsage(err) { + t.Errorf("%q: want a usage error, got %v", in, err) + } + } +} From 0e812ecedea8a1a3c424149aa67a62fc23b8a804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0v=C3=A1b=C3=ADk?= Date: Fri, 6 Nov 2026 14:36:51 +0100 Subject: [PATCH 4/7] feat(monitor): add monitor maintenance commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit list, get, create, update, cancel and finish, with the deploy pattern in the help. monitor status moves monitors whose problem a window holds from problems to a maintenance list, monitors run says inMaintenance, and monitor lists show until when a window holds a monitor. Signed-off-by: Jan Švábík --- internal/cli/monitor/bulk.go | 8 +- internal/cli/monitor/cmd.go | 14 +- internal/cli/monitor/completion.go | 32 +- internal/cli/monitor/format.go | 18 +- internal/cli/monitor/incidents.go | 1 + internal/cli/monitor/maintenance.go | 745 ++++++++++++++++++ internal/cli/monitor/monitors.go | 31 +- internal/cli/monitor/status.go | 85 +- internal/cli/monitor_maintenance_test.go | 505 ++++++++++++ internal/cli/monitor_test.go | 2 + .../cli/testdata/golden/commands-monitor.json | 629 +++++++++++++-- .../golden/monitor-availability-get.json | 8 + .../golden/monitor-availability-get.yaml | 8 + .../golden/monitor-incidents-get.json | 1 + .../golden/monitor-incidents-get.yaml | 1 + .../golden/monitor-incidents-list.json | 1 + .../golden/monitor-incidents-list.yaml | 1 + .../golden/monitor-incidents-summary.json | 1 + .../golden/monitor-incidents-summary.tsv | 2 +- .../golden/monitor-incidents-summary.txt | 1 + .../golden/monitor-incidents-summary.yaml | 1 + .../golden/monitor-maintenance-get.json | 32 + .../golden/monitor-maintenance-get.tsv | 1 + .../golden/monitor-maintenance-get.txt | 12 + .../golden/monitor-maintenance-get.yaml | 24 + .../golden/monitor-maintenance-list.json | 57 ++ .../golden/monitor-maintenance-list.tsv | 2 + .../golden/monitor-maintenance-list.txt | 3 + .../golden/monitor-maintenance-list.yaml | 42 + .../golden/monitor-monitors-get-ssl.tsv | 2 +- .../testdata/golden/monitor-monitors-get.json | 1 + .../testdata/golden/monitor-monitors-get.tsv | 2 +- .../testdata/golden/monitor-monitors-get.yaml | 1 + .../golden/monitor-monitors-list.json | 1 + .../testdata/golden/monitor-monitors-list.tsv | 6 +- .../testdata/golden/monitor-monitors-list.txt | 8 +- .../golden/monitor-monitors-list.yaml | 1 + .../testdata/golden/monitor-stats-get.json | 1 + .../testdata/golden/monitor-stats-get.yaml | 1 + .../cli/testdata/golden/monitor-status.json | 4 +- .../cli/testdata/golden/monitor-status.tsv | 2 +- .../cli/testdata/golden/monitor-status.txt | 18 +- .../cli/testdata/golden/monitor-status.yaml | 2 + 43 files changed, 2206 insertions(+), 112 deletions(-) create mode 100644 internal/cli/monitor/maintenance.go create mode 100644 internal/cli/monitor_maintenance_test.go create mode 100644 internal/cli/testdata/golden/monitor-maintenance-get.json create mode 100644 internal/cli/testdata/golden/monitor-maintenance-get.tsv create mode 100644 internal/cli/testdata/golden/monitor-maintenance-get.txt create mode 100644 internal/cli/testdata/golden/monitor-maintenance-get.yaml create mode 100644 internal/cli/testdata/golden/monitor-maintenance-list.json create mode 100644 internal/cli/testdata/golden/monitor-maintenance-list.tsv create mode 100644 internal/cli/testdata/golden/monitor-maintenance-list.txt create mode 100644 internal/cli/testdata/golden/monitor-maintenance-list.yaml diff --git a/internal/cli/monitor/bulk.go b/internal/cli/monitor/bulk.go index 6a364c7..d388147 100644 --- a/internal/cli/monitor/bulk.go +++ b/internal/cli/monitor/bulk.go @@ -26,10 +26,14 @@ names, as arguments or one per line with --file), or every monitor the list filters match (--type, --status, --search). Each monitor is handled as its own request would be, so one refusal doesn't stop the others; the result lists every monitor with ok or its problem code. The command exits -1 when any monitor failed.`, +1 when any monitor failed. + +For planned work, "monitor maintenance create" is usually better than +pausing: checks keep running, the time stays out of uptime, status pages say +so, and it ends by itself.`, } for _, a := range []struct{ action, short, example string }{ - {"pause", "Pause many monitors", ` # Maintenance window: pause everything behind api.example.com + {"pause", "Pause many monitors", ` # Pause everything behind api.example.com; for planned work, see "monitor maintenance" norcube monitor monitors bulk pause --search api.example.com --yes`}, {"resume", "Resume many monitors", ` norcube monitor monitors bulk resume --status paused --search api.example.com --yes`}, {"delete", "Delete many monitors and their history", ` norcube monitor monitors bulk delete 7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f "Old landing page" diff --git a/internal/cli/monitor/cmd.go b/internal/cli/monitor/cmd.go index 55fd403..36570ee 100644 --- a/internal/cli/monitor/cmd.go +++ b/internal/cli/monitor/cmd.go @@ -1,7 +1,7 @@ // Package monitor implements the `norcube monitor ...` command tree: // uptime, SSL certificate and domain expiry monitors, their check history, -// incidents and alert channels, public status pages, and an -// organization-wide status for scripts and CI. +// incidents and alert channels, public status pages, maintenance windows, +// and an organization-wide status for scripts and CI. package monitor import ( @@ -58,7 +58,8 @@ from Norcube's servers. A monitor is an HTTP check (optionally with a keyword), an SSL certificate check or a domain expiry check. Problems confirmed by consecutive checks open incidents, which alert through your alert channels (email, webhook, Slack, Discord, SMS). Status pages show -chosen monitors to the public. +chosen monitors to the public. Maintenance windows pause alerts for planned +work and keep it out of uptime. Monitors and channels are named by their id or, where a command says so, by their exact name. Checks count towards your Norcube Monitor usage, on a @@ -69,9 +70,11 @@ critical incident is open, and "monitor monitors run --wait" fails it when the check finds the monitor down. CI tokens need a Norcube Monitor scope: monitor.read (everything that reads), monitor.check (run checks), monitor.write (manage monitors and -incidents), monitor.channels (manage alert channels) or +incidents), monitor.channels (manage alert channels), monitor.statuspages (manage status pages, post on them and manage their -subscribers). monitor.write includes neither of the last two.`, +subscribers) or monitor.maintenance (manage maintenance windows; one that +shows on a published page also takes monitor.statuspages). monitor.write +includes none of the last three.`, } cmd.AddCommand( newStatusCmd(d), @@ -79,6 +82,7 @@ subscribers). monitor.write includes neither of the last two.`, newIncidentsCmd(d), newChannelsCmd(d), newStatusPagesCmd(d), + newMaintenanceCmd(d), ) registerCompletions(cmd, d) return cmd diff --git a/internal/cli/monitor/completion.go b/internal/cli/monitor/completion.go index a7c8df2..2041a99 100644 --- a/internal/cli/monitor/completion.go +++ b/internal/cli/monitor/completion.go @@ -18,12 +18,13 @@ const ( completeIncidents = "monitor-incidents" completePages = "monitor-status-pages" completePosts = "monitor-status-page-incidents" + completeWindows = "monitor-maintenance-windows" ) // registerCompletions offers monitor ids (named, with their status), // channel ids and open incident ids to the commands and flags that take -// them, and status pages (and a page's posted incidents, once the page is -// named) to the status page commands. +// them, status pages (and a page's posted incidents, once the page is named) +// to the status page commands, and maintenance windows to their commands. func registerCompletions(root *cobra.Command, d deps) { monitors := monitorCandidates(d) var walk func(c *cobra.Command) @@ -31,6 +32,9 @@ func registerCompletions(root *cobra.Command, d deps) { if c.Flags().Lookup("monitor") != nil { _ = c.RegisterFlagCompletionFunc("monitor", completion.Flag(completeMonitors, monitors)) } + if c.Flags().Lookup("status-page") != nil { + _ = c.RegisterFlagCompletionFunc("status-page", completion.Flag(completePages, pageCandidates(d))) + } switch first := firstArg(c.Use); first { case "": c.ValidArgsFunction = completion.Func(completeMonitors, 1, monitors) @@ -40,6 +44,8 @@ func registerCompletions(root *cobra.Command, d deps) { c.ValidArgsFunction = completion.Func(completeChannels, 1, channelCandidates(d)) case "": c.ValidArgsFunction = completion.Func(completeIncidents, 1, incidentCandidates(d)) + case "": + c.ValidArgsFunction = completion.Func(completeWindows, 1, windowCandidates(d)) case "": c.ValidArgsFunction = completion.Func(completePages, 1, pageCandidates(d)) case " ": @@ -88,6 +94,28 @@ func monitorCandidates(d deps) completion.Fetcher { } } +func windowCandidates(d deps) completion.Fetcher { + return func(cmd *cobra.Command) ([]cobra.Completion, error) { + c, err := d.client(cmd) + if err != nil { + return nil, err + } + limit := maxPageSize + res, err := c.API.ListMaintenanceWindowsWithResponse(cmd.Context(), &monitor.ListMaintenanceWindowsParams{Limit: &limit}) + if err != nil { + return nil, err + } + if res.JSON200 == nil { + return nil, fmt.Errorf("status %d", res.StatusCode()) + } + out := make([]cobra.Completion, 0, len(res.JSON200.List)) + for _, w := range res.JSON200.List { + out = append(out, fmt.Sprintf("%s\t%s: %s", w.Id, w.State, w.Title)) + } + return out, nil + } +} + func channelCandidates(d deps) completion.Fetcher { return func(cmd *cobra.Command) ([]cobra.Completion, error) { c, err := d.client(cmd) diff --git a/internal/cli/monitor/format.go b/internal/cli/monitor/format.go index bde98c1..2ff5061 100644 --- a/internal/cli/monitor/format.go +++ b/internal/cli/monitor/format.go @@ -185,7 +185,12 @@ func joinInts(v []int) string { // ---------- monitors ---------- -var monitorHeaders = []string{"ID", "NAME", "TYPE", "STATUS", "TARGET", "UPTIME 24H", "LAST CHECK"} +// heldBy says which window holds a monitor and until when. +func heldBy(h monitor.DtoMonitorMaintenance) string { + return fmt.Sprintf("%q until %s (%s)", h.Title, stamp(h.EndsAt), h.WindowId) +} + +var monitorHeaders = []string{"ID", "NAME", "TYPE", "STATUS", "TARGET", "UPTIME 24H", "LAST CHECK", "MAINTENANCE UNTIL"} func monitorWord(m monitor.DtoMonitor) string { cond := "" @@ -203,13 +208,17 @@ func monitorRow(m monitor.DtoMonitor) []string { if m.LastCheck != nil { last = output.WhenString(m.LastCheck.At) } - return []string{m.Id.String(), m.Name, string(m.Variant), monitorWord(m), m.Target, uptime, last} + until := "—" + if m.Maintenance != nil { + until = output.WhenString(m.Maintenance.EndsAt) + } + return []string{m.Id.String(), m.Name, string(m.Variant), monitorWord(m), m.Target, uptime, last, until} } func monitorTable(items []monitor.DtoMonitor) output.Table[monitor.DtoMonitor] { return output.Table[monitor.DtoMonitor]{ Headers: monitorHeaders, - MaxWidths: []int{0, 32, 0, 0, 48, 0, 0}, + MaxWidths: []int{0, 32, 0, 0, 48, 0, 0, 0}, Style: output.Style{StatusColumn: 3}, Rows: monitorRow, Items: items, @@ -225,6 +234,9 @@ func monitorObject(m monitor.DtoMonitor) output.Object { {Name: "Status", Value: monitorWord(m)}, {Name: "Since", Value: output.WhenString(m.StatusSince)}, } + if h := m.Maintenance; h != nil { + f = append(f, output.Field{Name: "In maintenance", Value: heldBy(*h)}) + } if m.Condition != nil && m.Condition.Message != nil { f = append(f, output.Field{Name: "Reason", Value: *m.Condition.Message}) } diff --git a/internal/cli/monitor/incidents.go b/internal/cli/monitor/incidents.go index 4bb0cdc..2a67d8d 100644 --- a/internal/cli/monitor/incidents.go +++ b/internal/cli/monitor/incidents.go @@ -250,6 +250,7 @@ func summaryFields(s monitor.DtoIncidentSummary) []output.Field { {Name: "Resolved 7d", Value: strconv.Itoa(s.ResolvedLast7d)}, {Name: "Resolved 30d", Value: strconv.Itoa(s.ResolvedLast30d)}, {Name: "Mean time to resolve 30d", Value: mttr}, + {Name: "In maintenance", Value: strconv.Itoa(s.Open.InMaintenance)}, } } diff --git a/internal/cli/monitor/maintenance.go b/internal/cli/monitor/maintenance.go new file mode 100644 index 0000000..cd72e04 --- /dev/null +++ b/internal/cli/monitor/maintenance.go @@ -0,0 +1,745 @@ +package monitor + +import ( + "context" + "errors" + "fmt" + "net/http" + "strconv" + "strings" + "time" + + "github.com/google/uuid" + "github.com/spf13/cobra" + + "github.com/norcubeplatform/cli/internal/api/monitor" + "github.com/norcubeplatform/cli/internal/clierr" + "github.com/norcubeplatform/cli/internal/cmdutil" + "github.com/norcubeplatform/cli/internal/output" +) + +// The states a window can be in, as the API names them. +var maintenanceStates = []string{"scheduled", "in_progress", "completed", "cancelled"} + +const ( + maintenanceTimeFormats = "an RFC 3339 timestamp, now, or a span from now (+2h, +7d)" + reasonPublishDenied = "MAINTENANCE_PUBLISH_DENIED" + reasonWindowState = "MAINTENANCE_WINDOW_STATE" +) + +func newMaintenanceCmd(d deps) *cobra.Command { + cmd := &cobra.Command{ + Use: "maintenance", + Aliases: []string{"maintenance-windows"}, + Short: "Schedule maintenance windows that pause alerts and stay out of uptime", + Long: `A maintenance window is planned work on monitors or status page components. +While it runs, its monitors don't alert or open incidents for availability +problems, and the time stays out of their uptime. Checks keep running and +count towards your usage. A certificate or domain running out still alerts, +because that is true whatever work is going on. + +A window shows by itself on every published status page displaying one of its +targets, and subscribers get mail when it is scheduled, starts and finishes +unless you turn that off. Which pages show it isn't a choice: otherwise a page +could stay green while its alerts are silent. + +A CI token changes windows with the monitor.maintenance scope, and also needs +monitor.statuspages when a window shows on a published page. Cancelling or +finishing needs only monitor.maintenance, so whoever can edit a window can +always end its silence. Any Norcube Monitor scope reads them. + +A window ends by itself, so a deploy that dies before "finish" can't silence +alerts for longer than you asked for. Wrap a deploy in one: + + id=$(norcube monitor maintenance create --monitor api --title "Deploy" --duration 15m -o id) + ./deploy.sh + norcube monitor maintenance finish "$id"`, + } + cmd.AddCommand( + newMaintenanceListCmd(d), + newMaintenanceGetCmd(d), + newMaintenanceCreateCmd(d), + newMaintenanceUpdateCmd(d), + newMaintenanceCancelCmd(d), + newMaintenanceFinishCmd(d), + ) + return cmd +} + +func newMaintenanceListCmd(d deps) *cobra.Command { + var ( + pf cmdutil.PageFlags + state, mon, spPage string + ) + cmd := &cobra.Command{ + Use: "list", + Annotations: cmdutil.Reads(), + Short: "List maintenance windows, latest start first", + Long: `Lists the organization's windows, latest start first; with --state scheduled, soonest first.`, + Example: ` norcube monitor maintenance list + norcube monitor maintenance list --state in_progress + norcube monitor maintenance list --monitor "Shop API" --all-pages + norcube monitor maintenance list --status-page acme --state scheduled -o json`, + Args: cobra.NoArgs, + RunE: cmdutil.Run(func(cmd *cobra.Command, _ []string) (any, error) { + params := monitor.ListMaintenanceWindowsParams{} + if state != "" { + if err := oneOf("--state", state, maintenanceStates); err != nil { + return nil, err + } + v := monitor.ListMaintenanceWindowsParamsStatus(state) + params.Status = &v + } + c, err := d.client(cmd) + if err != nil { + return nil, err + } + if mon != "" { + id, err := monitorRef(cmd.Context(), c, mon) + if err != nil { + return nil, err + } + params.MonitorId = &id + } + if spPage != "" { + id, err := statusPageID(cmd.Context(), c, spPage) + if err != nil { + return nil, err + } + params.StatusPageId = &id + } + page, err := cmdutil.Paginate(cmd.Context(), pf, func(ctx context.Context, cursor string, size int) ([]monitor.DtoMaintenanceWindow, string, error) { + p := params + p.Limit = &size + if cursor != "" { + p.Cursor = &cursor + } + res, err := c.API.ListMaintenanceWindowsWithResponse(ctx, &p) + if err != nil { + return nil, "", err + } + if res.JSON200 == nil { + return nil, "", apiError(res.HTTPResponse, res.Body) + } + return res.JSON200.List, nextCursor(res.JSON200.Cursors), nil + }) + if err != nil { + return nil, err + } + return nil, page.Print(cmd, windowTable(page.Items)) + }), + } + cmd.Flags().StringVar(&state, "state", "", "Only windows in this state: scheduled, in_progress, completed or cancelled") + cmd.Flags().StringVar(&mon, "monitor", "", "Only windows holding this monitor (id or exact name)") + cmd.Flags().StringVar(&spPage, "status-page", "", "Only windows showing on this status page (id or exact slug)") + cmdutil.FlagEnum(cmd, "state", maintenanceStates...) + cmdutil.AddPageFlags(cmd, &pf, defaultPageSize, maxItems) + return cmd +} + +func newMaintenanceGetCmd(d deps) *cobra.Command { + return &cobra.Command{ + Use: "get ", + Annotations: cmdutil.Reads(), + Short: "Show a maintenance window, its targets and the pages it shows on", + Example: ` norcube monitor maintenance get 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a`, + Args: cobra.ExactArgs(1), + RunE: cmdutil.Run(func(cmd *cobra.Command, args []string) (any, error) { + id, err := idArg("maintenance window", args[0]) + if err != nil { + return nil, err + } + c, err := d.client(cmd) + if err != nil { + return nil, err + } + w, err := getWindow(cmd.Context(), c, id) + if err != nil { + return nil, err + } + return windowObject(w), nil + }), + } +} + +func getWindow(ctx context.Context, c *monitorContext, id uuid.UUID) (monitor.DtoMaintenanceWindow, error) { + res, err := c.API.GetMaintenanceWindowWithResponse(ctx, id) + if err != nil { + return monitor.DtoMaintenanceWindow{}, err + } + if res.JSON200 == nil { + return monitor.DtoMaintenanceWindow{}, apiError(res.HTTPResponse, res.Body) + } + return *res.JSON200, nil +} + +// windowFlags are what create and update share. +type windowFlags struct { + title, description string + start, end, length string + monitors, components []string + pages []string + notifyScheduled bool + notifyStarted bool + notifyFinished, notifyOff bool +} + +// add registers the flags. A switch's default is shown only where it applies: +// update changes what you pass and nothing else. +func (f *windowFlags) add(cmd *cobra.Command, notifyDefault bool) { + cmd.Flags().StringVar(&f.title, "title", "", "The window's title; public on a published status page") + cmd.Flags().StringVar(&f.description, "description", "", "What is happening; public on a published status page and in mail") + cmd.Flags().StringArrayVar(&f.monitors, "monitor", nil, "A monitor to hold, by id or exact name (repeatable); domain monitors can't be held") + cmd.Flags().StringArrayVar(&f.components, "component", nil, "A manual status page component to mark, by id or exact name (repeatable)") + cmd.Flags().StringArrayVar(&f.pages, "status-page", nil, "Everything a status page shows right now, by id or exact slug (repeatable); something added to the page later isn't included") + cmd.Flags().StringVar(&f.end, "end", "", "When it ends: "+maintenanceTimeFormats) + cmd.Flags().StringVar(&f.length, "duration", "", "How long it lasts, counted from its start: 15m, 2h, 7d (at most 30 days)") + cmd.MarkFlagsMutuallyExclusive("end", "duration") + cmd.Flags().BoolVar(&f.notifyScheduled, "notify-scheduled", notifyDefault, "Email subscribers when it is scheduled") + cmd.Flags().BoolVar(&f.notifyStarted, "notify-started", notifyDefault, "Email subscribers when it starts") + cmd.Flags().BoolVar(&f.notifyFinished, "notify-finished", notifyDefault, "Email subscribers when it finishes") + cmd.Flags().BoolVar(&f.notifyOff, "no-notify", false, "Turn off all three mails; a cancellation still tells whoever was told") + for _, name := range []string{"notify-scheduled", "notify-started", "notify-finished"} { + cmd.MarkFlagsMutuallyExclusive("no-notify", name) + } +} + +func (f *windowFlags) hasTargets() bool { + return len(f.monitors)+len(f.components)+len(f.pages) > 0 +} + +// targets resolves the named monitors, components and pages into ids. A list +// nobody named stays out of the request. +func (f *windowFlags) targets(ctx context.Context, c *monitorContext) (monitor.DtoMaintenanceWindowTargets, error) { + var out monitor.DtoMaintenanceWindowTargets + if len(f.monitors) > 0 { + ids := make([]uuid.UUID, 0, len(f.monitors)) + for _, ref := range f.monitors { + id, err := monitorRef(ctx, c, ref) + if err != nil { + return out, err + } + ids = append(ids, id) + } + out.MonitorIds = &ids + } + if len(f.components) > 0 { + ids, err := componentRefs(ctx, c, f.components) + if err != nil { + return out, err + } + out.ComponentIds = &ids + } + if len(f.pages) > 0 { + ids := make([]uuid.UUID, 0, len(f.pages)) + for _, ref := range f.pages { + id, err := statusPageID(ctx, c, ref) + if err != nil { + return out, err + } + ids = append(ids, id) + } + out.StatusPageIds = &ids + } + return out, nil +} + +// componentRefs resolves manual components by id or exact name, reading what a +// window can target only when one is named by name. A name is unique on a page +// at most, so one matching several is a usage error, never a guess. +func componentRefs(ctx context.Context, c *monitorContext, refs []string) ([]uuid.UUID, error) { + var known *monitor.DtoMaintenanceTargets + out := make([]uuid.UUID, 0, len(refs)) + for _, ref := range refs { + ref = strings.TrimSpace(ref) + if id, err := uuid.Parse(ref); err == nil { + out = append(out, id) + continue + } + if known == nil { + res, err := c.API.GetMaintenanceTargetsWithResponse(ctx) + if err != nil { + return nil, err + } + if res.JSON200 == nil { + return nil, apiError(res.HTTPResponse, res.Body) + } + known = res.JSON200 + } + var ids []string + for _, x := range known.Components { + if strings.EqualFold(x.Name, ref) { + ids = append(ids, x.Id.String()) + } + } + switch len(ids) { + case 0: + return nil, &clierr.Error{Code: clierr.CodeNotFound, Message: fmt.Sprintf("no manual component named %q", ref), + Hint: "Only a page's manual components are targets; to hold a monitor's, use --monitor. See a page's with `norcube monitor status-pages layout get `."} + case 1: + out = append(out, uuid.MustParse(ids[0])) + default: + return nil, clierr.Usage(fmt.Errorf("%d components are named %q: name one by id (%s)", len(ids), ref, strings.Join(ids, ", "))) + } + } + return out, nil +} + +func newMaintenanceCreateCmd(d deps) *cobra.Command { + var f windowFlags + cmd := &cobra.Command{ + Use: "create", + Annotations: cmdutil.Writes(), + Short: "Schedule a maintenance window, or start one now", + Long: `Schedules a window. Without --start it begins right away. It needs a title, +at least one target, and --end or --duration; it can last at most 30 days and +start at most a year ahead. + +It shows by itself on every published status page displaying a target, and +subscribers get all three mails unless you turn them off with --notify-scheduled, +--notify-started, --notify-finished or --no-notify. A window that starts within +15 minutes sends no scheduled mail, only the started one. + +A CI token needs the monitor.maintenance scope, and monitor.statuspages too when +the window shows on a published page.`, + Example: ` # Silence a monitor around a deploy + id=$(norcube monitor maintenance create --monitor api --title "Deploy" --duration 15m -o id) + ./deploy.sh + norcube monitor maintenance finish "$id" + + # Announce work for tomorrow on everything a status page shows + norcube monitor maintenance create --status-page acme --title "Database upgrade" --description "Short interruptions are expected." --start 2026-11-07T14:00:00Z --end 2026-11-07T16:00:00Z + + # A quiet window nobody hears about + norcube monitor maintenance create --monitor "Shop API" --monitor "Shop cert" --title "Load test" --start +1h --duration 2h --no-notify`, + Args: cobra.NoArgs, + RunE: cmdutil.Run(func(cmd *cobra.Command, _ []string) (any, error) { + title := strings.TrimSpace(f.title) + if title == "" { + return nil, clierr.Usage(fmt.Errorf("the title is empty")) + } + if !f.hasTargets() { + return nil, clierr.Usage(fmt.Errorf("name at least one target: --monitor, --component or --status-page")) + } + now := d.now() + start := now + if f.start != "" { + t, err := cmdutil.ParseFutureTimeArg("start", f.start, now) + if err != nil { + return nil, err + } + start = t + } + end, err := windowEnd(f, start, now) + if err != nil { + return nil, err + } + notify := !f.notifyOff + body := monitor.DtoMaintenanceWindowCreate{ + Title: title, + StartsAt: start.UTC().Format(time.RFC3339), + EndsAt: end.UTC().Format(time.RFC3339), + NotifyScheduled: notify && f.notifyScheduled, + NotifyStarted: notify && f.notifyStarted, + NotifyFinished: notify && f.notifyFinished, + } + if cmd.Flags().Changed("description") { + body.Description = &f.description + } + c, err := d.client(cmd) + if err != nil { + return nil, err + } + if body.Targets, err = f.targets(cmd.Context(), c); err != nil { + return nil, err + } + res, err := c.API.CreateMaintenanceWindowWithResponse(cmd.Context(), body) + if err != nil { + return nil, err + } + if res.JSON201 == nil { + return nil, maintenanceError(res.HTTPResponse, res.Body, "create", "") + } + return windowSaved("Scheduled", *res.JSON201), nil + }), + } + f.add(cmd, true) + cmd.Flags().StringVar(&f.start, "start", "", "When it starts, if not now: "+maintenanceTimeFormats) + _ = cmd.MarkFlagRequired("title") + cmd.MarkFlagsOneRequired("end", "duration") + return cmd +} + +// windowEnd reads --end or --duration, the latter counted from start. +func windowEnd(f windowFlags, start, now time.Time) (time.Time, error) { + if f.length != "" { + span, err := cmdutil.ParseDurationArg("duration", f.length) + if err != nil { + return time.Time{}, err + } + return start.Add(span), nil + } + return cmdutil.ParseFutureTimeArg("end", f.end, now) +} + +func newMaintenanceUpdateCmd(d deps) *cobra.Command { + var f windowFlags + cmd := &cobra.Command{ + Use: "update ", + Annotations: cmdutil.Writes(), + Short: "Change a maintenance window, as far as where it stands allows", + Long: `Changes only what you pass. + +Before the window starts, everything can change; moving a time by 5 minutes or +more tells subscribers who were already told. Once it has started, its targets +and start are frozen: you can still change the text and the mail switches, and +extend or shorten it, which sends no mail. Once it is over, only the text can +change. A cancelled window can't change. The API refuses anything else with +exit 8. + +--monitor, --component and --status-page replace the targets as a whole, so name +everything the window should keep. --duration counts from the new --start, or +else from the window's current start. + +A CI token needs the monitor.maintenance scope, and monitor.statuspages too when +the window shows on a published page before or after the change. To end a window +now, use "finish"; to call off one that hasn't started, use "cancel".`, + Example: ` # The deploy needs longer + norcube monitor maintenance update 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --end +1h + norcube monitor maintenance update 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --start 2026-11-08T14:00:00Z --duration 2h + norcube monitor maintenance update 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --title "Database upgrade" --no-notify`, + Args: cobra.ExactArgs(1), + RunE: cmdutil.Run(func(cmd *cobra.Command, args []string) (any, error) { + id, err := idArg("maintenance window", args[0]) + if err != nil { + return nil, err + } + set := cmd.Flags().Changed + now := d.now() + var body monitor.DtoMaintenanceWindowUpdate + changed := f.hasTargets() + if set("title") { + t := strings.TrimSpace(f.title) + if t == "" { + return nil, clierr.Usage(fmt.Errorf("the title is empty")) + } + body.Title, changed = &t, true + } + if set("description") { + body.Description, changed = &f.description, true + } + var start *time.Time + if set("start") { + t, err := cmdutil.ParseFutureTimeArg("start", f.start, now) + if err != nil { + return nil, err + } + start = &t + v := t.Format(time.RFC3339) + body.StartsAt, changed = &v, true + } + if set("end") { + t, err := cmdutil.ParseFutureTimeArg("end", f.end, now) + if err != nil { + return nil, err + } + v := t.Format(time.RFC3339) + body.EndsAt, changed = &v, true + } + var span time.Duration + if set("duration") { + if span, err = cmdutil.ParseDurationArg("duration", f.length); err != nil { + return nil, err + } + changed = true + } + off := false + if f.notifyOff { + body.NotifyScheduled, body.NotifyStarted, body.NotifyFinished, changed = &off, &off, &off, true + } + if set("notify-scheduled") { + body.NotifyScheduled, changed = &f.notifyScheduled, true + } + if set("notify-started") { + body.NotifyStarted, changed = &f.notifyStarted, true + } + if set("notify-finished") { + body.NotifyFinished, changed = &f.notifyFinished, true + } + if !changed { + return nil, clierr.Usage(fmt.Errorf("nothing to change: pass what should change, such as --title, --end or --monitor (to end it now, use: maintenance finish)")) + } + c, err := d.client(cmd) + if err != nil { + return nil, err + } + if f.hasTargets() { + t, err := f.targets(cmd.Context(), c) + if err != nil { + return nil, err + } + body.Targets = &t + } + if set("duration") { + if start == nil { + w, err := getWindow(cmd.Context(), c, id) + if err != nil { + return nil, err + } + t, err := time.Parse(time.RFC3339Nano, w.StartsAt) + if err != nil { + return nil, fmt.Errorf("the window's start %q: %w", w.StartsAt, err) + } + start = &t + } + v := start.Add(span).UTC().Format(time.RFC3339) + body.EndsAt = &v + } + res, err := c.API.UpdateMaintenanceWindowWithResponse(cmd.Context(), id, body) + if err != nil { + return nil, err + } + if res.JSON200 == nil { + return nil, maintenanceError(res.HTTPResponse, res.Body, "update", id.String()) + } + return windowSaved("Updated", *res.JSON200), nil + }), + } + f.add(cmd, false) + cmd.Flags().StringVar(&f.start, "start", "", "Move its start, before it has started: an RFC 3339 timestamp or a span from now (+2h, +7d)") + return cmd +} + +func newMaintenanceCancelCmd(d deps) *cobra.Command { + var yes bool + cmd := &cobra.Command{ + Use: "cancel ", + Annotations: cmdutil.Writes(), + Short: "Call off a maintenance window that hasn't started", + Long: `Calls off a scheduled window. It won't run, and subscribers who were told hear +it was cancelled. One that has started exits 8: use "finish" instead. It needs +only the monitor.maintenance scope, even on a published page.`, + Example: ` norcube monitor maintenance cancel 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a + norcube monitor maintenance cancel 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --yes`, + Args: cobra.ExactArgs(1), + RunE: cmdutil.Run(func(cmd *cobra.Command, args []string) (any, error) { + id, err := idArg("maintenance window", args[0]) + if err != nil { + return nil, err + } + c, err := d.client(cmd) + if err != nil { + return nil, err + } + if ok, err := cmdutil.Confirm(fmt.Sprintf("Cancel maintenance window %s? Subscribers who were told hear of it.", id), yes); err != nil || !ok { + return nil, cmdutil.Cancelled(cmd, err) + } + res, err := c.API.CancelMaintenanceWindowWithResponse(cmd.Context(), id) + if err != nil { + return nil, err + } + if res.JSON200 == nil { + return nil, maintenanceError(res.HTTPResponse, res.Body, "cancel", id.String()) + } + w := *res.JSON200 + return windowDone(fmt.Sprintf("Cancelled maintenance %q (%s). Subscribers who were told hear of it.", w.Title, w.Id), w), nil + }), + } + cmd.Flags().BoolVar(&yes, "yes", false, "Don't ask for confirmation") + return cmd +} + +func newMaintenanceFinishCmd(d deps) *cobra.Command { + return &cobra.Command{ + Use: "finish ", + Annotations: cmdutil.Writes(), + Short: "End a maintenance window in progress now", + Long: `Ends a window in progress. The next check counts and alerts as usual, monitors +with an open incident it held are checked again within a minute, and subscribers +hear it finished early. One that hasn't started exits 8: use "cancel" instead. + +It asks for no confirmation, because ending a silence is the safe direction and +it has to run unattended at the end of a deploy. It needs only the +monitor.maintenance scope, even on a published page.`, + Example: ` norcube monitor maintenance finish 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a + norcube monitor maintenance finish "$id"`, + Args: cobra.ExactArgs(1), + RunE: cmdutil.Run(func(cmd *cobra.Command, args []string) (any, error) { + id, err := idArg("maintenance window", args[0]) + if err != nil { + return nil, err + } + c, err := d.client(cmd) + if err != nil { + return nil, err + } + res, err := c.API.FinishMaintenanceWindowWithResponse(cmd.Context(), id) + if err != nil { + return nil, err + } + if res.JSON200 == nil { + return nil, maintenanceError(res.HTTPResponse, res.Body, "finish", id.String()) + } + w := *res.JSON200 + return windowDone(fmt.Sprintf("Finished maintenance %q (%s). Alerts are back on from the next check.", w.Title, w.Id), w), nil + }), + } +} + +// maintenanceError renders a refused write. The API's sentences already say +// what is wrong; the hint says what to do next. +func maintenanceError(resp *http.Response, body []byte, verb, id string) error { + err := apiError(resp, body) + var e *clierr.Error + if !errors.As(err, &e) { + return err + } + details, _ := e.Details.(map[string]any) + reason, _ := details["reason"].(string) + switch { + case reason == reasonPublishDenied: + e.Hint = "A window shows on every published page displaying its targets. Get permission to publish there, give a CI token the monitor.statuspages scope, or target only monitors no published page shows." + case reason == reasonWindowState: + data, _ := details["data"].(map[string]string) + switch { + case verb == "cancel" && data["state"] == "in_progress": + e.Hint = "End it now with `norcube monitor maintenance finish " + id + "`." + case verb == "finish" && data["state"] == "scheduled": + e.Hint = "Call it off with `norcube monitor maintenance cancel " + id + "`." + } + case e.Code == clierr.CodeInsufficientScope: + e.Hint = "Changing a maintenance window takes the monitor.maintenance scope, which no other scope includes. `norcube auth ci-token scopes` lists them." + } + return err +} + +// windowSaved is the result of create and update: the API's window, and a line +// saying what it does now. +func windowSaved(verb string, w monitor.DtoMaintenanceWindow) output.Done { + var msg strings.Builder + fmt.Fprintf(&msg, "%s maintenance %q (%s), %s to %s. ", verb, w.Title, w.Id, stamp(w.StartsAt), stamp(w.EndsAt)) + if n := len(w.Targets.MonitorIds); n > 0 { + fmt.Fprintf(&msg, "Alerts for %s pause while it runs. ", plural(n, "monitor")) + } + public := publicPages(w) + if len(public) == 0 { + msg.WriteString("It shows on no published status page.") + return windowDone(msg.String(), w) + } + fmt.Fprintf(&msg, "It shows publicly on %s within a minute. ", strings.Join(public, ", ")) + if mails := windowMails(w); len(mails) > 0 { + fmt.Fprintf(&msg, "Subscribers get mail: %s.", strings.Join(mails, ", ")) + } else { + msg.WriteString("Subscribers get no mail.") + } + return windowDone(msg.String(), w) +} + +func windowDone(msg string, w monitor.DtoMaintenanceWindow) output.Done { + return output.Done{Message: msg, Value: w, Fields: []output.Field{{Value: w.Id.String()}, {Value: string(w.State)}}} +} + +// publicPages names the published pages a window shows on. +func publicPages(w monitor.DtoMaintenanceWindow) []string { + var names []string + for _, p := range w.StatusPages { + if p.Published { + names = append(names, p.Name) + } + } + return names +} + +// windowMails names the mails a window sends. +func windowMails(w monitor.DtoMaintenanceWindow) []string { + var mails []string + if w.NotifyScheduled { + mails = append(mails, "scheduled") + } + if w.NotifyStarted { + mails = append(mails, "started") + } + if w.NotifyFinished { + mails = append(mails, "finished") + } + return mails +} + +func mailWords(w monitor.DtoMaintenanceWindow) string { + if mails := windowMails(w); len(mails) > 0 { + return strings.Join(mails, ", ") + } + return "none" +} + +func windowRow(w monitor.DtoMaintenanceWindow) []string { + public := "—" + if names := publicPages(w); len(names) > 0 { + public = strings.Join(names, ", ") + } + return []string{w.Id.String(), w.Title, string(w.State), output.WhenString(w.StartsAt), output.WhenString(w.EndsAt), + strconv.Itoa(len(w.Targets.MonitorIds)), strconv.Itoa(len(w.Targets.ComponentIds)), public} +} + +func windowTable(items []monitor.DtoMaintenanceWindow) output.Table[monitor.DtoMaintenanceWindow] { + return output.Table[monitor.DtoMaintenanceWindow]{ + Headers: []string{"ID", "TITLE", "STATE", "STARTS", "ENDS", "MONITORS", "COMPONENTS", "PUBLIC ON"}, + MaxWidths: []int{0, 40, 0, 0, 0, 0, 0, 32}, + Rows: windowRow, + Items: items, + } +} + +func windowObject(w monitor.DtoMaintenanceWindow) output.Object { + ids := func(in []uuid.UUID) []string { + out := make([]string, len(in)) + for i, id := range in { + out[i] = id.String() + } + return out + } + pages := make([]string, 0, len(w.StatusPages)) + for _, p := range w.StatusPages { + state := "draft" + if p.Published { + state = "published" + } + pages = append(pages, fmt.Sprintf("%s (%s)", p.Name, state)) + } + ends := output.WhenString(w.EndsAt) + endsName := "Ends" + if w.FinishedEarly { + endsName = "Finished early" + } + f := []output.Field{ + {Name: "ID", Value: w.Id.String()}, + {Name: "Title", Value: w.Title}, + {Name: "State", Value: string(w.State)}, + {Name: "Starts", Value: output.WhenString(w.StartsAt)}, + {Name: endsName, Value: ends}, + } + if w.Description != "" { + f = append(f, output.Field{Name: "Description", Value: w.Description}) + } + f = append(f, + output.Field{Name: "Monitors", Value: orNone(ids(w.Targets.MonitorIds))}, + output.Field{Name: "Components", Value: orNone(ids(w.Targets.ComponentIds))}, + output.Field{Name: "Status pages", Value: orNone(pages)}, + output.Field{Name: "Mail", Value: mailWords(w)}, + output.Field{Name: "Created", Value: output.WhenString(w.CreatedAt)}, + ) + if w.CreatedByName != nil { + f = append(f, output.Field{Name: "Created by", Value: *w.CreatedByName}) + } + if w.FinishedByName != nil { + f = append(f, output.Field{Name: "Finished by", Value: *w.FinishedByName}) + } + if w.CancelledAt != nil { + f = append(f, output.Field{Name: "Cancelled", Value: output.WhenString(*w.CancelledAt)}) + } + if w.CancelledByName != nil { + f = append(f, output.Field{Name: "Cancelled by", Value: *w.CancelledByName}) + } + // -o text prints the list's columns: the fields above depend on the window. + return output.Object{Value: w, Fields: f, Text: windowRow(w)} +} diff --git a/internal/cli/monitor/monitors.go b/internal/cli/monitor/monitors.go index 5020388..d66bf17 100644 --- a/internal/cli/monitor/monitors.go +++ b/internal/cli/monitor/monitors.go @@ -324,7 +324,11 @@ exits 1 with code job_failed (the result in "details") when the check found the monitor critical or couldn't reach a verdict (inconclusive), or with --fail-on warning also when it found a warning, and prints nothing on stdout then; it exits 7 when no result arrives within --wait-timeout. Without --wait the command exits 0 -whatever the check found.`, +whatever the check found. + +A maintenance window doesn't change any of that: --wait still fails on a +critical result, because it is there to tell whether the deploy worked. The +result says inMaintenance when one held the monitor.`, Example: ` norcube monitor monitors run "Shop API" # Fail a deploy when the site is down after it norcube monitor monitors run "Shop API" --wait @@ -364,13 +368,24 @@ whatever the check found.`, return nil, apiError(res.HTTPResponse, res.Body) } r := *res.JSON200 + result := runResult{DtoCheckResult: r, InMaintenance: m.Maintenance != nil} if wf.Wait && checkFailed(string(r.Severity), failOn) { // Like every failed --wait: nothing on stdout, the result // in the error's details. - return nil, cmdutil.JobFailed(fmt.Sprintf("the check of %s found it %s (%s)", m.Name, - resultWord(string(m.Type), string(r.Severity), r.Condition), r.Condition), r) + msg := fmt.Sprintf("the check of %s found it %s (%s)", m.Name, + resultWord(string(m.Type), string(r.Severity), r.Condition), r.Condition) + if result.InMaintenance { + msg += ", in a maintenance window" + } + return nil, cmdutil.JobFailed(msg, result) + } + view := resultObject(string(m.Type), r) + view.Value = result + view.Text = append(view.Text, yesNo(result.InMaintenance)) + if h := m.Maintenance; h != nil { + view.Fields = append(view.Fields, output.Field{Name: "In maintenance", Value: heldBy(*h)}) } - return resultObject(string(m.Type), r), nil + return view, nil }), } cmdutil.AddWaitFlags(cmd, &wf, "check", runWaitTimeout) @@ -379,6 +394,14 @@ whatever the check found.`, return cmd } +// runResult is what `monitors run` prints: the check's result, and whether a +// maintenance window holds the monitor. The API's result doesn't say, so it +// comes from the monitor as read just before the check. +type runResult struct { + monitor.DtoCheckResult + InMaintenance bool `json:"inMaintenance" yaml:"inMaintenance"` +} + // checkFailed reports whether a check result's severity fails a --wait: // critical and inconclusive always, warning with --fail-on warning. func checkFailed(severity, failOn string) bool { diff --git a/internal/cli/monitor/status.go b/internal/cli/monitor/status.go index 9112b5e..5058b14 100644 --- a/internal/cli/monitor/status.go +++ b/internal/cli/monitor/status.go @@ -3,7 +3,7 @@ package monitor import ( "context" "fmt" - "strings" + "strconv" "github.com/spf13/cobra" @@ -24,8 +24,39 @@ type statusReport struct { Incidents monitor.DtoIncidentSummary `json:"incidents" yaml:"incidents"` Monitors monitorCounts `json:"monitors" yaml:"monitors"` // Problems are the monitors whose overall status is critical or - // warning, worst first. + // warning, worst first, unless a maintenance window holds the problem. Problems []problemMonitor `json:"problems" yaml:"problems"` + // Maintenance are the monitors whose problem a maintenance window holds, + // so it opens no incident, sends no alert and fails no --fail-on. + Maintenance []heldMonitor `json:"maintenance" yaml:"maintenance"` +} + +// heldMonitor is a monitor with a held problem and the window holding it. +type heldMonitor struct { + problemMonitor + Maintenance monitor.DtoMonitorMaintenance `json:"maintenance" yaml:"maintenance"` +} + +// calendarConditions are the problems of a monitor's own check that follow +// from the calendar: true whatever work is going on, so a maintenance window +// leaves them live. HTTP monitors have none: there, a certificate that makes +// the request fail is about what the work interrupts, and the watch on the +// certificate is an aspect. +var calendarConditions = map[string]bool{"cert_expiring": true, "cert_expired": true} + +// heldProblem reports whether a maintenance window holds all of a monitor's +// problem. Watched aspects only ever have calendar problems, so one of those +// keeps the monitor among the problems, whatever its own check says. +func heldProblem(m monitor.DtoMonitor) bool { + if m.Maintenance == nil { + return false + } + for _, a := range m.Aspects { + if a.Status == "critical" || a.Status == "warning" { + return false + } + } + return m.Type == "http" || m.Condition == nil || !calendarConditions[m.Condition.Code] } // monitorCounts counts monitors by overall status. @@ -68,7 +99,11 @@ ok. the command exits 1 (code unhealthy, the report in the error's details) while a critical incident is open, with --fail-on warning while any incident is open. The report is printed either way. The default, none, -always exits 0.`, +always exits 0. + +An incident a maintenance window holds doesn't count towards the verdict or +--fail-on, and its monitor moves from "problems" to "maintenance". A certificate +or domain running out isn't held: it stays in "problems" and still counts.`, Example: ` norcube monitor status # Gate a deploy on Norcube Monitor norcube monitor status --fail-on critical @@ -113,7 +148,7 @@ func buildStatus(ctx context.Context, c *monitorContext) (statusReport, error) { if err != nil { return statusReport{}, err } - r := statusReport{Status: "ok", Incidents: summary, Problems: []problemMonitor{}} + r := statusReport{Status: "ok", Incidents: summary, Problems: []problemMonitor{}, Maintenance: []heldMonitor{}} switch { case summary.Open.Critical > 0: r.Status = "critical" @@ -151,7 +186,11 @@ func buildStatus(ctx context.Context, c *monitorContext) (statusReport, error) { if m.Condition != nil { pm.Condition, pm.Message = m.Condition.Code, cmdutil.Deref(m.Condition.Message) } - r.Problems = append(r.Problems, pm) + if heldProblem(m) { + r.Maintenance = append(r.Maintenance, heldMonitor{pm, *m.Maintenance}) + } else { + r.Problems = append(r.Problems, pm) + } } } next := nextCursor(res.JSON200.Cursors) @@ -172,22 +211,28 @@ func statusObject(r statusReport) output.Object { // fixed columns. lines := make([]string, 0, len(r.Problems)) for _, p := range r.Problems { - word := statusWord(p.Type, p.Status, p.Condition) - if p.Status != p.OverallStatus { - // The monitor itself is fine; a certificate or domain it - // watches isn't. - word = capitalize(p.OverallStatus) - } - line := word + ": " + p.Name + " (" + p.Target + ")" - if p.Message != "" { - line += ", " + p.Message - } - lines = append(lines, line) + lines = append(lines, p.line()) } - problems := "none" - if len(lines) > 0 { - problems = strings.Join(lines, "\n") + held := make([]string, 0, len(r.Maintenance)) + for _, h := range r.Maintenance { + held = append(held, h.line()+", "+heldBy(h.Maintenance)) } - f = append(f, output.Field{Name: "Problems", Value: problems}) + f = append(f, output.Field{Name: "Problems", Value: orNone(lines)}, + output.Field{Name: "Incidents in maintenance", Value: strconv.Itoa(r.Incidents.Open.InMaintenance)}, + output.Field{Name: "In maintenance", Value: orNone(held)}) return output.Object{Value: r, Fields: f} } + +func (p problemMonitor) line() string { + word := statusWord(p.Type, p.Status, p.Condition) + if p.Status != p.OverallStatus { + // The monitor itself is fine; a certificate or domain it + // watches isn't. + word = capitalize(p.OverallStatus) + } + line := word + ": " + p.Name + " (" + p.Target + ")" + if p.Message != "" { + line += ", " + p.Message + } + return line +} diff --git a/internal/cli/monitor_maintenance_test.go b/internal/cli/monitor_maintenance_test.go new file mode 100644 index 0000000..a1ef47b --- /dev/null +++ b/internal/cli/monitor_maintenance_test.go @@ -0,0 +1,505 @@ +package cli + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + "testing" + "time" + + "github.com/norcubeplatform/cli/internal/clierr" +) + +// Maintenance window fixtures: one in progress holding Shop and showing on the +// published page, one scheduled with no public effect. +const ( + mwDeploy = "4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a" + mwUpgrade = "5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b" +) + +var ( + mwDeployJSON = `{"id":"` + mwDeploy + `","state":"in_progress","title":"Deploy","description":"Short interruptions are expected.", + "startsAt":"2026-11-03T08:00:00Z","endsAt":"2026-11-03T08:15:00Z","finishedEarly":false, + "notifyScheduled":true,"notifyStarted":true,"notifyFinished":true, + "targets":{"monitorIds":["` + monShop + `"],"componentIds":[]}, + "statusPages":[{"id":"` + spAcme + `","name":"Acme status","published":true,"componentIds":["` + spSite + `"]}], + "createdBy":"` + monUser + `","createdByName":"Dev Owner","createdAt":"2026-11-03T08:00:00Z","updatedAt":"2026-11-03T08:00:00Z"}` + mwUpgradeJSON = `{"id":"` + mwUpgrade + `","state":"scheduled","title":"Database upgrade","description":"", + "startsAt":"2026-11-07T14:00:00Z","endsAt":"2026-11-07T16:00:00Z","finishedEarly":false, + "notifyScheduled":false,"notifyStarted":false,"notifyFinished":false, + "targets":{"monitorIds":["` + monCert + `"],"componentIds":["` + spDesk + `"]}, + "statusPages":[],"createdAt":"2026-11-03T09:00:00Z","updatedAt":"2026-11-03T09:00:00Z"}` + mwTargetsJSON = `{"monitors":[],"statusPages":[],"components":[ + {"id":"` + spDesk + `","name":"Support desk","statusPageId":"` + spAcme + `"}, + {"id":"` + spSite + `","name":"Twin","statusPageId":"` + spAcme + `"}, + {"id":"` + spGroup + `","name":"Twin","statusPageId":"` + spDraft + `"}]}` + mwHold = `"maintenance":{"windowId":"` + mwDeploy + `","title":"Deploy","startsAt":"2026-11-03T08:00:00Z","endsAt":"2026-11-03T08:15:00Z"}` +) + +func init() { + goldenData["GET /maintenance-windows"] = monList(mwDeployJSON, mwUpgradeJSON) + goldenData["GET /maintenance-windows/"+mwDeploy] = mwDeployJSON + goldenData["GET /maintenance-windows/"+mwUpgrade] = mwUpgradeJSON + goldenData["GET /maintenance-windows/targets"] = mwTargetsJSON +} + +// held adds a maintenance hold to a monitor's JSON. +func held(monitorJSON string) string { + return strings.Replace(monitorJSON, `{"id"`, `{`+mwHold+`,"id"`, 1) +} + +// The deploy pattern: stdout of create -o id is the id and nothing else, +// finish needs neither a terminal nor --yes. +func TestMaintenanceDeployPattern(t *testing.T) { + goldenEnv(t) + var create, finish recorder + goldenHandlers(t, map[string]http.HandlerFunc{ + "POST /maintenance-windows": create.handler(201, mwDeployJSON), + "POST /maintenance-windows/" + mwDeploy + "/finish": finish.handler(200, mwDeployJSON), + }) + before := time.Now().UTC().Add(-time.Second) + out, _, err := run(t, "monitor", "maintenance", "create", "--monitor", "Shop", "--title", " Deploy ", "--duration", "15m", "-o", "id") + if err != nil { + t.Fatal(err) + } + if out != mwDeploy+"\n" { + t.Fatalf("stdout %q, want only the id", out) + } + b := create.only(t).body + if b["title"] != "Deploy" || b["notifyScheduled"] != true || b["notifyStarted"] != true || b["notifyFinished"] != true { + t.Errorf("body %v", b) + } + if _, ok := b["description"]; ok { + t.Errorf("description sent without the flag: %v", b) + } + targets := b["targets"].(map[string]any) + if ids := targets["monitorIds"].([]any); len(ids) != 1 || ids[0] != monShop { + t.Errorf("targets %v", targets) + } + if len(targets) != 1 { + t.Errorf("lists nobody named were sent: %v", targets) + } + start, err := time.Parse(time.RFC3339, b["startsAt"].(string)) + if err != nil || start.Before(before.Truncate(time.Second)) || start.After(time.Now()) { + t.Errorf("startsAt %v, %v: want now", b["startsAt"], err) + } + end, err := time.Parse(time.RFC3339, b["endsAt"].(string)) + if err != nil || end.Sub(start) != 15*time.Minute { + t.Errorf("endsAt %v, %v: want 15 minutes after the start", b["endsAt"], err) + } + + if _, _, err := run(t, "monitor", "maintenance", "finish", strings.TrimSpace(out)); err != nil { + t.Fatal(err) + } + if r := finish.only(t); r.method != http.MethodPost || r.path != "/maintenance-windows/"+mwDeploy+"/finish" { + t.Errorf("finish sent %+v", r) + } +} + +func TestMaintenanceCreateTargetsAndMail(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{"POST /maintenance-windows": rec.handler(201, mwUpgradeJSON)}) + out, _, err := run(t, "monitor", "maintenance", "create", "--title", "Database upgrade", "--description", "Public words", + "--monitor", monCert, "--monitor", "Shop", "--component", "Support desk", "--component", spSite, "--status-page", "acme", + "--start", "2026-11-07T14:00:00+01:00", "--end", "2026-11-07T16:00:00Z", "--notify-started=false") + if err != nil { + t.Fatal(err) + } + if !strings.Contains(out, "Scheduled maintenance") || !strings.Contains(out, "no published status page") { + t.Errorf("message %q", out) + } + b := rec.only(t).body + if b["startsAt"] != "2026-11-07T13:00:00Z" || b["endsAt"] != "2026-11-07T16:00:00Z" || b["description"] != "Public words" { + t.Errorf("body %v", b) + } + if b["notifyScheduled"] != true || b["notifyStarted"] != false || b["notifyFinished"] != true { + t.Errorf("mail switches %v", b) + } + targets := b["targets"].(map[string]any) + if got := targets["monitorIds"].([]any); len(got) != 2 || got[0] != monCert || got[1] != monShop { + t.Errorf("monitors %v", got) + } + if got := targets["componentIds"].([]any); len(got) != 2 || got[0] != spDesk || got[1] != spSite { + t.Errorf("components %v", got) + } + if got := targets["statusPageIds"].([]any); len(got) != 1 || got[0] != spAcme { + t.Errorf("pages %v", got) + } +} + +func TestMaintenanceCreateNoNotifyAndDurationFromStart(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{"POST /maintenance-windows": rec.handler(201, mwDeployJSON)}) + out, _, err := run(t, "monitor", "maintenance", "create", "--title", "Load test", "--monitor", monShop, "--start", "2026-11-07T14:00:00Z", "--duration", "2d", "--no-notify") + if err != nil { + t.Fatal(err) + } + b := rec.only(t).body + if b["notifyScheduled"] != false || b["notifyStarted"] != false || b["notifyFinished"] != false || b["endsAt"] != "2026-11-09T14:00:00Z" { + t.Errorf("body %v", b) + } + // The result names the published page it shows on, whatever was asked. + if !strings.Contains(out, "publicly on Acme status") { + t.Errorf("message %q", out) + } +} + +func TestMaintenanceComponentNames(t *testing.T) { + goldenEnv(t) + base := []string{"monitor", "maintenance", "create", "--title", "x", "--duration", "1h"} + _, _, err := run(t, append(base, "--component", "Twin")...) + if !clierr.IsUsage(err) || !strings.Contains(err.Error(), "2 components") { + t.Errorf("ambiguous name: %v", err) + } + _, _, err = run(t, append(base, "--component", "Nothing")...) + if exitOf(err) != clierr.ExitNotFound { + t.Errorf("unknown name: %v", err) + } +} + +func TestMaintenanceUsageErrorsBeforeAnyRequest(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{ + "POST /maintenance-windows": rec.handler(201, mwDeployJSON), + "PATCH /maintenance-windows/" + mwDeploy: rec.handler(200, mwDeployJSON), + "GET /maintenance-windows": rec.handler(200, monList()), + }) + create := []string{"monitor", "maintenance", "create"} + full := append(append([]string{}, create...), "--title", "x", "--monitor", monShop) + update := []string{"monitor", "maintenance", "update", mwDeploy} + for _, args := range [][]string{ + append(append([]string{}, create...), "--monitor", monShop, "--duration", "1h"), // no title + append(append([]string{}, create...), "--title", " ", "--monitor", monShop, "--duration", "1h"), // blank title + append(append([]string{}, create...), "--title", "x", "--duration", "1h"), // no target + full, // neither end nor duration + append(append([]string{}, full...), "--end", "+1h", "--duration", "1h"), // both + append(append([]string{}, full...), "--duration", "soon"), // bad length + append(append([]string{}, full...), "--duration", "0m"), // no length + append(append([]string{}, full...), "--duration", "1h", "--start", "2h"), // bare span + append(append([]string{}, full...), "--end", "2h"), // bare span + append(append([]string{}, full...), "--duration", "1h", "--no-notify", "--notify-started"), // both + update, // nothing to change + append(append([]string{}, update...), "--title", " "), + append(append([]string{}, update...), "--end", "2h"), + {"monitor", "maintenance", "update", "not-an-id", "--title", "x"}, + {"monitor", "maintenance", "get", "not-an-id"}, + {"monitor", "maintenance", "cancel", "not-an-id", "--yes"}, + {"monitor", "maintenance", "finish", "not-an-id"}, + {"monitor", "maintenance", "list", "--state", "upcoming"}, + } { + if _, _, err := run(t, args...); exitOf(err) != clierr.ExitUsage { + t.Errorf("%v: %v (exit %d), want exit %d", args, err, exitOf(err), clierr.ExitUsage) + } + } + if n := rec.count(); n != 0 { + t.Errorf("%d requests", n) + } + // The hint shows the spelling that works. + _, _, err := run(t, append(append([]string{}, full...), "--duration", "1h", "--start", "2h")...) + if err == nil || !strings.Contains(err.Error(), "+2h") { + t.Errorf("no hint: %v", err) + } +} + +// update sends the flags that were given and nothing else. +func TestMaintenanceUpdateSendsOnlyWhatChanged(t *testing.T) { + goldenEnv(t) + id := mwDeploy + for _, c := range []struct { + args []string + want map[string]any + }{ + {[]string{"--title", "New"}, map[string]any{"title": "New"}}, + {[]string{"--description", ""}, map[string]any{"description": ""}}, + {[]string{"--end", "2026-11-07T16:00:00Z"}, map[string]any{"endsAt": "2026-11-07T16:00:00Z"}}, + {[]string{"--start", "2026-11-07T14:00:00Z"}, map[string]any{"startsAt": "2026-11-07T14:00:00Z"}}, + {[]string{"--notify-started=false"}, map[string]any{"notifyStarted": false}}, + {[]string{"--notify-finished"}, map[string]any{"notifyFinished": true}}, + {[]string{"--no-notify"}, map[string]any{"notifyScheduled": false, "notifyStarted": false, "notifyFinished": false}}, + {[]string{"--start", "2026-11-07T14:00:00Z", "--duration", "2h"}, map[string]any{"startsAt": "2026-11-07T14:00:00Z", "endsAt": "2026-11-07T16:00:00Z"}}, + // From the window's current start. + {[]string{"--duration", "1h"}, map[string]any{"endsAt": "2026-11-03T09:00:00Z"}}, + } { + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{"PATCH /maintenance-windows/" + id: rec.handler(200, mwDeployJSON)}) + if _, _, err := run(t, append([]string{"monitor", "maintenance", "update", id}, c.args...)...); err != nil { + t.Fatalf("%v: %v", c.args, err) + } + b := rec.only(t).body + if len(b) != len(c.want) { + t.Errorf("%v: sent %v, want %v", c.args, b, c.want) + } + for k, v := range c.want { + if b[k] != v { + t.Errorf("%v: %s = %v, want %v", c.args, k, b[k], v) + } + } + } + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{"PATCH /maintenance-windows/" + id: rec.handler(200, mwDeployJSON)}) + if _, _, err := run(t, "monitor", "maintenance", "update", id, "--monitor", "Shop"); err != nil { + t.Fatal(err) + } + targets := rec.only(t).body["targets"].(map[string]any) + if got := targets["monitorIds"].([]any); len(targets) != 1 || got[0] != monShop { + t.Errorf("targets %v", targets) + } +} + +const mwConflict = `{"title":"Conflict","status":409,"detail":"%s","code":"CONFLICT","reason":"MAINTENANCE_WINDOW_STATE","data":{"state":"%s"}}` + +func conflict(detail, state string) string { return fmt.Sprintf(mwConflict, detail, state) } + +// A refusal keeps the API's sentence, exits 8 and names the other verb. +func TestMaintenanceConflicts(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{ + "POST /maintenance-windows/" + mwDeploy + "/cancel": rec.handler(409, conflict("This window has already started: use finish to end it.", "in_progress")), + "POST /maintenance-windows/" + mwUpgrade + "/finish": rec.handler(409, conflict("This window hasn't started: cancel it instead.", "scheduled")), + "PATCH /maintenance-windows/" + mwDeploy: rec.handler(409, conflict("This window has started, so its targets are frozen.", "in_progress")), + }) + for _, c := range []struct { + args []string + message, hintWant string + }{ + {[]string{"cancel", mwDeploy, "--yes"}, "use finish", "maintenance finish " + mwDeploy}, + {[]string{"finish", mwUpgrade}, "cancel it instead", "maintenance cancel " + mwUpgrade}, + {[]string{"update", mwDeploy, "--monitor", monShop}, "targets are frozen", ""}, + } { + _, _, err := run(t, append([]string{"monitor", "maintenance"}, c.args...)...) + e := Describe(err) + if e.Code != clierr.CodeConflict || e.ExitCode() != clierr.ExitConflict || !strings.Contains(e.Message, c.message) || !strings.Contains(e.Hint, c.hintWant) { + t.Errorf("%v: %+v", c.args, e) + } + } +} + +func TestMaintenanceCancelConfirms(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{"POST /maintenance-windows/" + mwUpgrade + "/cancel": rec.handler(200, mwUpgradeJSON)}) + _, _, err := run(t, "monitor", "maintenance", "cancel", mwUpgrade) + if !clierr.IsUsage(err) || !strings.Contains(err.Error(), "--yes") { + t.Fatalf("no terminal, no --yes: %v", err) + } + if rec.count() != 0 { + t.Fatal("cancelled without confirmation") + } + out, _, err := run(t, "monitor", "maintenance", "cancel", mwUpgrade, "--yes", "-o", "text") + if err != nil { + t.Fatal(err) + } + if out != mwUpgrade+"\tscheduled\n" { + t.Errorf("text %q", out) + } + if r := rec.only(t); r.method != http.MethodPost { + t.Errorf("%+v", r) + } +} + +// A refused publish names the page, exits 5 and says what would allow it. +func TestMaintenancePublishDenied(t *testing.T) { + goldenEnv(t) + var rec recorder + denied := `{"title":"Forbidden","status":403,"detail":"This window would show publicly on Acme status, and you can't publish there. Showing it needs permission to publish maintenance on that page; a scoped token also needs the monitor.statuspages scope.","code":"FORBIDDEN","reason":"MAINTENANCE_PUBLISH_DENIED","data":{"statusPageIds":"` + spAcme + `"}}` + goldenHandlers(t, map[string]http.HandlerFunc{"POST /maintenance-windows": rec.handler(403, denied)}) + _, _, err := run(t, "monitor", "maintenance", "create", "--title", "x", "--monitor", monShop, "--duration", "1h") + e := Describe(err) + if e.ExitCode() != clierr.ExitAccess || !strings.Contains(e.Message, "Acme status") || !strings.Contains(e.Hint, "monitor.statuspages") { + t.Errorf("%+v", e) + } +} + +func TestMaintenanceScopeRefusal(t *testing.T) { + goldenEnv(t) + var rec recorder + scope := `{"title":"Forbidden","status":403,"detail":"This token's scopes don't allow this.","code":"FORBIDDEN","reason":"INSUFFICIENT_SCOPE"}` + goldenHandlers(t, map[string]http.HandlerFunc{"POST /maintenance-windows/" + mwDeploy + "/finish": rec.handler(403, scope)}) + _, _, err := run(t, "monitor", "maintenance", "finish", mwDeploy) + e := Describe(err) + if e.Code != clierr.CodeInsufficientScope || e.ExitCode() != clierr.ExitAccess || !strings.Contains(e.Hint, "monitor.maintenance") { + t.Errorf("%+v", e) + } +} + +func TestMaintenanceListFilters(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{"GET /maintenance-windows": rec.handler(200, monList(mwUpgradeJSON))}) + if _, _, err := run(t, "monitor", "maintenance", "list", "--state", "in_progress", "--monitor", "Shop", "--status-page", "acme", "--limit", "5"); err != nil { + t.Fatal(err) + } + q := rec.only(t).query + for _, want := range []string{"status=in_progress", "monitorId=" + monShop, "statusPageId=" + spAcme, "limit=5"} { + if !strings.Contains(q, want) { + t.Errorf("query %q lacks %s", q, want) + } + } +} + +func TestMaintenanceListIDs(t *testing.T) { + goldenEnv(t) + out, _, err := run(t, "monitor", "maintenance", "list", "-o", "id") + if err != nil || out != mwDeploy+"\n"+mwUpgrade+"\n" { + t.Errorf("%q, %v", out, err) + } + // Something without an id is a usage error, not an empty line. + if _, _, err := run(t, "monitor", "incidents", "summary", "-o", "id"); !clierr.IsUsage(err) { + t.Errorf("no id: %v", err) + } +} + +func TestMaintenanceCompletion(t *testing.T) { + goldenEnv(t) + clearCompletionCache(t) + for _, c := range []struct { + args []string + want string + }{ + {[]string{"monitor", "maintenance", "finish", "4d"}, mwDeploy}, + {[]string{"monitor", "maintenance", "get", "5e"}, mwUpgrade}, + {[]string{"monitor", "maintenance", "list", "--state", ""}, "scheduled,in_progress,completed,cancelled"}, + {[]string{"monitor", "maintenance", "create", "--monitor", "2b"}, monCert}, + {[]string{"monitor", "maintenance", "create", "--status-page", "ac"}, "acme"}, + } { + got, _ := complete(t, c.args...) + if strings.Join(got, ",") != c.want { + t.Errorf("%v: %v, want %s", c.args, got, c.want) + } + } +} + +// The help carries the deploy pattern and the scopes. +func TestMaintenanceHelp(t *testing.T) { + goldenEnv(t) + out, _, err := run(t, "monitor", "maintenance", "--help") + if err != nil { + t.Fatal(err) + } + for _, want := range []string{"-o id)", `maintenance finish "$id"`, "monitor.maintenance", "monitor.statuspages"} { + if !strings.Contains(out, want) { + t.Errorf("help lacks %q", want) + } + } +} + +// A window held problem doesn't fail --fail-on: the API leaves it out of the +// open counts, and the report moves its monitor to the maintenance list. +func TestMonitorStatusInMaintenance(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{ + "GET /incidents/summary": rec.handler(200, `{"open":{"total":0,"critical":0,"warning":0,"unacknowledged":0,"inMaintenance":1},"resolvedLast7d":0,"resolvedLast30d":0}`), + "GET /monitors": rec.handler(200, monList(held(monShopJSON), monDomainJSON)), + }) + out, _, err := run(t, "monitor", "status", "--fail-on", "warning", "-o", "json") + if err != nil { + t.Fatalf("held incident failed the gate: %v", err) + } + var r struct { + Status string `json:"status"` + Problems []map[string]any `json:"problems"` + Maintenance []map[string]any `json:"maintenance"` + Incidents struct{ Open map[string]int } `json:"incidents"` + } + if err := json.Unmarshal([]byte(out), &r); err != nil { + t.Fatal(err) + } + if r.Status != "ok" || len(r.Problems) != 0 || len(r.Maintenance) != 1 || r.Incidents.Open["inMaintenance"] != 1 { + t.Fatalf("%s", out) + } + if r.Maintenance[0]["name"] != "Shop" || r.Maintenance[0]["maintenance"].(map[string]any)["windowId"] != mwDeploy { + t.Errorf("%v", r.Maintenance[0]) + } + table, _, err := run(t, "monitor", "status", "--no-pager") + if err != nil || !strings.Contains(table, `"Deploy" until`) || !strings.Contains(table, "Incidents in maintenance:") { + t.Errorf("%v\n%s", err, table) + } +} + +// What the calendar says stays a problem during a window: an expiring +// certificate on an SSL monitor, and a watched aspect on an HTTP one. +func TestMonitorStatusCalendarProblemsStayLive(t *testing.T) { + goldenEnv(t) + aspect := strings.Replace(monShopJSON, `"aspect":"certificate","subject":"shop.example.com","status":"ok"`, `"aspect":"certificate","subject":"shop.example.com","status":"warning"`, 1) + if aspect == monShopJSON { + t.Fatal("fixture changed") + } + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{ + "GET /incidents/summary": rec.handler(200, `{"open":{"total":2,"critical":1,"warning":1,"unacknowledged":2,"inMaintenance":0},"resolvedLast7d":0,"resolvedLast30d":0}`), + "GET /monitors": rec.handler(200, monList(held(aspect), held(monCertJSON))), + }) + out, _, err := run(t, "monitor", "status", "-o", "json") + if err != nil { + t.Fatal(err) + } + var r struct { + Problems []map[string]any `json:"problems"` + Maintenance []map[string]any `json:"maintenance"` + } + if err := json.Unmarshal([]byte(out), &r); err != nil { + t.Fatal(err) + } + if len(r.Problems) != 2 || len(r.Maintenance) != 0 { + t.Errorf("%s", out) + } +} + +// monitors run --wait still fails on critical in a window; the result says so. +func TestMonitorRunInMaintenance(t *testing.T) { + goldenEnv(t) + result := func(severity string) string { + return `{"id":9003,"checkedAt":"2026-11-03T08:10:00Z","severity":"` + severity + `","condition":"unexpected_status","region":"eu-central-1","timings":{"dnsMs":1,"connectMs":1,"tlsMs":1,"ttfbMs":1,"totalMs":4}}` + } + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{ + "GET /monitors/" + monShop: rec.handler(200, held(monShopJSON)), + "POST /monitors/" + monShop + "/check": rec.handler(200, result("critical")), + }) + _, _, err := run(t, "monitor", "monitors", "run", monShop, "--wait", "--fail-on", "critical", "-o", "json") + e := Describe(err) + if e.Code != clierr.CodeJobFailed || !strings.Contains(e.Message, "maintenance") { + t.Fatalf("%+v", e) + } + goldenHandlers(t, map[string]http.HandlerFunc{ + "GET /monitors/" + monShop: rec.handler(200, held(monShopJSON)), + "POST /monitors/" + monShop + "/check": rec.handler(200, result("ok")), + }) + out, _, err := run(t, "monitor", "monitors", "run", monShop, "--wait", "-o", "json") + if err != nil || !strings.Contains(out, `"inMaintenance": true`) || !strings.Contains(out, `"severity": "ok"`) { + t.Errorf("%v\n%s", err, out) + } + out, _, err = run(t, "monitor", "monitors", "run", monShop, "-o", "text") + if err != nil || !strings.HasSuffix(strings.TrimSpace(out), "yes") { + t.Errorf("%v\n%q", err, out) + } + out, _, err = run(t, "monitor", "monitors", "run", monShop, "--no-pager") + if err != nil || !strings.Contains(out, "In maintenance:") { + t.Errorf("%v\n%s", err, out) + } +} + +// Monitor lists show the end of the window holding a monitor, at the end of +// the row, so -o text keeps its earlier columns. +func TestMonitorListShowsMaintenance(t *testing.T) { + goldenEnv(t) + var rec recorder + goldenHandlers(t, map[string]http.HandlerFunc{ + "GET /monitors": rec.handler(200, monList(held(monShopJSON))), + "GET /monitors/" + monShop: rec.handler(200, held(monShopJSON)), + }) + out, _, err := run(t, "monitor", "monitors", "list", "-o", "text") + if err != nil || !strings.HasSuffix(strings.TrimSpace(out), "\t2026-11-03T08:15:00Z") { + t.Errorf("%v\n%q", err, out) + } + out, _, err = run(t, "monitor", "monitors", "get", monShop, "--no-pager") + if err != nil || !strings.Contains(out, `In maintenance:`) || !strings.Contains(out, mwDeploy) { + t.Errorf("%v\n%s", err, out) + } +} diff --git a/internal/cli/monitor_test.go b/internal/cli/monitor_test.go index 807ff6a..e9f4093 100644 --- a/internal/cli/monitor_test.go +++ b/internal/cli/monitor_test.go @@ -168,6 +168,8 @@ func TestGoldenMonitor(t *testing.T) { {"monitor-status-pages-incidents-list", []string{"monitor", "status-pages", "incidents", "list", spAcme}}, {"monitor-status-pages-incidents-get", []string{"monitor", "status-pages", "incidents", "get", spAcme, spPost}}, {"monitor-status-pages-subscribers-list", []string{"monitor", "status-pages", "subscribers", "list", "acme"}}, + {"monitor-maintenance-list", []string{"monitor", "maintenance", "list"}}, + {"monitor-maintenance-get", []string{"monitor", "maintenance", "get", mwDeploy}}, } for _, c := range commands { for format, ext := range goldenFormats { diff --git a/internal/cli/testdata/golden/commands-monitor.json b/internal/cli/testdata/golden/commands-monitor.json index 32a614e..4fcee6b 100644 --- a/internal/cli/testdata/golden/commands-monitor.json +++ b/internal/cli/testdata/golden/commands-monitor.json @@ -5,7 +5,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "globalFlags": [ { @@ -82,14 +83,15 @@ "shorthand": "o", "type": "string", "default": "table", - "description": "Output format: table | json | yaml | text (env: NORCUBE_OUTPUT)", + "description": "Output format: table | json | yaml | text | id (env: NORCUBE_OUTPUT)", "required": false, "repeatable": false, "enum": [ "table", "json", "yaml", - "text" + "text", + "id" ] }, { @@ -129,7 +131,7 @@ ], "name": "monitor", "short": "Monitor uptime, SSL certificates and domain expiry, and manage incidents and alerts", - "long": "Norcube Monitor checks your sites, certificates and domains on a schedule\nfrom Norcube's servers. A monitor is an HTTP check (optionally with a\nkeyword), an SSL certificate check or a domain expiry check. Problems\nconfirmed by consecutive checks open incidents, which alert through your\nalert channels (email, webhook, Slack, Discord, SMS). Status pages show\nchosen monitors to the public.\n\nMonitors and channels are named by their id or, where a command says so,\nby their exact name. Checks count towards your Norcube Monitor usage, on a\nschedule and when you run one now.\n\nIn CI, \"monitor status --fail-on critical\" fails the job while a\ncritical incident is open, and \"monitor monitors run \u003cmonitor\u003e --wait\"\nfails it when the check finds the monitor down. CI tokens need a\nNorcube Monitor scope: monitor.read (everything that reads),\nmonitor.check (run checks), monitor.write (manage monitors and\nincidents), monitor.channels (manage alert channels) or\nmonitor.statuspages (manage status pages, post on them and manage their\nsubscribers). monitor.write includes neither of the last two.", + "long": "Norcube Monitor checks your sites, certificates and domains on a schedule\nfrom Norcube's servers. A monitor is an HTTP check (optionally with a\nkeyword), an SSL certificate check or a domain expiry check. Problems\nconfirmed by consecutive checks open incidents, which alert through your\nalert channels (email, webhook, Slack, Discord, SMS). Status pages show\nchosen monitors to the public. Maintenance windows pause alerts for planned\nwork and keep it out of uptime.\n\nMonitors and channels are named by their id or, where a command says so,\nby their exact name. Checks count towards your Norcube Monitor usage, on a\nschedule and when you run one now.\n\nIn CI, \"monitor status --fail-on critical\" fails the job while a\ncritical incident is open, and \"monitor monitors run \u003cmonitor\u003e --wait\"\nfails it when the check finds the monitor down. CI tokens need a\nNorcube Monitor scope: monitor.read (everything that reads),\nmonitor.check (run checks), monitor.write (manage monitors and\nincidents), monitor.channels (manage alert channels),\nmonitor.statuspages (manage status pages, post on them and manage their\nsubscribers) or monitor.maintenance (manage maintenance windows; one that\nshows on a published page also takes monitor.statuspages). monitor.write\nincludes none of the last three.", "usage": "norcube monitor \u003ccommand\u003e", "group": true, "service": { @@ -194,7 +196,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -298,7 +301,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -360,7 +364,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -442,7 +447,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -471,7 +477,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -542,7 +549,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -582,7 +590,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -703,7 +712,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -777,7 +787,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -808,7 +819,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -838,7 +850,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -986,10 +999,478 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, + { + "command": "norcube monitor maintenance", + "path": [ + "monitor", + "maintenance" + ], + "name": "maintenance", + "aliases": [ + "maintenance-windows" + ], + "short": "Schedule maintenance windows that pause alerts and stay out of uptime", + "long": "A maintenance window is planned work on monitors or status page components.\nWhile it runs, its monitors don't alert or open incidents for availability\nproblems, and the time stays out of their uptime. Checks keep running and\ncount towards your usage. A certificate or domain running out still alerts,\nbecause that is true whatever work is going on.\n\nA window shows by itself on every published status page displaying one of its\ntargets, and subscribers get mail when it is scheduled, starts and finishes\nunless you turn that off. Which pages show it isn't a choice: otherwise a page\ncould stay green while its alerts are silent.\n\nA CI token changes windows with the monitor.maintenance scope, and also needs\nmonitor.statuspages when a window shows on a published page. Cancelling or\nfinishing needs only monitor.maintenance, so whoever can edit a window can\nalways end its silence. Any Norcube Monitor scope reads them.\n\nA window ends by itself, so a deploy that dies before \"finish\" can't silence\nalerts for longer than you asked for. Wrap a deploy in one:\n\n id=$(norcube monitor maintenance create --monitor api --title \"Deploy\" --duration 15m -o id)\n ./deploy.sh\n norcube monitor maintenance finish \"$id\"", + "usage": "norcube monitor maintenance \u003ccommand\u003e", + "group": true, + "service": { + "key": "monitor", + "name": "Monitor", + "audience": "monitor" + }, + "confirm": false, + "wait": false, + "paginated": false, + "flags": [] + }, + { + "command": "norcube monitor maintenance cancel", + "path": [ + "monitor", + "maintenance", + "cancel" + ], + "name": "cancel", + "short": "Call off a maintenance window that hasn't started", + "long": "Calls off a scheduled window. It won't run, and subscribers who were told hear\nit was cancelled. One that has started exits 8: use \"finish\" instead. It needs\nonly the monitor.maintenance scope, even on a published page.", + "usage": "norcube monitor maintenance cancel \u003cwindow\u003e [flags]", + "args": "\u003cwindow\u003e", + "example": "norcube monitor maintenance cancel 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a\nnorcube monitor maintenance cancel 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --yes", + "group": false, + "service": { + "key": "monitor", + "name": "Monitor", + "audience": "monitor" + }, + "effect": "write", + "confirm": true, + "wait": false, + "paginated": false, + "outputFormats": [ + "table", + "json", + "yaml", + "text", + "id" + ], + "flags": [ + { + "name": "yes", + "type": "bool", + "default": "false", + "description": "Don't ask for confirmation", + "required": false, + "repeatable": false + } + ] + }, + { + "command": "norcube monitor maintenance create", + "path": [ + "monitor", + "maintenance", + "create" + ], + "name": "create", + "short": "Schedule a maintenance window, or start one now", + "long": "Schedules a window. Without --start it begins right away. It needs a title,\nat least one target, and --end or --duration; it can last at most 30 days and\nstart at most a year ahead.\n\nIt shows by itself on every published status page displaying a target, and\nsubscribers get all three mails unless you turn them off with --notify-scheduled,\n--notify-started, --notify-finished or --no-notify. A window that starts within\n15 minutes sends no scheduled mail, only the started one.\n\nA CI token needs the monitor.maintenance scope, and monitor.statuspages too when\nthe window shows on a published page.", + "usage": "norcube monitor maintenance create [flags]", + "example": "# Silence a monitor around a deploy\nid=$(norcube monitor maintenance create --monitor api --title \"Deploy\" --duration 15m -o id)\n./deploy.sh\nnorcube monitor maintenance finish \"$id\"\n\n# Announce work for tomorrow on everything a status page shows\nnorcube monitor maintenance create --status-page acme --title \"Database upgrade\" --description \"Short interruptions are expected.\" --start 2026-11-07T14:00:00Z --end 2026-11-07T16:00:00Z\n\n# A quiet window nobody hears about\nnorcube monitor maintenance create --monitor \"Shop API\" --monitor \"Shop cert\" --title \"Load test\" --start +1h --duration 2h --no-notify", + "group": false, + "service": { + "key": "monitor", + "name": "Monitor", + "audience": "monitor" + }, + "effect": "write", + "confirm": false, + "wait": false, + "paginated": false, + "outputFormats": [ + "table", + "json", + "yaml", + "text", + "id" + ], + "flags": [ + { + "name": "component", + "type": "stringArray", + "description": "A manual status page component to mark, by id or exact name (repeatable)", + "required": false, + "repeatable": true + }, + { + "name": "description", + "type": "string", + "description": "What is happening; public on a published status page and in mail", + "required": false, + "repeatable": false + }, + { + "name": "duration", + "type": "string", + "description": "How long it lasts, counted from its start: 15m, 2h, 7d (at most 30 days)", + "required": false, + "repeatable": false + }, + { + "name": "end", + "type": "string", + "description": "When it ends: an RFC 3339 timestamp, now, or a span from now (+2h, +7d)", + "required": false, + "repeatable": false + }, + { + "name": "monitor", + "type": "stringArray", + "description": "A monitor to hold, by id or exact name (repeatable); domain monitors can't be held", + "required": false, + "repeatable": true + }, + { + "name": "no-notify", + "type": "bool", + "default": "false", + "description": "Turn off all three mails; a cancellation still tells whoever was told", + "required": false, + "repeatable": false + }, + { + "name": "notify-finished", + "type": "bool", + "default": "true", + "description": "Email subscribers when it finishes", + "required": false, + "repeatable": false + }, + { + "name": "notify-scheduled", + "type": "bool", + "default": "true", + "description": "Email subscribers when it is scheduled", + "required": false, + "repeatable": false + }, + { + "name": "notify-started", + "type": "bool", + "default": "true", + "description": "Email subscribers when it starts", + "required": false, + "repeatable": false + }, + { + "name": "start", + "type": "string", + "description": "When it starts, if not now: an RFC 3339 timestamp, now, or a span from now (+2h, +7d)", + "required": false, + "repeatable": false + }, + { + "name": "status-page", + "type": "stringArray", + "description": "Everything a status page shows right now, by id or exact slug (repeatable); something added to the page later isn't included", + "required": false, + "repeatable": true + }, + { + "name": "title", + "type": "string", + "description": "The window's title; public on a published status page", + "required": true, + "repeatable": false + } + ] + }, + { + "command": "norcube monitor maintenance finish", + "path": [ + "monitor", + "maintenance", + "finish" + ], + "name": "finish", + "short": "End a maintenance window in progress now", + "long": "Ends a window in progress. The next check counts and alerts as usual, monitors\nwith an open incident it held are checked again within a minute, and subscribers\nhear it finished early. One that hasn't started exits 8: use \"cancel\" instead.\n\nIt asks for no confirmation, because ending a silence is the safe direction and\nit has to run unattended at the end of a deploy. It needs only the\nmonitor.maintenance scope, even on a published page.", + "usage": "norcube monitor maintenance finish \u003cwindow\u003e", + "args": "\u003cwindow\u003e", + "example": "norcube monitor maintenance finish 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a\nnorcube monitor maintenance finish \"$id\"", + "group": false, + "service": { + "key": "monitor", + "name": "Monitor", + "audience": "monitor" + }, + "effect": "write", + "confirm": false, + "wait": false, + "paginated": false, + "outputFormats": [ + "table", + "json", + "yaml", + "text", + "id" + ], + "flags": [] + }, + { + "command": "norcube monitor maintenance get", + "path": [ + "monitor", + "maintenance", + "get" + ], + "name": "get", + "short": "Show a maintenance window, its targets and the pages it shows on", + "usage": "norcube monitor maintenance get \u003cwindow\u003e", + "args": "\u003cwindow\u003e", + "example": "norcube monitor maintenance get 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a", + "group": false, + "service": { + "key": "monitor", + "name": "Monitor", + "audience": "monitor" + }, + "effect": "read", + "confirm": false, + "wait": false, + "paginated": false, + "outputFormats": [ + "table", + "json", + "yaml", + "text", + "id" + ], + "flags": [] + }, + { + "command": "norcube monitor maintenance list", + "path": [ + "monitor", + "maintenance", + "list" + ], + "name": "list", + "short": "List maintenance windows, latest start first", + "long": "Lists the organization's windows, latest start first; with --state scheduled, soonest first.", + "usage": "norcube monitor maintenance list [flags]", + "example": "norcube monitor maintenance list\nnorcube monitor maintenance list --state in_progress\nnorcube monitor maintenance list --monitor \"Shop API\" --all-pages\nnorcube monitor maintenance list --status-page acme --state scheduled -o json", + "group": false, + "service": { + "key": "monitor", + "name": "Monitor", + "audience": "monitor" + }, + "effect": "read", + "confirm": false, + "wait": false, + "paginated": true, + "outputFormats": [ + "table", + "json", + "yaml", + "text", + "id" + ], + "flags": [ + { + "name": "all-pages", + "type": "bool", + "default": "false", + "description": "Follow cursors until every page is fetched (capped by --max-items)", + "required": false, + "repeatable": false + }, + { + "name": "cursor", + "type": "string", + "description": "Continue from the cursor a previous page printed", + "required": false, + "repeatable": false + }, + { + "name": "limit", + "type": "int", + "default": "0", + "description": "Same as --page-size", + "required": false, + "repeatable": false + }, + { + "name": "max-items", + "type": "int", + "default": "0", + "description": "Cap for --all-pages (0 = 10000)", + "required": false, + "repeatable": false + }, + { + "name": "monitor", + "type": "string", + "description": "Only windows holding this monitor (id or exact name)", + "required": false, + "repeatable": false + }, + { + "name": "page-size", + "type": "int", + "default": "0", + "description": "Items per request (0 = 50)", + "required": false, + "repeatable": false + }, + { + "name": "state", + "type": "string", + "description": "Only windows in this state: scheduled, in_progress, completed or cancelled", + "required": false, + "repeatable": false, + "enum": [ + "scheduled", + "in_progress", + "completed", + "cancelled" + ] + }, + { + "name": "status-page", + "type": "string", + "description": "Only windows showing on this status page (id or exact slug)", + "required": false, + "repeatable": false + } + ] + }, + { + "command": "norcube monitor maintenance update", + "path": [ + "monitor", + "maintenance", + "update" + ], + "name": "update", + "short": "Change a maintenance window, as far as where it stands allows", + "long": "Changes only what you pass.\n\nBefore the window starts, everything can change; moving a time by 5 minutes or\nmore tells subscribers who were already told. Once it has started, its targets\nand start are frozen: you can still change the text and the mail switches, and\nextend or shorten it, which sends no mail. Once it is over, only the text can\nchange. A cancelled window can't change. The API refuses anything else with\nexit 8.\n\n--monitor, --component and --status-page replace the targets as a whole, so name\neverything the window should keep. --duration counts from the new --start, or\nelse from the window's current start.\n\nA CI token needs the monitor.maintenance scope, and monitor.statuspages too when\nthe window shows on a published page before or after the change. To end a window\nnow, use \"finish\"; to call off one that hasn't started, use \"cancel\".", + "usage": "norcube monitor maintenance update \u003cwindow\u003e [flags]", + "args": "\u003cwindow\u003e", + "example": "# The deploy needs longer\nnorcube monitor maintenance update 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --end +1h\nnorcube monitor maintenance update 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --start 2026-11-08T14:00:00Z --duration 2h\nnorcube monitor maintenance update 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a --title \"Database upgrade\" --no-notify", + "group": false, + "service": { + "key": "monitor", + "name": "Monitor", + "audience": "monitor" + }, + "effect": "write", + "confirm": false, + "wait": false, + "paginated": false, + "outputFormats": [ + "table", + "json", + "yaml", + "text", + "id" + ], + "flags": [ + { + "name": "component", + "type": "stringArray", + "description": "A manual status page component to mark, by id or exact name (repeatable)", + "required": false, + "repeatable": true + }, + { + "name": "description", + "type": "string", + "description": "What is happening; public on a published status page and in mail", + "required": false, + "repeatable": false + }, + { + "name": "duration", + "type": "string", + "description": "How long it lasts, counted from its start: 15m, 2h, 7d (at most 30 days)", + "required": false, + "repeatable": false + }, + { + "name": "end", + "type": "string", + "description": "When it ends: an RFC 3339 timestamp, now, or a span from now (+2h, +7d)", + "required": false, + "repeatable": false + }, + { + "name": "monitor", + "type": "stringArray", + "description": "A monitor to hold, by id or exact name (repeatable); domain monitors can't be held", + "required": false, + "repeatable": true + }, + { + "name": "no-notify", + "type": "bool", + "default": "false", + "description": "Turn off all three mails; a cancellation still tells whoever was told", + "required": false, + "repeatable": false + }, + { + "name": "notify-finished", + "type": "bool", + "default": "false", + "description": "Email subscribers when it finishes", + "required": false, + "repeatable": false + }, + { + "name": "notify-scheduled", + "type": "bool", + "default": "false", + "description": "Email subscribers when it is scheduled", + "required": false, + "repeatable": false + }, + { + "name": "notify-started", + "type": "bool", + "default": "false", + "description": "Email subscribers when it starts", + "required": false, + "repeatable": false + }, + { + "name": "start", + "type": "string", + "description": "Move its start, before it has started: an RFC 3339 timestamp or a span from now (+2h, +7d)", + "required": false, + "repeatable": false + }, + { + "name": "status-page", + "type": "stringArray", + "description": "Everything a status page shows right now, by id or exact slug (repeatable); something added to the page later isn't included", + "required": false, + "repeatable": true + }, + { + "name": "title", + "type": "string", + "description": "The window's title; public on a published status page", + "required": false, + "repeatable": false + } + ] + }, { "command": "norcube monitor monitors", "path": [ @@ -1063,7 +1544,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -1095,7 +1577,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -1203,7 +1686,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -1225,7 +1709,7 @@ ], "name": "bulk", "short": "Pause, resume or delete many monitors at once", - "long": "Applies one action to many monitors: the ones you name (ids or exact\nnames, as arguments or one per line with --file), or every monitor the\nlist filters match (--type, --status, --search). Each monitor is handled as\nits own request would be, so one refusal doesn't stop the others; the\nresult lists every monitor with ok or its problem code. The command exits\n1 when any monitor failed.", + "long": "Applies one action to many monitors: the ones you name (ids or exact\nnames, as arguments or one per line with --file), or every monitor the\nlist filters match (--type, --status, --search). Each monitor is handled as\nits own request would be, so one refusal doesn't stop the others; the\nresult lists every monitor with ok or its problem code. The command exits\n1 when any monitor failed.\n\nFor planned work, \"monitor maintenance create\" is usually better than\npausing: checks keep running, the time stays out of uptime, status pages say\nso, and it ends by itself.", "usage": "norcube monitor monitors bulk \u003ccommand\u003e", "group": true, "service": { @@ -1265,7 +1749,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -1331,7 +1816,7 @@ "short": "Pause many monitors", "usage": "norcube monitor monitors bulk pause [\u003cmonitor\u003e...] [flags]", "args": "[\u003cmonitor\u003e...]", - "example": "# Maintenance window: pause everything behind api.example.com\nnorcube monitor monitors bulk pause --search api.example.com --yes", + "example": "# Pause everything behind api.example.com; for planned work, see \"monitor maintenance\"\nnorcube monitor monitors bulk pause --search api.example.com --yes", "group": false, "service": { "key": "monitor", @@ -1346,7 +1831,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -1427,7 +1913,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -1533,7 +2020,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -1564,7 +2052,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -1821,7 +2310,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -1861,7 +2351,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -1891,7 +2382,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2017,7 +2509,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -2073,7 +2566,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2158,7 +2652,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -2171,7 +2666,7 @@ ], "name": "run", "short": "Run a monitor's check now and show the result", - "long": "Runs the monitor's check right away (paused monitors too) and prints the\nstored result. The check is billed like a scheduled one and rate limited\n(200 per user and 600 per organization an hour).\n\nThe check runs while the command waits, so the result is always final.\n--wait makes the result the command's outcome, for deploy pipelines: it\nexits 1 with code job_failed (the result in \"details\") when the check\nfound the monitor critical or couldn't reach a verdict (inconclusive), or\nwith --fail-on warning also when it found a warning, and prints nothing\non stdout then; it exits 7 when no result arrives within --wait-timeout. Without --wait the command exits 0\nwhatever the check found.", + "long": "Runs the monitor's check right away (paused monitors too) and prints the\nstored result. The check is billed like a scheduled one and rate limited\n(200 per user and 600 per organization an hour).\n\nThe check runs while the command waits, so the result is always final.\n--wait makes the result the command's outcome, for deploy pipelines: it\nexits 1 with code job_failed (the result in \"details\") when the check\nfound the monitor critical or couldn't reach a verdict (inconclusive), or\nwith --fail-on warning also when it found a warning, and prints nothing\non stdout then; it exits 7 when no result arrives within --wait-timeout. Without --wait the command exits 0\nwhatever the check found.\n\nA maintenance window doesn't change any of that: --wait still fails on a\ncritical result, because it is there to tell whether the deploy worked. The\nresult says inMaintenance when one held the monitor.", "usage": "norcube monitor monitors run \u003cmonitor\u003e [flags]", "args": "\u003cmonitor\u003e", "example": "norcube monitor monitors run \"Shop API\"\n# Fail a deploy when the site is down after it\nnorcube monitor monitors run \"Shop API\" --wait\nnorcube monitor monitors run 7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f --wait --fail-on warning -o json", @@ -2189,7 +2684,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2270,7 +2766,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2341,7 +2838,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2412,7 +2910,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2660,7 +3159,7 @@ ], "name": "status", "short": "Show the organization's monitoring status, or fail a CI job on open incidents", - "long": "Shows the open incidents by severity, the monitors by status, and every\nmonitor that is critical or warning. The verdict (\"status\" in JSON) comes\nfrom open incidents, which are problems the checks confirmed: critical\nwhile a critical incident is open, warning while only warnings are, else\nok.\n\n--fail-on turns the verdict into the exit code: with --fail-on critical\nthe command exits 1 (code unhealthy, the report in the error's details)\nwhile a critical incident is open, with --fail-on warning while any\nincident is open. The report is printed either way. The default, none,\nalways exits 0.", + "long": "Shows the open incidents by severity, the monitors by status, and every\nmonitor that is critical or warning. The verdict (\"status\" in JSON) comes\nfrom open incidents, which are problems the checks confirmed: critical\nwhile a critical incident is open, warning while only warnings are, else\nok.\n\n--fail-on turns the verdict into the exit code: with --fail-on critical\nthe command exits 1 (code unhealthy, the report in the error's details)\nwhile a critical incident is open, with --fail-on warning while any\nincident is open. The report is printed either way. The default, none,\nalways exits 0.\n\nAn incident a maintenance window holds doesn't count towards the verdict or\n--fail-on, and its monitor moves from \"problems\" to \"maintenance\". A certificate\nor domain running out isn't held: it stays in \"problems\" and still counts.", "usage": "norcube monitor status [flags]", "example": "norcube monitor status\n# Gate a deploy on Norcube Monitor\nnorcube monitor status --fail-on critical\nnorcube monitor status -o json --query problems[].name", "group": false, @@ -2677,7 +3176,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2746,7 +3246,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2860,7 +3361,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -2899,7 +3401,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -2956,7 +3459,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3064,7 +3568,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -3095,7 +3600,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3178,7 +3684,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3292,7 +3799,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3397,7 +3905,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -3429,7 +3938,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3467,7 +3977,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3545,7 +4056,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -3576,7 +4088,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [] }, @@ -3633,7 +4146,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3674,7 +4188,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3745,7 +4260,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { @@ -3785,7 +4301,8 @@ "table", "json", "yaml", - "text" + "text", + "id" ], "flags": [ { diff --git a/internal/cli/testdata/golden/monitor-availability-get.json b/internal/cli/testdata/golden/monitor-availability-get.json index 475e750..e0626e8 100644 --- a/internal/cli/testdata/golden/monitor-availability-get.json +++ b/internal/cli/testdata/golden/monitor-availability-get.json @@ -8,6 +8,8 @@ "date": "2026-11-01", "downtimeMinutes": 0, "inconclusive": 0, + "maintenance": 0, + "maintenanceMinutes": 0, "noData": false, "ok": 1440, "uptimePercent": 100, @@ -19,6 +21,8 @@ "date": "2026-11-02", "downtimeMinutes": 20, "inconclusive": 0, + "maintenance": 0, + "maintenanceMinutes": 0, "noData": false, "ok": 1420, "uptimePercent": 98.61, @@ -30,6 +34,8 @@ "date": "2026-11-03", "downtimeMinutes": 0, "inconclusive": 0, + "maintenance": 0, + "maintenanceMinutes": 0, "noData": true, "ok": 0, "warning": 0 @@ -38,6 +44,8 @@ "downtimeMinutes": 40, "from": "2026-11-01", "inconclusive": 0, + "maintenance": 0, + "maintenanceMinutes": 0, "ok": 4260, "to": "2026-11-03", "uptimePercent": 99.07, diff --git a/internal/cli/testdata/golden/monitor-availability-get.yaml b/internal/cli/testdata/golden/monitor-availability-get.yaml index e298568..ac049d2 100644 --- a/internal/cli/testdata/golden/monitor-availability-get.yaml +++ b/internal/cli/testdata/golden/monitor-availability-get.yaml @@ -6,6 +6,8 @@ days: date: "2026-11-01" downtimeMinutes: 0 inconclusive: 0 + maintenance: 0 + maintenanceMinutes: 0 noData: false ok: 1440 uptimePercent: 100 @@ -15,6 +17,8 @@ days: date: "2026-11-02" downtimeMinutes: 20 inconclusive: 0 + maintenance: 0 + maintenanceMinutes: 0 noData: false ok: 1420 uptimePercent: 98.61 @@ -24,12 +28,16 @@ days: date: "2026-11-03" downtimeMinutes: 0 inconclusive: 0 + maintenance: 0 + maintenanceMinutes: 0 noData: true ok: 0 warning: 0 downtimeMinutes: 40 from: "2026-11-01" inconclusive: 0 +maintenance: 0 +maintenanceMinutes: 0 ok: 4260 to: "2026-11-03" uptimePercent: 99.07 diff --git a/internal/cli/testdata/golden/monitor-incidents-get.json b/internal/cli/testdata/golden/monitor-incidents-get.json index 3ce88ed..83bdc03 100644 --- a/internal/cli/testdata/golden/monitor-incidents-get.json +++ b/internal/cli/testdata/golden/monitor-incidents-get.json @@ -19,6 +19,7 @@ "statusCode": 503 }, "id": "3f2c8a8e-6c1d-4a59-9a43-2b1f0f6f9d10", + "maintenanceHeld": false, "monitorId": "7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f", "monitorName": "Shop", "monitorTarget": "https://shop.example.com/health", diff --git a/internal/cli/testdata/golden/monitor-incidents-get.yaml b/internal/cli/testdata/golden/monitor-incidents-get.yaml index 2cbabbb..699eebc 100644 --- a/internal/cli/testdata/golden/monitor-incidents-get.yaml +++ b/internal/cli/testdata/golden/monitor-incidents-get.yaml @@ -14,6 +14,7 @@ durationSeconds: 540 facts: statusCode: 503 id: 3f2c8a8e-6c1d-4a59-9a43-2b1f0f6f9d10 +maintenanceHeld: false monitorId: 7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f monitorName: Shop monitorTarget: https://shop.example.com/health diff --git a/internal/cli/testdata/golden/monitor-incidents-list.json b/internal/cli/testdata/golden/monitor-incidents-list.json index b03ee09..2d62083 100644 --- a/internal/cli/testdata/golden/monitor-incidents-list.json +++ b/internal/cli/testdata/golden/monitor-incidents-list.json @@ -7,6 +7,7 @@ "statusCode": 503 }, "id": "3f2c8a8e-6c1d-4a59-9a43-2b1f0f6f9d10", + "maintenanceHeld": false, "monitorId": "7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f", "monitorName": "Shop", "monitorTarget": "https://shop.example.com/health", diff --git a/internal/cli/testdata/golden/monitor-incidents-list.yaml b/internal/cli/testdata/golden/monitor-incidents-list.yaml index 503ef3c..b4ed236 100644 --- a/internal/cli/testdata/golden/monitor-incidents-list.yaml +++ b/internal/cli/testdata/golden/monitor-incidents-list.yaml @@ -4,6 +4,7 @@ facts: statusCode: 503 id: 3f2c8a8e-6c1d-4a59-9a43-2b1f0f6f9d10 + maintenanceHeld: false monitorId: 7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f monitorName: Shop monitorTarget: https://shop.example.com/health diff --git a/internal/cli/testdata/golden/monitor-incidents-summary.json b/internal/cli/testdata/golden/monitor-incidents-summary.json index b5d715c..eca8a6e 100644 --- a/internal/cli/testdata/golden/monitor-incidents-summary.json +++ b/internal/cli/testdata/golden/monitor-incidents-summary.json @@ -2,6 +2,7 @@ "mttrLast30dSeconds": 1260, "open": { "critical": 1, + "inMaintenance": 0, "total": 1, "unacknowledged": 1, "warning": 0 diff --git a/internal/cli/testdata/golden/monitor-incidents-summary.tsv b/internal/cli/testdata/golden/monitor-incidents-summary.tsv index fdf3fe7..be28e7d 100644 --- a/internal/cli/testdata/golden/monitor-incidents-summary.tsv +++ b/internal/cli/testdata/golden/monitor-incidents-summary.tsv @@ -1 +1 @@ -1 1 0 1 4 12 21m 0s +1 1 0 1 4 12 21m 0s 0 diff --git a/internal/cli/testdata/golden/monitor-incidents-summary.txt b/internal/cli/testdata/golden/monitor-incidents-summary.txt index fcf5d98..2f2ed3b 100644 --- a/internal/cli/testdata/golden/monitor-incidents-summary.txt +++ b/internal/cli/testdata/golden/monitor-incidents-summary.txt @@ -5,3 +5,4 @@ Unacknowledged: 1 Resolved 7d: 4 Resolved 30d: 12 Mean time to resolve 30d: 21m 0s +In maintenance: 0 diff --git a/internal/cli/testdata/golden/monitor-incidents-summary.yaml b/internal/cli/testdata/golden/monitor-incidents-summary.yaml index a5ae963..cc84a0f 100644 --- a/internal/cli/testdata/golden/monitor-incidents-summary.yaml +++ b/internal/cli/testdata/golden/monitor-incidents-summary.yaml @@ -1,6 +1,7 @@ mttrLast30dSeconds: 1260 open: critical: 1 + inMaintenance: 0 total: 1 unacknowledged: 1 warning: 0 diff --git a/internal/cli/testdata/golden/monitor-maintenance-get.json b/internal/cli/testdata/golden/monitor-maintenance-get.json new file mode 100644 index 0000000..b42945f --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-get.json @@ -0,0 +1,32 @@ +{ + "createdAt": "2026-11-03T08:00:00Z", + "createdBy": "11111111-2222-4333-8444-555555555555", + "createdByName": "Dev Owner", + "description": "Short interruptions are expected.", + "endsAt": "2026-11-03T08:15:00Z", + "finishedEarly": false, + "id": "4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a", + "notifyFinished": true, + "notifyScheduled": true, + "notifyStarted": true, + "startsAt": "2026-11-03T08:00:00Z", + "state": "in_progress", + "statusPages": [ + { + "componentIds": [ + "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5e" + ], + "id": "6e0f4b1a-2c3d-4e5f-8a9b-0c1d2e3f4a5b", + "name": "Acme status", + "published": true + } + ], + "targets": { + "componentIds": [], + "monitorIds": [ + "7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f" + ] + }, + "title": "Deploy", + "updatedAt": "2026-11-03T08:00:00Z" +} diff --git a/internal/cli/testdata/golden/monitor-maintenance-get.tsv b/internal/cli/testdata/golden/monitor-maintenance-get.tsv new file mode 100644 index 0000000..da99c61 --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-get.tsv @@ -0,0 +1 @@ +4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a Deploy in_progress 2026-11-03T08:00:00Z 2026-11-03T08:15:00Z 1 0 Acme status diff --git a/internal/cli/testdata/golden/monitor-maintenance-get.txt b/internal/cli/testdata/golden/monitor-maintenance-get.txt new file mode 100644 index 0000000..c175ad8 --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-get.txt @@ -0,0 +1,12 @@ +ID: 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a +Title: Deploy +State: in_progress +Starts: 2026-11-03 10:00 +Ends: 2026-11-03 10:15 +Description: Short interruptions are expected. +Monitors: 7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f +Components: none +Status pages: Acme status (published) +Mail: scheduled, started, finished +Created: 2026-11-03 10:00 +Created by: Dev Owner diff --git a/internal/cli/testdata/golden/monitor-maintenance-get.yaml b/internal/cli/testdata/golden/monitor-maintenance-get.yaml new file mode 100644 index 0000000..f578cc5 --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-get.yaml @@ -0,0 +1,24 @@ +createdAt: "2026-11-03T08:00:00Z" +createdBy: 11111111-2222-4333-8444-555555555555 +createdByName: Dev Owner +description: Short interruptions are expected. +endsAt: "2026-11-03T08:15:00Z" +finishedEarly: false +id: 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a +notifyFinished: true +notifyScheduled: true +notifyStarted: true +startsAt: "2026-11-03T08:00:00Z" +state: in_progress +statusPages: + - componentIds: + - a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5e + id: 6e0f4b1a-2c3d-4e5f-8a9b-0c1d2e3f4a5b + name: Acme status + published: true +targets: + componentIds: [] + monitorIds: + - 7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f +title: Deploy +updatedAt: "2026-11-03T08:00:00Z" diff --git a/internal/cli/testdata/golden/monitor-maintenance-list.json b/internal/cli/testdata/golden/monitor-maintenance-list.json new file mode 100644 index 0000000..350f366 --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-list.json @@ -0,0 +1,57 @@ +[ + { + "createdAt": "2026-11-03T08:00:00Z", + "createdBy": "11111111-2222-4333-8444-555555555555", + "createdByName": "Dev Owner", + "description": "Short interruptions are expected.", + "endsAt": "2026-11-03T08:15:00Z", + "finishedEarly": false, + "id": "4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a", + "notifyFinished": true, + "notifyScheduled": true, + "notifyStarted": true, + "startsAt": "2026-11-03T08:00:00Z", + "state": "in_progress", + "statusPages": [ + { + "componentIds": [ + "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5e" + ], + "id": "6e0f4b1a-2c3d-4e5f-8a9b-0c1d2e3f4a5b", + "name": "Acme status", + "published": true + } + ], + "targets": { + "componentIds": [], + "monitorIds": [ + "7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f" + ] + }, + "title": "Deploy", + "updatedAt": "2026-11-03T08:00:00Z" + }, + { + "createdAt": "2026-11-03T09:00:00Z", + "description": "", + "endsAt": "2026-11-07T16:00:00Z", + "finishedEarly": false, + "id": "5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b", + "notifyFinished": false, + "notifyScheduled": false, + "notifyStarted": false, + "startsAt": "2026-11-07T14:00:00Z", + "state": "scheduled", + "statusPages": [], + "targets": { + "componentIds": [ + "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6f" + ], + "monitorIds": [ + "2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809" + ] + }, + "title": "Database upgrade", + "updatedAt": "2026-11-03T09:00:00Z" + } +] diff --git a/internal/cli/testdata/golden/monitor-maintenance-list.tsv b/internal/cli/testdata/golden/monitor-maintenance-list.tsv new file mode 100644 index 0000000..ae1eaf3 --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-list.tsv @@ -0,0 +1,2 @@ +4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a Deploy in_progress 2026-11-03T08:00:00Z 2026-11-03T08:15:00Z 1 0 Acme status +5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b Database upgrade scheduled 2026-11-07T14:00:00Z 2026-11-07T16:00:00Z 1 1 diff --git a/internal/cli/testdata/golden/monitor-maintenance-list.txt b/internal/cli/testdata/golden/monitor-maintenance-list.txt new file mode 100644 index 0000000..5479a42 --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-list.txt @@ -0,0 +1,3 @@ +ID TITLE STATE STARTS ENDS MONITORS COMPONENTS PUBLIC ON +4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a Deploy in_progress 2026-11-03 10:00 2026-11-03 10:15 1 0 Acme status +5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b Database upgrade scheduled 2026-11-07 16:00 2026-11-07 18:00 1 1 — diff --git a/internal/cli/testdata/golden/monitor-maintenance-list.yaml b/internal/cli/testdata/golden/monitor-maintenance-list.yaml new file mode 100644 index 0000000..51276b4 --- /dev/null +++ b/internal/cli/testdata/golden/monitor-maintenance-list.yaml @@ -0,0 +1,42 @@ +- createdAt: "2026-11-03T08:00:00Z" + createdBy: 11111111-2222-4333-8444-555555555555 + createdByName: Dev Owner + description: Short interruptions are expected. + endsAt: "2026-11-03T08:15:00Z" + finishedEarly: false + id: 4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a + notifyFinished: true + notifyScheduled: true + notifyStarted: true + startsAt: "2026-11-03T08:00:00Z" + state: in_progress + statusPages: + - componentIds: + - a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5e + id: 6e0f4b1a-2c3d-4e5f-8a9b-0c1d2e3f4a5b + name: Acme status + published: true + targets: + componentIds: [] + monitorIds: + - 7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f + title: Deploy + updatedAt: "2026-11-03T08:00:00Z" +- createdAt: "2026-11-03T09:00:00Z" + description: "" + endsAt: "2026-11-07T16:00:00Z" + finishedEarly: false + id: 5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b + notifyFinished: false + notifyScheduled: false + notifyStarted: false + startsAt: "2026-11-07T14:00:00Z" + state: scheduled + statusPages: [] + targets: + componentIds: + - b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6f + monitorIds: + - 2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809 + title: Database upgrade + updatedAt: "2026-11-03T09:00:00Z" diff --git a/internal/cli/testdata/golden/monitor-monitors-get-ssl.tsv b/internal/cli/testdata/golden/monitor-monitors-get-ssl.tsv index eff1aa7..d3472ea 100644 --- a/internal/cli/testdata/golden/monitor-monitors-get-ssl.tsv +++ b/internal/cli/testdata/golden/monitor-monitors-get-ssl.tsv @@ -1 +1 @@ -2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809 API cert ssl Expiring api.example.com:443 2026-11-03T08:00:00Z +2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809 API cert ssl Expiring api.example.com:443 2026-11-03T08:00:00Z diff --git a/internal/cli/testdata/golden/monitor-monitors-get.json b/internal/cli/testdata/golden/monitor-monitors-get.json index a8f3122..5e2110f 100644 --- a/internal/cli/testdata/golden/monitor-monitors-get.json +++ b/internal/cli/testdata/golden/monitor-monitors-get.json @@ -67,6 +67,7 @@ "critical": 20, "from": "2026-11-02T08:00:00Z", "inconclusive": 0, + "maintenance": 0, "ok": 1420, "p50Ms": 110, "p95Ms": 240, diff --git a/internal/cli/testdata/golden/monitor-monitors-get.tsv b/internal/cli/testdata/golden/monitor-monitors-get.tsv index eb9e7af..70312c2 100644 --- a/internal/cli/testdata/golden/monitor-monitors-get.tsv +++ b/internal/cli/testdata/golden/monitor-monitors-get.tsv @@ -1 +1 @@ -7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f Shop keyword Down https://shop.example.com/health 98.61% 2026-11-03T08:10:00Z +7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f Shop keyword Down https://shop.example.com/health 98.61% 2026-11-03T08:10:00Z diff --git a/internal/cli/testdata/golden/monitor-monitors-get.yaml b/internal/cli/testdata/golden/monitor-monitors-get.yaml index 4023714..47fc36d 100644 --- a/internal/cli/testdata/golden/monitor-monitors-get.yaml +++ b/internal/cli/testdata/golden/monitor-monitors-get.yaml @@ -51,6 +51,7 @@ last24h: critical: 20 from: "2026-11-02T08:00:00Z" inconclusive: 0 + maintenance: 0 ok: 1420 p50Ms: 110 p95Ms: 240 diff --git a/internal/cli/testdata/golden/monitor-monitors-list.json b/internal/cli/testdata/golden/monitor-monitors-list.json index 828f81d..0d2774d 100644 --- a/internal/cli/testdata/golden/monitor-monitors-list.json +++ b/internal/cli/testdata/golden/monitor-monitors-list.json @@ -68,6 +68,7 @@ "critical": 20, "from": "2026-11-02T08:00:00Z", "inconclusive": 0, + "maintenance": 0, "ok": 1420, "p50Ms": 110, "p95Ms": 240, diff --git a/internal/cli/testdata/golden/monitor-monitors-list.tsv b/internal/cli/testdata/golden/monitor-monitors-list.tsv index 12c14aa..d1eab43 100644 --- a/internal/cli/testdata/golden/monitor-monitors-list.tsv +++ b/internal/cli/testdata/golden/monitor-monitors-list.tsv @@ -1,3 +1,3 @@ -7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f Shop keyword Down https://shop.example.com/health 98.61% 2026-11-03T08:10:00Z -2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809 API cert ssl Expiring api.example.com:443 2026-11-03T08:00:00Z -9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d example.com domain Registered example.com 2026-11-03T06:00:00Z +7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f Shop keyword Down https://shop.example.com/health 98.61% 2026-11-03T08:10:00Z +2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809 API cert ssl Expiring api.example.com:443 2026-11-03T08:00:00Z +9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d example.com domain Registered example.com 2026-11-03T06:00:00Z diff --git a/internal/cli/testdata/golden/monitor-monitors-list.txt b/internal/cli/testdata/golden/monitor-monitors-list.txt index 5d484dc..847e98a 100644 --- a/internal/cli/testdata/golden/monitor-monitors-list.txt +++ b/internal/cli/testdata/golden/monitor-monitors-list.txt @@ -1,4 +1,4 @@ -ID NAME TYPE STATUS TARGET UPTIME 24H LAST CHECK -7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f Shop keyword Down https://shop.example.com/health 98.61% 2026-11-03 10:10 -2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809 API cert ssl Expiring api.example.com:443 — 2026-11-03 10:00 -9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d example.com domain Registered example.com — 2026-11-03 08:00 +ID NAME TYPE STATUS TARGET UPTIME 24H LAST CHECK MAINTENANCE UNTIL +7d1c2f7e-6a1f-4f5e-9b8a-1f7c2b3d4e5f Shop keyword Down https://shop.example.com/health 98.61% 2026-11-03 10:10 — +2b3c4d5e-6f70-4a81-92a3-b4c5d6e7f809 API cert ssl Expiring api.example.com:443 — 2026-11-03 10:00 — +9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d example.com domain Registered example.com — 2026-11-03 08:00 — diff --git a/internal/cli/testdata/golden/monitor-monitors-list.yaml b/internal/cli/testdata/golden/monitor-monitors-list.yaml index 1f6b96f..d5d0249 100644 --- a/internal/cli/testdata/golden/monitor-monitors-list.yaml +++ b/internal/cli/testdata/golden/monitor-monitors-list.yaml @@ -51,6 +51,7 @@ critical: 20 from: "2026-11-02T08:00:00Z" inconclusive: 0 + maintenance: 0 ok: 1420 p50Ms: 110 p95Ms: 240 diff --git a/internal/cli/testdata/golden/monitor-stats-get.json b/internal/cli/testdata/golden/monitor-stats-get.json index a5ff537..880b930 100644 --- a/internal/cli/testdata/golden/monitor-stats-get.json +++ b/internal/cli/testdata/golden/monitor-stats-get.json @@ -5,6 +5,7 @@ "from": "2026-11-02T08:00:00Z", "granularity": "hour", "inconclusive": 0, + "maintenance": 0, "maxMs": 980, "ok": 1420, "series": [], diff --git a/internal/cli/testdata/golden/monitor-stats-get.yaml b/internal/cli/testdata/golden/monitor-stats-get.yaml index 52efeea..b89ada4 100644 --- a/internal/cli/testdata/golden/monitor-stats-get.yaml +++ b/internal/cli/testdata/golden/monitor-stats-get.yaml @@ -4,6 +4,7 @@ critical: 20 from: "2026-11-02T08:00:00Z" granularity: hour inconclusive: 0 +maintenance: 0 maxMs: 980 ok: 1420 series: [] diff --git a/internal/cli/testdata/golden/monitor-status.json b/internal/cli/testdata/golden/monitor-status.json index d681155..5cab5e6 100644 --- a/internal/cli/testdata/golden/monitor-status.json +++ b/internal/cli/testdata/golden/monitor-status.json @@ -4,6 +4,7 @@ "mttrLast30dSeconds": 1260, "open": { "critical": 1, + "inMaintenance": 0, "total": 1, "unacknowledged": 1, "warning": 0 @@ -42,5 +43,6 @@ "condition": "cert_expiring", "message": "Certificate expires in 12 days" } - ] + ], + "maintenance": [] } diff --git a/internal/cli/testdata/golden/monitor-status.tsv b/internal/cli/testdata/golden/monitor-status.tsv index d5db8b4..41c9a77 100644 --- a/internal/cli/testdata/golden/monitor-status.tsv +++ b/internal/cli/testdata/golden/monitor-status.tsv @@ -1 +1 @@ -critical 1 1 0 1 3 (1 ok, 1 warning, 1 critical, 0 pending, 0 paused) Down: Shop (https://shop.example.com/health), HTTP 503 Expiring: API cert (api.example.com:443), Certificate expires in 12 days +critical 1 1 0 1 3 (1 ok, 1 warning, 1 critical, 0 pending, 0 paused) Down: Shop (https://shop.example.com/health), HTTP 503 Expiring: API cert (api.example.com:443), Certificate expires in 12 days 0 none diff --git a/internal/cli/testdata/golden/monitor-status.txt b/internal/cli/testdata/golden/monitor-status.txt index 79b505c..a1a0d29 100644 --- a/internal/cli/testdata/golden/monitor-status.txt +++ b/internal/cli/testdata/golden/monitor-status.txt @@ -1,8 +1,10 @@ -Status: critical -Open: 1 -Critical: 1 -Warning: 0 -Unacknowledged: 1 -Monitors: 3 (1 ok, 1 warning, 1 critical, 0 pending, 0 paused) -Problems: Down: Shop (https://shop.example.com/health), HTTP 503 - Expiring: API cert (api.example.com:443), Certificate expires in 12 days +Status: critical +Open: 1 +Critical: 1 +Warning: 0 +Unacknowledged: 1 +Monitors: 3 (1 ok, 1 warning, 1 critical, 0 pending, 0 paused) +Problems: Down: Shop (https://shop.example.com/health), HTTP 503 + Expiring: API cert (api.example.com:443), Certificate expires in 12 days +Incidents in maintenance: 0 +In maintenance: none diff --git a/internal/cli/testdata/golden/monitor-status.yaml b/internal/cli/testdata/golden/monitor-status.yaml index 0f6a762..f46b876 100644 --- a/internal/cli/testdata/golden/monitor-status.yaml +++ b/internal/cli/testdata/golden/monitor-status.yaml @@ -2,11 +2,13 @@ incidents: mttrLast30dSeconds: 1260 open: critical: 1 + inMaintenance: 0 total: 1 unacknowledged: 1 warning: 0 resolvedLast7d: 4 resolvedLast30d: 12 +maintenance: [] monitors: critical: 1 ok: 1 From 054aa2a06f212af196fa42fa159d323a05f0f94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0v=C3=A1b=C3=ADk?= Date: Fri, 6 Nov 2026 14:36:51 +0100 Subject: [PATCH 5/7] docs: record maintenance windows and -o id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Švábík --- CHANGELOG.md | 58 ++++++++++++++++++++++++++++++++++++++++++++ docs/ARCHITECTURE.md | 2 +- docs/DESIGN.md | 18 ++++++++++---- 3 files changed, 72 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab4f6fa..9ca4eb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,64 @@ Notable changes, newest first. Release notes on GitHub list every commit; this file collects what users and scripts need to know. +## Unreleased + +### New + +- Norcube Monitor maintenance windows: `monitor maintenance list | get | create | + update | cancel | finish`. A window pauses alerts for its monitors, stays out + of their uptime, shows on every published status page displaying a target and + mails subscribers when it is scheduled, starts and finishes, unless you pass + `--notify-scheduled=false` and so on, or `--no-notify` for all three. + - `--start` and `--end` take an RFC 3339 timestamp, `now` or a span from now + (`+2h`, `+7d`). A bare `2h` is refused, because `--since` reads that as two + hours ago. `--duration` takes `15m`, `2h` or `7d`. + - Wrap a deploy: `id=$(nrc monitor maintenance create --monitor api --title + "Deploy" --duration 15m -o id)`, deploy, `nrc monitor maintenance finish + "$id"`. A window ends by itself if the deploy dies first. + - `cancel` takes a scheduled window and confirms (`--yes`); `finish` takes one + in progress and doesn't ask. Each one's refusal exits 8 and names the other. + - CI tokens change windows with the new `monitor.maintenance` scope, which no + other scope includes, and need `monitor.statuspages` too when a window shows + on a published page; a refusal names the page. `cancel` and `finish` need + only `monitor.maintenance`. Any Norcube Monitor scope reads them. + - The API's delete has no command: it takes only cancelled windows, and `nrc + api` reaches it, as it does the list of what a window could target. +- `-o id` prints only a result's id, one per line for a list, for capturing it in + a script. A result without an id is a usage error. + +### Changes + +- `monitor status` shows monitors whose problem a maintenance window holds under + "In maintenance" instead of "Problems", and doesn't count their incidents + towards the verdict or `--fail-on`. A certificate or domain running out isn't + held and stays a problem. +- `monitors run` says when a maintenance window holds the monitor. `--wait` still + fails on a critical result: it is there to tell whether the deploy worked. +- `monitors list` and `get` show until when a window holds a monitor, and + `incidents summary` how many open incidents are held. +- Refreshed the Norcube Monitor client and spec for maintenance windows and the + summary of each status page in the page list. The summary has no command yet; + `monitor status-pages list -o json` shows it. + +### Changes for scripts + +- The `-o` values and `nrc commands` `outputFormats` gain `id`. +- `monitor status` JSON and YAML: new `maintenance` list; a monitor whose problem + a window holds moves there from `problems`. `incidents.open` gains + `inMaintenance`, and the API leaves held incidents out of its other counts. +- `monitor status` `-o text`: two new columns at the end, the number of held + incidents and the monitors in maintenance. +- `monitors list` and `get` `-o text`: a new column at the end, the end of the + window holding the monitor. JSON and YAML: `maintenance` while one does. +- `monitors run` JSON, YAML and `job_failed` details: new `inMaintenance`. + `-o text`: a new column at the end, `yes` or `no`. +- `incidents summary` `-o text`: a new column at the end, the held incidents. +- From the API, additively: `monitors stats get`, `monitors availability get` and + results gain `maintenance` counts and `maintenanceMinutes`, incidents + `maintenanceHeld`, status changes `maintenanceWindowId`, and incident timelines + the event type `maintenance_hold`. + ## 0.24.0 (2026-11-05) ### New diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index e1238be..9560bd7 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -16,7 +16,7 @@ cmd/norcube main: signals, exit codes, error rendering │ ├─ auth token exchange, per-profile session, refresh lock │ └─ transport timeouts, retries, User-Agent, --debug trace ├─ api/ generated clients (oapi-codegen); api/auth.go by hand - └─ cmdutil result → --query → output (table | json | yaml | text) + └─ cmdutil result → --query → output (table | json | yaml | text | id) ``` A command's `RunE` builds its client with `service.New`, calls the API, diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 9bb6df5..07c2ebb 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -118,6 +118,7 @@ meaning across the tree: | `summary` | Counts over a whole resource, not a list | `monitor incidents summary` | | `publish` / `unpublish` | Make a thing public, or take it offline keeping everything on it | `monitor status-pages publish` | | `preview-link` | Print a short-lived link to see a thing as the public would | `monitor status-pages preview-link` | +| `finish` | End something in progress now, as opposed to `cancel`, which calls off something that hasn't started | `monitor maintenance finish` | | `cancel`, `watch`, `results`, `status`, `check`, `generate`, `import`, `set`, `revoke`, `use` | As named | `domainradar bulk watch`, `langsync terms import status` | `rm` is an alias of `remove` only, never of `delete`. @@ -160,7 +161,7 @@ pipeline downstream, silently. ### P3. Stable output formats and `--query` -**Commitment.** Every command supports four formats: +**Commitment.** Every command supports these formats: | Format | Contract | | --- | --- | @@ -168,6 +169,7 @@ pipeline downstream, silently. | `json` | The API's own resource and field names. Lists are arrays. Changes are additive only. | | `yaml` | The same data and field names as `json`. | | `text` | Tab-separated, no header, one record per line, times in RFC 3339 UTC. Column order is part of the contract; a new column is a "change for scripts". | +| `id` | Only the result's `id`, one per line for a list, for `id=$(... -o id)`. `--query` applies first, so it can name another field. A result without an id is a usage error (exit 2) and, for a write, comes after the change was made. Not settable with `configure`: it isn't a sensible default. | `--query` is a JMESPath expression applied to what `-o json` would print, before formatting, so it composes with every format. An invalid @@ -182,7 +184,8 @@ thing everywhere. **Enforced.** - [`golden_test.go`](../internal/cli/golden_test.go): about 54 commands and query cases, each pinned in all four formats - (`testdata/golden/*.{json,yaml,txt,tsv}`) against a fake backend. + (`testdata/golden/*.{json,yaml,txt,tsv}`) against a fake backend; + `id` follows from the JSON and is pinned in `output/id_test.go`. - `--query` is compiled in the root `PersistentPreRunE` and again in `cmdutil.Run`, both as usage errors. - Known exception to fix before v1.0: some write commands return ad-hoc @@ -521,6 +524,7 @@ and product packages use it instead of their own: | Reading items or text from args, a file or stdin | `cmdutil.ReadItems`, `cmdutil.ReadText` | | Writing a file | `cmdutil.SaveStream` | | Time arguments (`--since`) | `cmdutil.ParseTimeArg` | +| Times ahead and lengths (`--start`, `--duration`) | `cmdutil.ParseFutureTimeArg`, `cmdutil.ParseDurationArg` | | Server-sent event streams with reconnect | `internal/sse` | | Usage errors | `clierr.Usage` | | What a command changes, a flag's allowed values, a platform command's service | `cmdutil.Reads` / `Writes` / `Local`, `cmdutil.FlagEnum`, `cmdutil.AnnotationService` (read by `nrc commands`) | @@ -728,7 +732,7 @@ flag; [CHANGELOG.md](../CHANGELOG.md) says when each arrived. | `langsync` | `init`, `sync`, `pull`; `namespaces list | create | update | delete`; `terms list | add | update | delete | import`, `terms import status`; `translations get | set | suggest | translate-missing`; `languages list | add | remove | create | delete`; `prompts list | get | create | update | delete`; `glossary get`, `glossary items list | get | create | translate | delete`, `glossary languages attach`; `api-keys list | create | revoke`; `audit list` | | `domainradar` | `check`; `bulk create | list | get | results | watch | export | cancel | delete`; `saved list | add | remove`; `watchers list | get | create | update | delete`; `hits list | get`; `names generate | list | get | results | check | delete` | | `billing` | `status`; `subscriptions list`; `usage estimate | metrics`; `invoices list | download`; `budget get | set` | -| `monitor` | `status` (`--fail-on`); `monitors list | get | create | update | delete | pause | resume | run` (`--wait`), `monitors bulk pause | resume | delete`, `monitors results list`, `monitors status-changes list`, `monitors stats get`, `monitors availability get`, `monitors certificate get`, `monitors alerts get | set`; `incidents list | get | acknowledge | summary`; `channels list | get | create | update | delete | test | verify`, `channels deliveries list`; `status-pages list | get | create | update | delete | publish | unpublish | preview-link`, `status-pages layout get | set`, `status-pages incidents list | get | create | update`, `status-pages incidents updates create`, `status-pages subscribers list | delete` | +| `monitor` | `status` (`--fail-on`); `monitors list | get | create | update | delete | pause | resume | run` (`--wait`), `monitors bulk pause | resume | delete`, `monitors results list`, `monitors status-changes list`, `monitors stats get`, `monitors availability get`, `monitors certificate get`, `monitors alerts get | set`; `incidents list | get | acknowledge | summary`; `channels list | get | create | update | delete | test | verify`, `channels deliveries list`; `status-pages list | get | create | update | delete | publish | unpublish | preview-link`, `status-pages layout get | set`, `status-pages incidents list | get | create | update`, `status-pages incidents updates create`, `status-pages subscribers list | delete`; `maintenance list | get | create | update | cancel | finish` | | PromptHub | No command group; `nrc api prompthub ...` | | CMS | None (CMS has no public API) | @@ -743,7 +747,9 @@ sends and verification codes; not included in `monitor.write`, because channels hold credentials and sends cost money), `monitor.statuspages` (manage status pages, post incidents on them and manage their subscribers; not included in any other scope, because what it changes is public and subscribers' addresses are -personal data). +personal data), `monitor.maintenance` (manage maintenance windows; not included +in any other scope, because a window silences alerts, and one that shows on a +published page also takes `monitor.statuspages`). Installation channels: Homebrew cask (with `nrc`), `.deb` / `.rpm` / `.apk`, `install.sh`, release archives (darwin and linux amd64/arm64, @@ -793,6 +799,8 @@ changelog, and the owner's decisions in the planning sessions of | 2026-11-04 | `nrc commands`: the whole command tree as one versioned, offline document; what the tree cannot reveal is declared with annotations (`effect`, flag enums, service), never inferred from verbs | Agents should not crawl dozens of `--help` pages. Prior art: `kubectl api-resources` / `explain` (verbs per resource, offline schema), `aws ... --generate-cli-skeleton` (machine-readable input), cobra's doc generation (`tools/gendocs` already walks the tree). Global flags listed once rather than on every command, to keep the document small; a verb-based guess of the effect was rejected because domain verbs like `check`, `suggest` or `init` don't say whether they change anything | owner | | 2026-11-04 | PulseCheck is renamed Norcube Monitor before its first release, every technical name included: command group `monitor` (`nrc monitor monitors list`), registry key, OAuth audience and generated package `monitor`, scopes `monitor.read`, `monitor.check`, `monitor.write`, `monitor.channels`, endpoint `https://monitor.api.norcube.com/app/v1`, `NORCUBE_MONITOR_URL`. No `pulsecheck` alias or `cmdutil.Renamed` entry | The old name was never in a release, so no script, config file or token depends on it and P10 has nothing to keep; the backend renamed its service, audience and scopes in the same change. Rejected: keeping `pulsecheck` as a hidden alias, which would be a second name for one thing (P13) with no user to serve | owner | | 2026-11-05 | Status page subscribers in the CLI: `status-pages subscribers list` and `delete`. A subscriber is named by id only. `delete ` completes the page but not the subscriber, because completion candidates are cached on disk and addresses have no place there. The CLI words the scope refusal itself: the API's sentence is shared with the page's other writes and speaks of changing pages, which misleads on a list | Owner's brief. The API's `count` and `export` have no commands yet; `nrc api` reaches them | owner | +| 2026-11-06 | Maintenance windows in the CLI: `monitor maintenance`. The resource is a mass noun, an exception to the plural rule of P1, because "maintenances" isn't a word and "maintenance windows" is long to type for something used in deploy scripts; `maintenance-windows` is an alias. A window is named by id only: titles repeat by design. `--state` filters on the field the result calls `state` (the API's query parameter is `status`), with the API's values. There is no `delete`: the API deletes only a cancelled window, a completed one explains a gap in uptime and goes by itself after two years, and `cancel` already takes a window out of everything people see; `nrc api` reaches the endpoint. `finish` is a new verb, because `cancel` would say the work didn't happen. `cancel` confirms, since it mails whoever was told; `finish` doesn't and has no `--yes`, because ending a silence is the safe direction and it must run unattended at the end of a deploy. Notifications are explicit in the request, because the API takes no defaults: the flags default to on, as the owner decided, and `--no-notify` turns off all three. `monitor status` keeps a monitor among `problems` when what is wrong is a calendar condition or a watched aspect, because a window doesn't hold those | Owner's brief. Rejected: a bare `2h` meaning two hours ahead, since `ParseTimeArg` reads the same spelling as two hours ago | owner | +| 2026-11-06 | `-o id` prints only the result's id. Deploy scripts capture what they create with `id=$(... -o id)`, and `-o text` prints the state as well, so it would need `cut`. It is a global output value rather than a flag of one command, so it means the same everywhere (P1, P13) | Named in the owner's maintenance windows plan. Rejected: `--query id -o text` as the documented form, which still works but is too long for the one thing every script needs | owner | | 2026-11-05 | `--auto-post` is the one page setting `create` doesn't require: the flag came after 0.23.0, so requiring it would break scripts that create pages, and the API keeps it off unless asked. `--notify` is sent only when given, and exists only on writes that add an update | Compatibility rule P10; owner's brief | owner | --- @@ -869,7 +877,7 @@ it with the same guarantees as every other product. The steps, in order: | Step | State | | --- | --- | | 1 Audience | `monitor` exists in Norcube Auth (sign-in audience list, CI token exchange) | -| 2 Scopes | `monitor.read`, `monitor.check`, `monitor.write`, `monitor.channels`, `monitor.statuspages` in the CI token catalog (and so the CLI sign-in catalog), with IAM actions; channel changes and sends only with `monitor.channels`, status page changes, posts and subscribers only with `monitor.statuspages`, neither of which `monitor.write` includes; not on the MCP consent screen until the MCP redesign | +| 2 Scopes | `monitor.read`, `monitor.check`, `monitor.write`, `monitor.channels`, `monitor.statuspages`, `monitor.maintenance` in the CI token catalog (and so the CLI sign-in catalog), with IAM actions; channel changes and sends only with `monitor.channels`, status page changes, posts and subscribers only with `monitor.statuspages`, neither of which `monitor.write` includes; not on the MCP consent screen until the MCP redesign | | 3 Enforcement | Default-closed route table (`internal/routers/app/scopes.go`) after the token middleware, coverage and matrix tests, and IAM refusing a scoped request the table never checked | | 4 Contract | Every operation has a verb-noun `@Id`, `@Security Bearer`, 401/403 problems and `x-norcube-scopes`; the status route is tagged `Status` and excluded here | | 5 to 10 CLI | Registry entry, hand-kept tables, client, `nrc monitor` commands, completion, command and golden tests | From ec57e899f6656098121fe29f234b474449e3edc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0v=C3=A1b=C3=ADk?= Date: Fri, 6 Nov 2026 17:11:10 +0100 Subject: [PATCH 6/7] chore: 0.25.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Švábík --- CHANGELOG.md | 2 +- internal/api/monitor/monitor.gen.go | 9 ++++----- specs/monitor.openapi.json | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ca4eb1..b267266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Notable changes, newest first. Release notes on GitHub list every commit; this file collects what users and scripts need to know. -## Unreleased +## 0.25.0 (2026-11-06) ### New diff --git a/internal/api/monitor/monitor.gen.go b/internal/api/monitor/monitor.gen.go index 9ae9161..0f20553 100644 --- a/internal/api/monitor/monitor.gen.go +++ b/internal/api/monitor/monitor.gen.go @@ -3037,14 +3037,13 @@ type DtoIncidentOpenCounts struct { // DtoIncidentSummary defines model for dto.IncidentSummary. type DtoIncidentSummary struct { - // MttrLast30dSeconds MttrLast30dSeconds is the mean time to resolve of those incidents; - // absent when none was resolved. + // MttrLast30dSeconds MttrLast30dSeconds is the mean time to resolve of those incidents, leaving + // out any a maintenance window held open at some point, whose duration is + // mostly the planned work; absent when none is left. MttrLast30dSeconds *int `json:"mttrLast30dSeconds,omitempty"` Open DtoIncidentOpenCounts `json:"open"` - // ResolvedLast30d ResolvedLast30d counts incidents resolved in the last 30 days, the - // ones mttrLast30dSeconds averages: not those a maintenance window held - // open at some point, whose duration is mostly the planned work. + // ResolvedLast30d ResolvedLast30d counts every incident resolved in the last 30 days. ResolvedLast30d int `json:"resolvedLast30d"` // ResolvedLast7d ResolvedLast7d counts incidents resolved in the last 7 days. diff --git a/specs/monitor.openapi.json b/specs/monitor.openapi.json index fcfb836..1d61820 100644 --- a/specs/monitor.openapi.json +++ b/specs/monitor.openapi.json @@ -1585,7 +1585,7 @@ "dto.IncidentSummary": { "properties": { "mttrLast30dSeconds": { - "description": "MttrLast30dSeconds is the mean time to resolve of those incidents;\nabsent when none was resolved.", + "description": "MttrLast30dSeconds is the mean time to resolve of those incidents, leaving\nout any a maintenance window held open at some point, whose duration is\nmostly the planned work; absent when none is left.", "example": 1260, "type": "integer" }, @@ -1593,7 +1593,7 @@ "$ref": "#/components/schemas/dto.IncidentOpenCounts" }, "resolvedLast30d": { - "description": "ResolvedLast30d counts incidents resolved in the last 30 days, the\nones mttrLast30dSeconds averages: not those a maintenance window held\nopen at some point, whose duration is mostly the planned work.", + "description": "ResolvedLast30d counts every incident resolved in the last 30 days.", "example": 12, "type": "integer" }, From d7baa139dfc8b5ccd2f33fb4c2623af1c547c173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0v=C3=A1b=C3=ADk?= Date: Fri, 6 Nov 2026 17:22:14 +0100 Subject: [PATCH 7/7] chore(deps): kin-openapi 0.148.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GO-2026-6789 and GO-2026-6795. Signed-off-by: Jan Švábík --- go.mod | 18 +++++++----------- go.sum | 44 ++++++++++++++++---------------------------- 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/go.mod b/go.mod index 101e56f..819396f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/charmbracelet/huh v1.0.0 github.com/charmbracelet/lipgloss v1.1.0 github.com/creativeprojects/go-selfupdate v1.5.2 - github.com/getkin/kin-openapi v0.138.0 + github.com/getkin/kin-openapi v0.148.0 github.com/gofrs/flock v0.13.0 github.com/google/uuid v1.6.0 github.com/jmespath-community/go-jmespath v1.1.1 @@ -45,8 +45,8 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/go-fed/httpsig v1.1.0 // indirect - github.com/go-openapi/jsonpointer v0.21.0 // indirect - github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-openapi/jsonpointer v0.22.5 // indirect + github.com/go-openapi/swag/jsonname v0.25.5 // indirect github.com/godbus/dbus/v5 v5.2.2 // indirect github.com/google/go-github/v74 v74.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect @@ -54,25 +54,21 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.8 // indirect github.com/hashicorp/go-version v1.8.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect - github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/termenv v0.16.0 // indirect - github.com/oasdiff/yaml v0.0.9 // indirect - github.com/oasdiff/yaml3 v0.0.12 // indirect - github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/oasdiff/yaml v0.1.1 // indirect + github.com/oasdiff/yaml3 v0.0.14 // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/rogpeppe/go-internal v1.16.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect github.com/ulikunitz/xz v0.5.15 // indirect - github.com/woodsbury/decimal128 v1.3.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect gitlab.com/gitlab-org/api/client-go v1.9.1 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect diff --git a/go.sum b/go.sum index d2156c0..7e08e14 100644 --- a/go.sum +++ b/go.sum @@ -67,16 +67,16 @@ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6 github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/getkin/kin-openapi v0.138.0 h1:ebfE0JAmF6AqHrNBy1KO3Fs68K9tPs48HalvLPo7Rv4= -github.com/getkin/kin-openapi v0.138.0/go.mod h1:vUYWaKyMqj7PfTybelXtLuLN9tReS12vxnzMRK+z2GY= +github.com/getkin/kin-openapi v0.148.0 h1:+7YqIOP2D1r7ht8LkPQE5dpty2pr9NFSP/7xXIxwNUA= +github.com/getkin/kin-openapi v0.148.0/go.mod h1:1+BHDzstro+P5CKtPy1X4PfofnFgmRe6uvMy9+r9fKY= github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI= github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM= -github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= -github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= -github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= -github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= -github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= -github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= +github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= +github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= +github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= +github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ= github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c= github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= @@ -102,8 +102,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath-community/go-jmespath v1.1.1 h1:bFikPhsi/FdmlZhVgSCd2jj1e7G/rw+zyQfyg5UF+L4= github.com/jmespath-community/go-jmespath v1.1.1/go.mod h1:4gOyFJsR/Gk+05RgTKYrifT7tBPWD8Lubtb5jRrfy9I= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -111,8 +109,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= @@ -123,8 +119,6 @@ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6T github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= @@ -133,14 +127,12 @@ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/oapi-codegen/runtime v1.4.0 h1:KLOSFOp7UzkbS7Cs1ms6NBEKYr0WmH2wZG0KKbd2er4= github.com/oapi-codegen/runtime v1.4.0/go.mod h1:5sw5fxCDmnOzKNYmkVNF8d34kyUeejJEY8HNT2WaPec= -github.com/oasdiff/yaml v0.0.9 h1:zQOvd2UKoozsSsAknnWoDJlSK4lC0mpmjfDsfqNwX48= -github.com/oasdiff/yaml v0.0.9/go.mod h1:8lvhgJG4xiKPj3HN5lDow4jZHPlx1i7dIwzkdAo6oAM= -github.com/oasdiff/yaml3 v0.0.12 h1:75urAtPeDg2/iDEWwzNrLOWxI9N/dCh81nTTJtokt2M= -github.com/oasdiff/yaml3 v0.0.12/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= +github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY= +github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU= +github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw= +github.com/oasdiff/yaml3 v0.0.14/go.mod h1:csto2xfDjYccdUn/yw/bPjj/cYTdp6HtFA0J4TWG+gg= github.com/pelletier/go-toml/v2 v2.3.1 h1:MYEvvGnQjeNkRF1qUuGolNtNExTDwct51yp7olPtrEc= github.com/pelletier/go-toml/v2 v2.3.1/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= -github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -148,12 +140,12 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.16.0 h1:O9DK+vNMDVGLr2BeZqmpLeMjiMNkuXfcqntWbZV6S5g= +github.com/rogpeppe/go-internal v1.16.0/go.mod h1:DrUVZyrJU+txYW5/1kwtXQSMFio52ZOxX7yM1VHvnxs= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= -github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 h1:1EYB5IzjZawrrnELUi78f9fPu57HuXjmddZPjrls/28= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.3/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= @@ -165,12 +157,8 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= -github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.15 h1:9DNdB5s+SgV3bQ2ApL10xRc35ck0DuIX/isZvIk+ubY= github.com/ulikunitz/xz v0.5.15/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/woodsbury/decimal128 v1.3.0 h1:8pffMNWIlC0O5vbyHWFZAt5yWvWcrHA+3ovIIjVWss0= -github.com/woodsbury/decimal128 v1.3.0/go.mod h1:C5UTmyTjW3JftjUFzOVhC20BEQa2a4ZKOB5I6Zjb+ds= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/zalando/go-keyring v0.2.8 h1:6sD/Ucpl7jNq10rM2pgqTs0sZ9V3qMrqfIIy5YPccHs=