package audit

import (
	"github.com/tidbcloud/devops/api"
	auditent "github.com/tidbcloud/devops/entity/audit"
)

type ListChangeAuditLogReq struct {
	api.PaginationReq

	ChangeID uint64 `form:"change_id"`
}

type ListChangeAuditLogResp struct {
	api.BaseResp

	Total     int64                `json:"total"`
	AuditLogs []*auditent.AuditLog `json:"audit_logs"`
}

type ListCtlAuditLogReq struct {
	api.PaginationReq

	ClusterID string `form:"cluster_id"`
}

type ListCtlAuditLogResp struct {
	api.BaseResp

	Total     int64                `json:"total"`
	AuditLogs []*auditent.AuditLog `json:"items"`
}

type ListClusterMaintenanceAuditLogReq struct {
	api.PaginationReq

	MaintenanceID uint64 `form:"maintenance_id"`
}

type ListClusterMaintenanceAuditLogResp struct {
	api.BaseResp

	Total     int64                `json:"total"`
	AuditLogs []*auditent.AuditLog `json:"audit_logs"`
}

type ListOperationAuditLogReq struct {
	api.PaginationReq

	InstanceID uint64 `form:"instance_id"`
}

type ListOperationAuditLogResp struct {
	api.BaseResp

	Total     int64                `json:"total"`
	AuditLogs []*auditent.AuditLog `json:"audit_logs"`
}

type ListAuditLogReq struct {
	api.PaginationReq

	Type     auditent.AuditLogType `form:"type"`
	ObjectID string                `form:"instance_id"`
}

type ListAuditLogResp struct {
	api.BaseResp

	Total     int64                `json:"total"`
	AuditLogs []*auditent.AuditLog `json:"audit_logs"`
}

type ListAuditLogTypesResp struct {
	api.BaseResp

	Types []auditent.AuditLogType `json:"types"`
}

type ListJumpAuditLogReq struct {
	api.PaginationReq

	AuthorizationID string `form:"authorization_id"`
}

type ListJumpAuditLogResp struct {
	api.BaseResp

	Total     int64                `json:"total"`
	AuditLogs []*auditent.AuditLog `json:"items"`
}
