package receive

type ClusterEvent struct {
	TenantID  uint64 `json:"tenant_id,string"`
	ProjectID uint64 `json:"project_id,string"`
	ClusterID uint64 `json:"cluster_id,string"`

	OperatorID       uint64 `json:"operator_id,string"`
	UserEmail        string `json:"user_email"`
	OpenAPIPublicKey string `json:"openapi_public_key"`

	OperationID uint64 `json:"operation_id,string"`

	IsDevTier        bool      `json:"is_dev_tier"`
	Status           string    `json:"status"`
	EventType        EventType `json:"event_type"`
	EventCreatedAtMs int64     `json:"event_created_at_ms,string"`
	ServicePlan      string    `json:"service_plan,omitempty"`
	ClusterType      string    `json:"cluster_type,omitempty"`
}

type (
	EventType   string
	ClusterType string
)

const (
	ClusterEventTypeCreating  EventType = "ClusterCreating"
	ClusterEventTypeCreated   EventType = "ClusterCreated"
	ClusterEventTypeLaunching EventType = "ClusterLaunching"
	ClusterEventTypeDeleting  EventType = "ClusterDeleting"
	ClusterEventTypeDeleted   EventType = "ClusterDeleted"
)

const ClusterTypeTidbxInstance = "tidbx_instance"
const ClusterTypeDedicatedCluster = "dedicated_cluster"
const ClusterTypeTidbxResourcePool = "tidbx_resource_pool"
