package domain

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

type CreateSinkEndpointReq struct {
	ClusterID uint64
	UserID    uint64
	UserEmail string
	Name      string
	// EndpointType selects the private-link model. Empty defaults to
	// vpc_endpoint_service for backward compatibility.
	EndpointType entity.BizSinkEndpointType

	// vpc_endpoint_service fields
	Zones          []string
	ServiceName    string
	ServiceRegion  string
	IsCustomDomain bool
	RootDomainName string
	DNSRecords     []entity.BizSinkEndpointDNSRecord

	// amazon_msk fields
	MSKArn   string
	AuthType entity.BizSinkEndpointAuthType
}

type CreateSinkEndpointResp struct {
	SinkEndpoint *entity.BizSinkEndpoint
}

type ListSinkEndpointsReq struct {
	ClusterID uint64
	Status    entity.BizSinkEndpointStatus
}

type ListSinkEndpointsResp struct {
	SinkEndpoints []entity.BizSinkEndpoint
}

type QuerySinkEndpointReq struct {
	ID uint64
	// ClusterID is required to scope endpoint queries by tenant and shared pool.
	ClusterID uint64
}

type QuerySinkEndpointResp struct {
	SinkEndpoint *entity.BizSinkEndpoint
}

type DeleteSinkEndpointReq struct {
	ID        uint64
	ProjectID uint64
	UserID    uint64
	UserEmail string
	// ClusterID is required to scope endpoint deletion by tenant and shared pool.
	ClusterID uint64
}

type GetAvailabilityZonesReq struct {
	ClusterID uint64
}

type GetAvailabilityZonesResp struct {
	Zones []string
}

type EndpointServiceAvailabilityZone struct {
	AvailabilityZone   string
	AvailabilityZoneID string
}

type DescribeEndpointServiceAvailabilityZonesReq struct {
	ClusterID     uint64
	ServiceName   string
	ServiceRegion string
}

type DescribeEndpointServiceAvailabilityZonesResp struct {
	Zones []EndpointServiceAvailabilityZone
}

type GenerateSinkAdvertisedListenerReq struct {
	ClusterID    uint64
	Zones        []string
	ServiceName  string
	DownstreamID string
}

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

type ValidateSinkAdvertisedListenerDomainReq struct {
	ClusterID      uint64
	ServiceName    string
	RootDomainName string
	Zones          []string
}

type ValidateSinkAdvertisedListenerDomainResp struct {
	DNSRecords []entity.BizSinkEndpointDNSRecord
}

type CreateSinkEndpointUsageReq struct {
	SinkEndpointID uint64
	OwnerID        string
	UsageType      entity.BizSinkEndpointUsageType
}

type CreateSinkEndpointUsageResp struct {
	SinkEndpointUsage *entity.BizSinkEndpointUsage
}

type DeleteSinkEndpointUsageReq struct {
	SinkEndpointID uint64
	OwnerID        string
	UsageType      entity.BizSinkEndpointUsageType
}

type GetSinkEndpointAuthInfoReq struct {
	ClusterID uint64
}

type GetSinkEndpointAuthInfoResp struct {
	CloudAccountID string
	AWSPrincipalID string
}
