package repository

import (
	"context"

	"github.com/tidbcloud/tidb-management-service/tidb-mgmt-service/domain/entity"
)

// FsRegionRepository is the persistence interface for fs regions.
//
//go:generate go run go.uber.org/mock/mockgen@latest -source=$GOFILE -package=mock_$GOPACKAGE -destination=./mock_$GOPACKAGE/mock_fs_region.go
type FsRegionRepository interface {
	// List returns fs regions. If cloudProvider is not empty, only regions of
	// the specified cloud provider are returned. If status is not empty, only
	// regions with the specified status are returned.
	List(ctx context.Context, cloudProvider, status string) ([]*entity.FsRegion, error)
	// Get returns the fs region for the given cloud provider and region code.
	Get(ctx context.Context, cloudProvider, region string) (*entity.FsRegion, error)
	// Create creates a new fs region record.
	Create(ctx context.Context, region *entity.FsRegion) (*entity.FsRegion, error)
	// Update updates the display name and service address of an existing fs region.
	Update(ctx context.Context, region *entity.FsRegion) (*entity.FsRegion, error)
}
