package provider

import "github.com/tidbcloud/aws-shared-provider/tools/cloud-instances/types"

// RawPart represents a raw payload returned by a provider.
// Scope is either "global" or a region ID.
type RawPart struct {
	Scope  string
	Name   string
	Data   []byte
	Source string
}

// RawBundle groups raw parts for a provider/region request.
type RawBundle struct {
	Provider string
	Region   string
	Parts    []RawPart
}

// CloudProvider defines the interface that all cloud providers must implement
type CloudProvider interface {
	// DownloadRaw downloads raw data for a specific region/zone
	DownloadRaw(region string) (*RawBundle, error)

	// ParseRaw converts raw data into unified format
	ParseRaw(raw *RawBundle) (*types.UnifiedData, error)

	// GetRegions returns a map of region IDs to display names
	GetRegions() map[string]string

	// IsValidRegion checks if a region ID is valid
	IsValidRegion(regionID string) bool

	// GetRegionName converts region ID to display name
	GetRegionName(regionID string) string

	// GetCacheFileName generates the cache filename for a region
	GetCacheFileName(region string) string

	// GetProviderName returns the provider identifier
	GetProviderName() string
}
