package message

import (
	"github.com/tidbcloud/observability/pkg/common/structs"
)

type MuteClusterAlertReq struct {
	structs.CommonReqInfo
	ID string `json:"id" swaggerignore:"true"`
}

type MuteClusterAlertResp struct {
	structs.ClusterBaseInfo
}

type UnmuteClusterAlertReq struct {
	structs.CommonReqInfo
	ID string `json:"id" swaggerignore:"true"`
}

type UnmuteClusterAlertResp struct {
	structs.ClusterBaseInfo
}

type QueryExternalAlertsReq struct {
	structs.CommonReqInfo

	BizType       string `swaggerignore:"true" json:"bizType" validate:"required,max=32"`
	TenantID      string `swaggerignore:"true" json:"tenantID" validate:"required,max=20"`
	ProjectID     string `swaggerignore:"true" json:"projectID" validate:"max=20"`
	ApplicationID string `swaggerignore:"true" json:"applicationID" validate:"required,max=32"`

	// alert state with lowercase, one of active closed all
	State structs.AlertState `json:"status,omitempty" form:"status" validate:"omitempty,oneof=active closed all"`
	// startTime of alerts, unix timestamp
	StartTime *int64 `json:"startTime,omitempty" form:"startTime" validate:"required_with=EndTime,ltefield=EndTime"`
	// endTime of alerts, unix timestamp
	EndTime *int64 `json:"endTime" default:"" form:"endTime" validate:"required_with=StartTime"`
	// severity with lowercase, oneof warning, critical
	Severity string `json:"severity,omitempty" form:"severity" validate:"omitempty,oneof=warning critical"`

	Pagination `json:",inline"`
}

type QueryExternalAlertsResp struct {
	Alerts []*structs.UserAlertInfo `json:"alerts"`
	Total  int                      `json:"total"`
}
