//go:generate ${GOBIN}/mockgen -destination k8sresource_service_mock.go -package=k8sresource ${GO_MODULE}/pkg/service/k8sresource K8SResourceServiceAPI
package k8sresource

import (
	"context"
	"time"

	k8sresourceent "github.com/tidbcloud/devops/entity/k8sresource"
	regionalv1 "github.com/tidbcloud/infra-provider/api/tidbcloud/regional-server/v1"
)

type GetK8SResourceReq struct {
	ClusterId    string `json:"cluster_id"`
	Namespace    string `json:"namespace"`
	ResourceKind string `json:"resource_kind"`
	ResourceName string `json:"resource_name"`
}

type ListK8SResourcesParams struct {
	BeginTime time.Time
	EndTime   time.Time

	ClusterId string
	Namespace string
	Region    string

	Page    int
	PerPage int
}

type ListDedicatedK8sResourcesParams struct {
	Region        string
	CloudProvider string
	Req           *regionalv1.ListK8SResourcesRequest
}

type K8SResourceServiceAPI interface {
	GetControlplaneK8SResource(ctx context.Context, req *GetK8SResourceReq) (string, error)
	ListK8SResources(ctx context.Context, params *ListK8SResourcesParams) ([]*k8sresourceent.K8SResource, int64, error)
	ListDedicatedK8sResources(ctx context.Context, params *ListDedicatedK8sResourcesParams) (*regionalv1.ListK8SResourcesResponse, error)
}
