package entity

type ListAlertSubscribersResponse struct {
	AlertSubscribers []AlertSubscribersItem `json:"alertSubscribers"`
	TotalSize        int                    `json:"totalSize"`
}

type AlertSubscribersItem struct {
	ID             uint                `json:"id"`
	SubscriberType AlertSubscriberType `json:"subscriberType"`
	Name           string              `json:"name"`
	Email          string              `json:"email,omitempty"`
	SlackUrl       string              `json:"slackUrl,omitempty"`
	ZoomUrl        string              `json:"zoomUrl,omitempty"`
	ZoomToken      string              `json:"zoomToken,omitempty"`
	FlashDutyUrl   string              `json:"flashDutyUrl,omitempty"`
	PagerDutyKey   string              `json:"pagerDutyKey,omitempty"`
	WebhookUrl     string              `json:"webhookUrl,omitempty"`
	LarkWebhookUrl string              `json:"larkWebhookUrl,omitempty"`
	LarkSecret     string              `json:"larkSecret,omitempty"`
}

type SupportPlanType string

const (
	SupportPlanTypeBasic      SupportPlanType = "Basic"
	SupportPlanTypeDeveloper  SupportPlanType = "Developer"
	SupportPlanTypeEnterprise SupportPlanType = "Enterprise"
	SupportPlanTypePremium    SupportPlanType = "Premium"
)

type GetAlertSubscriberQuotaResponse struct {
	SupportPlan              SupportPlanType `json:"supportPlan"`
	MaxAlertSubscribersCount int             `json:"maxAlertSubscribersCount"`
}

type AlertSubscriberType string

const (
	AlertSubscriberTypeEmail     AlertSubscriberType = "EMAIL"
	AlertSubscriberTypeSlack     AlertSubscriberType = "SLACK"
	AlertSubscriberTypeZoom      AlertSubscriberType = "ZOOM"
	AlertSubscriberTypeFlashDuty AlertSubscriberType = "FLASHDUTY"
	AlertSubscriberTypePagerDuty AlertSubscriberType = "PAGERDUTY"
	AlertSubscriberTypeWebhook   AlertSubscriberType = "WEBHOOK"
	AlertSubscriberTypeLark      AlertSubscriberType = "LARK"
)

type ClusterDeployType string

const (
	ClusterDeployTypeUndefined ClusterDeployType = "UNDEFINED"
	ClusterDeployTypeDedicated ClusterDeployType = "DEDICATED"
	ClusterDeployTypeNextGen   ClusterDeployType = "NEXT-GEN"
)

type CreateAlertSubscriberRequest struct {
	SubscriberType AlertSubscriberType `json:"subscriberType" binding:"required"`
	Name           string              `json:"name"`
	Email          string              `json:"email"`
	SlackUrl       string              `json:"slackUrl"`
	ZoomUrl        string              `json:"zoomUrl"`
	ZoomToken      string              `json:"zoomToken"`
	FlashDutyUrl   string              `json:"flashDutyUrl"`
	PagerDutyKey   string              `json:"pagerDutyKey"`
	WebhookUrl     string              `json:"webhookUrl"`
	LarkWebhookUrl string              `json:"larkWebhookUrl"`
	LarkSecret     string              `json:"larkSecret"`
	DryRun         bool                `json:"dryRun"`
}

type UpdateAlertSubscriberRequest struct {
	Name           string `json:"name"`
	Email          string `json:"email"`
	SlackUrl       string `json:"slackUrl"`
	ZoomUrl        string `json:"zoomUrl"`
	ZoomToken      string `json:"zoomToken"`
	FlashDutyUrl   string `json:"flashDutyUrl"`
	PagerDutyKey   string `json:"pagerDutyKey"`
	WebhookUrl     string `json:"webhookUrl"`
	LarkWebhookUrl string `json:"larkWebhookUrl"`
	LarkSecret     string `json:"larkSecret"`
	DryRun         bool   `json:"dryRun"`
}

type ListAlertNotificationsResp struct {
	AlertNotifications []*AlertNotificationItem `json:"alertNotifications"`
	TotalSize          int                      `json:"totalSize"`
}

type AlertNotificationItem struct {
	ID           uint   `json:"id"`
	CreatedAt    string `json:"createdAt"`
	TenantID     uint64 `json:"tenantId"`
	ProjectID    uint64 `json:"projectId"`
	ClusterID    uint64 `json:"clusterId"`
	SubscriberID uint64 `json:"subscriberId"`
	AlertContent string `json:"alertContent"`
	Status       string `json:"status"`
	Message      string `json:"message"`
}

type GetAlertmanagerTokenResponse struct {
	Username string `json:"username"`
	Password string `json:"password"`
}
