package configcenter

import (
	"context"

	"github.com/tidbcloud/devops/entity"
	"github.com/tidbcloud/devops/pkg/service"
)

type GetApplyPolicyReq struct {
	ParamName string
	Version   int64
}

type ListAttributesReq struct {
	ParamName string
	Version   string
	Component string
}

type CopyFromVersionReq struct {
	FromVersion string
	ToVersion   string
}

type ModifyReq struct {
	ConfigAttribute *entity.ConfigAttributes
}

type AddAttributeReq entity.ConfigAttributes

type ConfigCenterServiceAPI interface {
	GetApplyPolicy(ctx context.Context, param GetApplyPolicyReq) (entity.ApplyStrategy, error)
	ListAttributes(ctx context.Context, param ListAttributesReq) ([]*entity.ConfigAttributes, error)
	AddAttribute(ctx context.Context, param AddAttributeReq) error
	CopyFromVersion(ctx context.Context, param CopyFromVersionReq) error
	Modify(ctx context.Context, param ModifyReq) error
}

type ConfigCenterService interface {
	ConfigCenterServiceAPI

	service.Service
}
