package constant

import "github.com/tidbcloud/idl/pbgen/proto/openapi/cm"

// Cloud Marketplace Provider
const (
	AWSAccountProvider = "aws_account_provider"
	GCPAccountProvider = "gcp_account_provider"

	CloudProviderAWS string = "aws"
	CloudProviderGCP string = "gcp"
)

// Cluster Node Quantity Range
const (
	MinTiDBNodeQuantity     = 1
	MinTiKVNodeQuantity     = 3
	MinTiFlashNodeQuantity  = 0
	TiDBNodeQuantityStep    = 1
	TiKVNodeQuantityStep    = 3
	TiFlashNodeQuantityStep = 1
	DevTierMinNodeQuantity  = 1
	DevTierNodeQuantityStep = 1
)

var (
	// DisplayNodeMapClusterStatuses ... The `node_map` is returned only when the `status` is `AVAILABLE` or `MODIFYING`.
	DisplayNodeMapClusterStatuses = []cm.ClusterStatus{cm.ClusterStatus_AVAILABLE, cm.ClusterStatus_MODIFYING}
)

func DisplayNodeMap(status cm.ClusterStatus) bool {
	for _, s := range DisplayNodeMapClusterStatuses {
		if s == status {
			return true
		}
	}
	return false
}
