package file_download

import (
	"github.com/pingcap/errors"
)

type ListFileParam struct {
	Provider     string
	Region       string
	OrgID        string
	ProjectID    string
	ClusterID    string
	Instances    string
	StartUnixSec int64
	EndUnixSec   int64
}

func (param *ListFileParam) Validate() error {
	if param.Provider == "" {
		return errors.New("provider not found")
	}
	if param.Region == "" {
		return errors.New("region not found")
	}
	if param.OrgID == "" {
		return errors.New("org id not found")
	}
	if param.ProjectID == "" {
		return errors.New("project id not found")
	}
	if param.ClusterID == "" {
		return errors.New("cluster id not found")
	}
	if param.StartUnixSec == 0 {
		return errors.New("start not found")
	}
	if param.EndUnixSec == 0 {
		return errors.New("end not found")
	}
	return nil
}

type DownloadFileParam struct {
	Provider string
	Region   string
	Key      string
}

func (param *DownloadFileParam) Validate() error {
	if param.Provider == "" {
		return errors.New("provider not found")
	}
	if param.Region == "" {
		return errors.New("region not found")
	}
	if param.Key == "" {
		return errors.New("key not found")
	}
	return nil
}
