package domain

import (
	"time"

	"github.com/tidbcloud/dataflow-service/app/repo/entity"
)

type CreateSinkEndpointReq struct {
	TenantID       uint64
	ProjectID      uint64
	Provider       entity.CloudProviderType
	Region         string
	Zones          []string
	Name           string
	ServiceName    string
	ServiceRegion  string
	IsCustomDomain bool
	RootDomainName string
	DNSRecords     []entity.BizPLEndpointDNSRecord
	Properties     map[string]string
}

type CreateSinkEndpointResp struct {
	SinkEndpoint *entity.BizPrivateLinkEndpoint
}

type ListSinkEndpointsReq struct {
	TenantID  uint64
	ProjectID uint64
	Provider  entity.CloudProviderType
	Region    string
	Status    entity.BizPLEndpointStatus
}

type SinkEndpointWithUsage struct {
	Endpoint  *entity.BizPrivateLinkEndpoint
	UsageInfo *SinkEndpointUsageInfo
}

type ListSinkEndpointsResp struct {
	SinkEndpoints []SinkEndpointWithUsage
}

type QuerySinkEndpointReq struct {
	ID uint64
}

type SinkEndpointUsageInfo struct {
	ChangefeedIds []uint64
	LastUsedAt    *time.Time
}

type QuerySinkEndpointResp struct {
	SinkEndpoint *entity.BizPrivateLinkEndpoint
	UsageInfo    *SinkEndpointUsageInfo
}

type DeleteSinkEndpointReq struct {
	ID uint64
}

type GetAvailabilityZonesReq struct {
	TenantID  uint64
	ProjectID uint64
	Region    string
	Provider  entity.CloudProviderType
}

type GetAvailabilityZonesResp struct {
	Zones []string
}

type GenerateSinkAdvertisedListenerReq struct {
	TenantID     uint64
	ProjectID    uint64
	Region       string
	Provider     entity.CloudProviderType
	Zones        []string
	ServiceName  string
	DownstreamID string
}

type GenerateSinkAdvertisedListenerResp struct {
	RootDomainName string
	DNSRecords     []entity.BizPLEndpointDNSRecord
}

type ValidateSinkAdvertisedListenerDomainReq struct {
	TenantID       uint64
	ProjectID      uint64
	Region         string
	Provider       entity.CloudProviderType
	RootDomainName string
	Zones          []string
}

type ValidateSinkAdvertisedListenerDomainResp struct {
	DNSRecords []entity.BizPLEndpointDNSRecord
}

type GetSinkEndpointAuthInfoReq struct {
	TenantID  uint64
	ProjectID uint64
	Region    string
	Provider  entity.CloudProviderType
}

type GetSinkEndpointAuthInfoResp struct {
	Network        string
	CloudAccountID string
	AWSPrincipalID string
}

type CreateSinkEndpointUsageReq struct {
	SinkEndpointID uint64
	BusinessType   entity.BizPLEndpointUsageBusinessType
	BusinessID     uint64
}

type CreateSinkEndpointUsageResp struct {
	SinkEndpointUsage *entity.BizPrivateLinkEndpointUsage
}

type DeleteSinkEndpointUsageReq struct {
	SinkEndpointID uint64
	BusinessType   entity.BizPLEndpointUsageBusinessType
	BusinessID     uint64
}
