package k8sresource

import (
	"time"

	"github.com/tidbcloud/devops/api"
	k8sresourceent "github.com/tidbcloud/devops/entity/k8sresource"
)

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

type GetK8SResourceResp struct {
	Metadata string `json:"metadata"`
}

type ListK8SResourcesReq struct {
	api.PaginationReq `json:",inline"`

	ClusterId string `form:"cluster_id" json:"cluster_id"`
	Namespace string `form:"namespace" json:"namespace"`
	Region    string `form:"region" json:"region"`

	BeginTime time.Time `form:"begin_time" json:"begin_time" time_format:"2006-01-02T15:04:05"`
	EndTime   time.Time `form:"end_time" json:"end_time" time_format:"2006-01-02T15:04:05"`
}

type ListK8SResourcesResp struct {
	Total     int64                        `json:"total"`
	Resources []k8sresourceent.K8SResource `json:"items"`
}

type ListClusterResourcesResp struct {
	Resources []ClusterResource `json:"resources"`
}

type ClusterResource struct {
	Key         string `json:"key,omitempty"`
	DisplayName string `json:"display_name,omitempty"`
	Description string `json:"description,omitempty"`
	Type        string `json:"type,omitempty"`
	Content     string `json:"content,omitempty"`
}
