syntax = "proto3";
option go_package = "./pb";

package pb;

import "models/rpc_messages.proto";

service HTTPHeaderPolicyService {
	// 查找策略配置
	rpc findEnabledHTTPHeaderPolicyConfig (FindEnabledHTTPHeaderPolicyConfigRequest) returns (FindEnabledHTTPHeaderPolicyConfigResponse);

	// 创建策略
	rpc createHTTPHeaderPolicy (CreateHTTPHeaderPolicyRequest) returns (CreateHTTPHeaderPolicyResponse);

	// 修改AddHeaders
	rpc updateHTTPHeaderPolicyAddingHeaders (UpdateHTTPHeaderPolicyAddingHeadersRequest) returns (RPCSuccess);

	// 修改SetHeaders
	rpc updateHTTPHeaderPolicySettingHeaders (UpdateHTTPHeaderPolicySettingHeadersRequest) returns (RPCSuccess);

	// 修改AddTrailers
	rpc updateHTTPHeaderPolicyAddingTrailers (UpdateHTTPHeaderPolicyAddingTrailersRequest) returns (RPCSuccess);

	// 修改ReplaceHeaders
	rpc updateHTTPHeaderPolicyReplacingHeaders (UpdateHTTPHeaderPolicyReplacingHeadersRequest) returns (RPCSuccess);

	// 修改删除的Headers
	rpc updateHTTPHeaderPolicyDeletingHeaders (UpdateHTTPHeaderPolicyDeletingHeadersRequest) returns (RPCSuccess);
}

// 查找策略
message FindEnabledHTTPHeaderPolicyConfigRequest {
	int64 headerPolicyId = 1;
}

message FindEnabledHTTPHeaderPolicyConfigResponse {
	bytes headerPolicyJSON = 1;
}

// 创建策略
message CreateHTTPHeaderPolicyRequest {

}

message CreateHTTPHeaderPolicyResponse {
	int64 headerPolicyId = 1;
}

// 修改AddHeaders
message UpdateHTTPHeaderPolicyAddingHeadersRequest {
	int64 headerPolicyId = 1;
	bytes headersJSON = 2;
}

// 修改SetHeaders
message UpdateHTTPHeaderPolicySettingHeadersRequest {
	int64 headerPolicyId = 1;
	bytes headersJSON = 2;
}

// 修改AddTrailers
message UpdateHTTPHeaderPolicyAddingTrailersRequest {
	int64 headerPolicyId = 1;
	bytes headersJSON = 2;
}

// 修改ReplaceHeaders
message UpdateHTTPHeaderPolicyReplacingHeadersRequest {
	int64 headerPolicyId = 1;
	bytes headersJSON = 2;
}

// 修改删除的Headers
message UpdateHTTPHeaderPolicyDeletingHeadersRequest {
	int64 headerPolicyId = 1;
	repeated string headerNames = 2;
}