package entity

// TiCDCClusterStatus is the status of the cdc cluster
type TiCDCClusterStatus string

const (
	TiCDCClusterStatusCreating  TiCDCClusterStatus = "creating"
	TiCDCClusterStatusRunning   TiCDCClusterStatus = "running"
	TiCDCClusterStatusDeleting  TiCDCClusterStatus = "deleting"
	TiCDCClusterStatusDeleted   TiCDCClusterStatus = "deleted"
	TiCDCClusterStatusScaling   TiCDCClusterStatus = "scaling"
	TiCDCClusterStatusUpgrading TiCDCClusterStatus = "upgrading"
)

type TiCDCChangefeedDownStreamType string

const (
	TiCDCDownStreamTypeMySQL      TiCDCChangefeedDownStreamType = "mysql"
	TiCDCDownStreamTypeKafka      TiCDCChangefeedDownStreamType = "kafka"
	TiCDCDownStreamTypeS3         TiCDCChangefeedDownStreamType = "s3"
	TiCDCDownStreamTypeGCS        TiCDCChangefeedDownStreamType = "gcs"
	TiCDCDownStreamTypeServerless TiCDCChangefeedDownStreamType = "serverless_tidb"
	TiCDCDownStreamTypePulsar     TiCDCChangefeedDownStreamType = "pulsar"
)

// TiCDCChangefeedKernelStatus describes whether the kernel-side changefeed has
// been confirmed created. The DAG-driven creation flow persists the row with
// status=pending before talking to regional, then flips to active only after
// the kernel acknowledges the changefeed exists. Existing rows default to
// 'active' so the new field is backwards-compatible without a backfill.
type TiCDCChangefeedKernelStatus string

const (
	TiCDCChangefeedKernelStatusPending TiCDCChangefeedKernelStatus = "pending"
	TiCDCChangefeedKernelStatusActive  TiCDCChangefeedKernelStatus = "active"
)

// TiCDCClusterStatus is the status of the cdc cluster
type TiCDCClusterActionType string

const (
	TiCDCClusterActionCreate TiCDCClusterActionType = "create"
	TiCDCClusterActionDelete TiCDCClusterActionType = "delete"
	TiCDCClusterActionScale  TiCDCClusterActionType = "scale"
)

// CDCDownStreamType is the type of the CDC downstream
type CDCDownStreamType string

const (
	CDCDownStreamTypeMysql          CDCDownStreamType = "mysql"
	CDCDownStreamTypeKafka          CDCDownStreamType = "kafka"
	CDCDownStreamTypeServerlessTiDB CDCDownStreamType = "serverless_tidb"
	CDCDownStreamTypeS3             CDCDownStreamType = "s3"
	CDCDownStreamTypeGCS            CDCDownStreamType = "gcs"
	CDCDownStreamTypeAll            CDCDownStreamType = "all"
)

// CDCStatus is the status of the CDC
type CDCStatus string

const (
	CDCStatusCreating CDCStatus = "creating"
	CDCStatusNormal   CDCStatus = "normal"
	CDCStatusDeleting CDCStatus = "deleting"
	CDCStatusDeleted  CDCStatus = "deleted"
	CDCStatusError    CDCStatus = "error"
	CDCStatusFailed   CDCStatus = "failed"
	CDCStatusStarting CDCStatus = "starting"
	CDCStatusStopping CDCStatus = "stopping"
	CDCStatusStopped  CDCStatus = "stopped"
	CDCStatusEditing  CDCStatus = "editing"
	CDCStatusScaling  CDCStatus = "scaling"
)

type CloudProviderType string

const (
	CloudProviderTypeAWS      CloudProviderType = "aws"
	CloudProviderTypeGCP      CloudProviderType = "gcp"
	CloudProviderTypeAzure    CloudProviderType = "azure"
	CloudProviderTypeAliCloud CloudProviderType = "alicloud"
)

type ChangefeedKernelStatus string

const (
	ChangefeedKernelStatusNormal  ChangefeedKernelStatus = "normal"
	ChangefeedKernelStatusError   ChangefeedKernelStatus = "error"
	ChangefeedKernelStatusWarning ChangefeedKernelStatus = "warning"
	ChangefeedKernelStatusFailed  ChangefeedKernelStatus = "failed"
	ChangefeedKernelStatusStopped ChangefeedKernelStatus = "stopped"
)

type BizChangefeedOperationStatus string

const (
	BizChangefeedOperationStatusCreating BizChangefeedOperationStatus = "creating"
	BizChangefeedOperationStatusNormal   BizChangefeedOperationStatus = "normal"
	BizChangefeedOperationStatusScaling  BizChangefeedOperationStatus = "scaling"
	BizChangefeedOperationStatusPaused   BizChangefeedOperationStatus = "paused"
	BizChangefeedOperationStatusDeleting BizChangefeedOperationStatus = "deleting"
	BizChangefeedOperationStatusDeleted  BizChangefeedOperationStatus = "deleted"
	BizChangefeedOperationStatusFailed   BizChangefeedOperationStatus = "failed" // create kernel changefeed failed
)

type ChangefeedDownstreamNetworkType string

const (
	ChangefeedDownstreamNetworkTypeUnknown     ChangefeedDownstreamNetworkType = "unknown"
	ChangefeedDownstreamNetworkTypeInternet    ChangefeedDownstreamNetworkType = "internet"
	ChangefeedDownstreamNetworkTypeVPCPeering  ChangefeedDownstreamNetworkType = "vpc_peering"
	ChangefeedDownstreamNetworkTypePrivateLink ChangefeedDownstreamNetworkType = "private_link"
)
