package entity

import dataflowgprc "github.com/tidbcloud/dataflow-service/idl/pbgen/proto/agent"

// @Time    : 2024/8/21 15:16
// @Author  : lvhongmeng

type taskStatus uint8

type TaskProgress struct {
	Tables  map[string]*TableProgress `json:"t"`
	Status  taskStatus                `json:"s"`
	Message string                    `json:"m,omitempty"`
}

type TableProgress struct {
	TotalWritten int64      `json:"w"`
	TotalSize    int64      `json:"z"`
	Status       taskStatus `json:"s"`
	Message      string     `json:"m,omitempty"`
}

type AWSNetworkSpec struct {
	NodeRoleARN    string
	ExternalID     string
	AccountID      string
	NodeSubnets    []string
	EKSClusterName string
}

type GCPNetworkSpec struct {
	ServiceAccountEmail string
	ProjectID           string
}

type RegionalNetwork struct {
	AWS              *AWSNetworkSpec
	GCP              *GCPNetworkSpec
	DataflowAgentUrl string
	Cidr             string
	ExternalIPs      []string
}

type ImportProgressParam struct {
	Namespace string `json:"namespace"`
	Svn       string `json:"svn"`
	ClusterId uint64 `json:"cluster_id"`
}

type ImportPrecheckParam struct {
	LightningPrecheck *dataflowgprc.LightningPrecheckReq `json:"lightning_precheck"`
	ClusterId         uint64                             `json:"cluster_id"`
}

type SearchImportFilesParam struct {
	SearchImportFiles *dataflowgprc.SearchImportFilesReq `json:"search_import_files"`
	ClusterId         uint64                             `json:"cluster_id"`
}

type PrecheckImportFileParam struct {
	PrecheckImportFile *dataflowgprc.PrecheckImportFileReq `json:"precheck_import_file"`
	ClusterId          uint64                              `json:"cluster_id"`
}
