package k8sresource

// ListDedicatedK8sResourcesQuery routes the request to a Dedicated regional-server.
// Provide either region+cloud_provider, or cluster_id (Dedicated cluster only).
type ListDedicatedK8sResourcesQuery struct {
	// Logical region name used in devops/mgmt proxy paths (e.g. us-west-2, ap-southeast-1),
	// not the internal enum name (e.g. AWS_US_WEST_2). Required with cloud_provider unless cluster_id is set.
	Region string `form:"region" json:"region"`
	// Cloud provider for the Dedicated region (e.g. aws, gcp, azure). Required with region unless cluster_id is set.
	CloudProvider string `form:"cloud_provider" json:"cloud_provider"`
	// Dedicated cluster ID; used to resolve region and cloud_provider when they are omitted.
	ClusterId string `form:"cluster_id" json:"cluster_id"`
}

// ListDedicatedK8sResourcesBody mirrors regional-server ListK8sResourcesRequest JSON (protojson).
type ListDedicatedK8sResourcesBody struct {
	PlaneType string                  `json:"planeType"`
	DataPlane *DedicatedDataPlaneBody `json:"dataPlane,omitempty"`
	Gvk       *DedicatedGVKBody       `json:"gvk"`
	Selector  *DedicatedSelectorBody  `json:"selector"`
	Option    *DedicatedOptionBody    `json:"option,omitempty"`
}

type DedicatedDataPlaneBody struct {
	ProjectId string `json:"projectId,omitempty"`
	ClusterId string `json:"clusterId,omitempty"`
}

type DedicatedGVKBody struct {
	Group   string `json:"group,omitempty"`
	Version string `json:"version,omitempty"`
	Kind    string `json:"kind"`
}

type DedicatedSelectorBody struct {
	Namespace string                     `json:"namespace,omitempty"`
	Name      string                     `json:"name,omitempty"`
	Label     map[string]string          `json:"label,omitempty"`
	Field     []DedicatedFieldFilterBody `json:"field,omitempty"`
}

type DedicatedFieldFilterBody struct {
	Key      string `json:"key"`
	Operator string `json:"operator,omitempty"`
	Value    string `json:"value,omitempty"`
}

type DedicatedOptionBody struct {
	Detail   bool  `json:"detail,omitempty"`
	Events   bool  `json:"events,omitempty"`
	MaxItems int32 `json:"maxItems,omitempty"`
}

type ListDedicatedK8sResourcesResp struct {
	ContentType string `json:"content_type"`
	Content     string `json:"content"`
	Truncated   bool   `json:"truncated,omitempty"`
	Hints       string `json:"hints,omitempty"`
	ItemCount   int32  `json:"item_count,omitempty"`
}
