package v1

type TcpForwardingDataSend struct {
	WafTcpId          int    `form:"waf_tcp_id" json:"waf_tcp_id"`
	Tag               string `form:"tag" json:"tag"`
	Port              string    `form:"port" json:"port" binding:"required"`
	WafGatewayGroupId int    `form:"waf_gateway_group_id" json:"waf_gateway_group_id"`
	WafTcpLimitRuleId int    `form:"waf_tcp_limit_id" json:"waf_tcp_limit_id"`
	CcCount           int    `form:"cc_count" json:"cc_count" default:"0"`
	CcDuration        string `form:"cc_duration" json:"cc_duration" default:"0s"`
	CcBlockCount      int    `form:"cc_block_count" json:"cc_block_count" default:"0"`
	CcBlockDuration   string `form:"cc_block_duration" json:"cc_block_duration" default:"0s"`
	BackendProtocol   string `form:"backend_protocol" json:"backend_protocol" default:"tcp"`
	BackendTimeout    string `form:"backend_timeout" json:"backend_timeout" default:"5s"`
	BackendList       string `form:"backend_list" json:"backend_list"`
	AllowIpList       string `form:"allow_ip_list" json:"allow_ip_list"`
	DenyIpList        string `form:"deny_ip_list" json:"deny_ip_list"`
	AccessRule        string `form:"access_rule" json:"access_rule"`
	Comment           string `form:"comment" json:"comment"`
}


type TcpForwardingDataRequest struct {
	Id                int    `form:"id" json:"id"`
	WafTcpId          int    `form:"waf_tcp_id" json:"waf_tcp_id"`
	Tag               string `form:"tag" json:"tag"`
	Port              string    `form:"port" json:"port" binding:"required"`
	WafGatewayGroupId int    `form:"waf_gateway_group_id" json:"waf_gateway_group_id"`
	WafTcpLimitRuleId int    `form:"waf_tcp_limit_id" json:"waf_tcp_limit_id"`
	CcCount           int    `form:"cc_count" json:"cc_count" default:"0"`
	CcDuration        string `form:"cc_duration" json:"cc_duration" default:"0s"`
	CcBlockCount      int    `form:"cc_block_count" json:"cc_block_count" default:"0"`
	CcBlockDuration   string `form:"cc_block_duration" json:"cc_block_duration" default:"0s"`
	BackendProtocol   string `form:"backend_protocol" json:"backend_protocol" default:"tcp"`
	BackendTimeout    string `form:"backend_timeout" json:"backend_timeout" default:"5s"`
	BackendList       []string `form:"backend_list" json:"backend_list"`
	AllowIpList       []string `form:"allow_ip_list" json:"allow_ip_list"`
	DenyIpList        []string `form:"deny_ip_list" json:"deny_ip_list"`
	AccessRule        string `form:"access_rule" json:"access_rule"`
	Comment           string `form:"comment" json:"comment"`
}

type DeleteTcpForwardingRequest struct {
	Ids   []int `form:"ids" json:"ids" binding:"required"`
	Uid   int   `form:"uid" json:"uid" binding:"required"`
	HostId   int   `form:"host_id" json:"host_id" binding:"required"`
}

type TcpForwardingRequest struct {
	HostId            int `form:"host_id" json:"host_id" binding:"required"`
	Uid               int `form:"uid" json:"uid" binding:"required"`
	TcpForwardingData TcpForwardingDataRequest `form:"data" json:"data"`
}
type TcpForwardingRequire struct {
	HostId            int    `form:"host_id" json:"host_id" binding:"required"`
	Uid               int    `form:"uid" json:"uid" binding:"required"`
	Comment           string `form:"comment" json:"comment" binding:"required"`
	WafGatewayGroupId int    `form:"waf_gateway_group_id" json:"waf_gateway_group_id"`
	WafTcpLimitRuleId int    `form:"waf_tcp_limit_id" json:"waf_tcp_limit_id"`
	Tag               string `form:"tag" json:"tag" binding:"required"`
}
