package v1

type WebForwardingDataSend struct {
	WafWebId           int    `form:"waf_web_id" json:"waf_web_id"`
	Tag                string `form:"tag" json:"tag"`
	Port               int    `form:"port" json:"port" binding:"required"`
	Domain             string `form:"domain" json:"domain"`
	CustomHost         string `form:"custom_host" json:"custom_host"`
	WafGatewayGroupId  int    `form:"waf_gateway_group_id" json:"waf_gateway_group_id"`
	WafWebLimitId      int    `form:"waf_web_limit_id" json:"waf_web_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"`
	Cc4xxCount         int    `form:"cc_4xx_count" json:"cc_4xx_count" default:"0"`
	Cc4xxDuration      string `form:"cc_4xx_duration" json:"cc_4xx_duration" default:"0s"`
	Cc4xxBlockCount    int    `form:"cc_4xx_block_count" json:"cc_4xx_block_count" default:"0"`
	Cc4xxBlockDuration string `form:"cc_4xx_block_duration" json:"cc_4xx_block_duration" default:"0s"`
	Cc5xxCount         int    `form:"cc_5xx_count" json:"cc_5xx_count" default:"0"`
	Cc5xxDuration      string `form:"cc_5xx_duration" json:"cc_5xx_duration" default:"0s"`
	Cc5xxBlockCount    int    `form:"cc_5xx_block_count" json:"cc_5xx_block_count" default:"0"`
	Cc5xxBlockDuration string `form:"cc_5xx_block_duration" json:"cc_5xx_block_duration" default:"0s"`
	BackendList        []BackendList `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"`
	IsHttps            int    `form:"is_https" json:"is_https" default:"0"`
	Comment            string `form:"comment" json:"comment"`
	HttpsCert          string `form:"https_cert" json:"https_cert omitempty"`
	HttpsKey           string `form:"https_key" json:"https_key omitempty"`
}


type WebForwardingDataRequest struct {
	Id                 int    `form:"id" json:"id"`
	WafWebId           int    `form:"waf_web_id" json:"waf_web_id"`
	Tag                string `form:"tag" json:"tag"`
	Port               string    `form:"port" json:"port" binding:"required"`
	Domain             string `form:"domain" json:"domain"`
	CustomHost         string `form:"custom_host" json:"custom_host"`
	WafGatewayGroupId  int    `form:"waf_gateway_group_id" json:"waf_gateway_group_id"`
	WafWebLimitId      int    `form:"waf_web_limit_id" json:"waf_web_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"`
	Cc4xxCount         int    `form:"cc_4xx_count" json:"cc_4xx_count" default:"0"`
	Cc4xxDuration      string `form:"cc_4xx_duration" json:"cc_4xx_duration" default:"0s"`
	Cc4xxBlockCount    int    `form:"cc_4xx_block_count" json:"cc_4xx_block_count" default:"0"`
	Cc4xxBlockDuration string `form:"cc_4xx_block_duration" json:"cc_4xx_block_duration" default:"0s"`
	Cc5xxCount         int    `form:"cc_5xx_count" json:"cc_5xx_count" default:"0"`
	Cc5xxDuration      string `form:"cc_5xx_duration" json:"cc_5xx_duration" default:"0s"`
	Cc5xxBlockCount    int    `form:"cc_5xx_block_count" json:"cc_5xx_block_count" default:"0"`
	Cc5xxBlockDuration string `form:"cc_5xx_block_duration" json:"cc_5xx_block_duration" default:"0s"`
	BackendList        []BackendList `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"`
	IsHttps            int    `form:"is_https" json:"is_https" default:"0"`
	Comment            string `form:"comment" json:"comment"`
	HttpsCert          string `form:"https_cert" json:"https_cert"`
	HttpsKey           string `form:"https_key" json:"https_key"`
}

type DeleteWebForwardingRequest 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 WebForwardingRequest struct {
	HostId            int `form:"host_id" json:"host_id" binding:"required"`
	Uid               int `form:"uid" json:"uid" binding:"required"`
	WebForwardingData WebForwardingDataRequest `form:"data" json:"data"`
}

type WebForwardingRequire 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"`
	WafWebLimitRuleId int    `form:"waf_web_limit_id" json:"waf_web_limit_id"`
	Tag               string `form:"tag" json:"tag" binding:"required"`
}

type BackendList struct {
	Addr     string `json:"addr,omitempty" form:"addr"`
	Protocol string `json:"protocol" form:"protocol"`
	Timeout  string `json:"timeout,omitempty" form:"timeout" default:"30s"`
	ProxyV1  bool `json:"proxy_v1,omitempty" form:"proxy_v1" default:"false"`
}


