// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v7.35.1
// source: envoy/config/filter/network/kafka_broker/v2alpha1/kafka_broker.proto

package v2alpha1

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// [#protodoc-title: Kafka Broker]
// Kafka Broker :ref:`configuration overview <config_network_filters_kafka_broker>`.
// [#extension: envoy.filters.network.kafka_broker]
// [#next-free-field: 6]
type KafkaBroker struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The prefix to use when emitting :ref:`statistics <config_network_filters_kafka_broker_stats>`.
	StatPrefix string `protobuf:"bytes,1,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
	// Set to true if broker filter should attempt to serialize the received responses from the
	// upstream broker instead of passing received bytes as is.
	// Disabled by default.
	ForceResponseRewrite bool `protobuf:"varint,2,opt,name=force_response_rewrite,json=forceResponseRewrite,proto3" json:"force_response_rewrite,omitempty"`
	// Optional broker address rewrite specification.
	// Allows the broker filter to rewrite Kafka responses so that all connections established by
	// the Kafka clients point to Envoy.
	// This allows Kafka cluster not to configure its 'advertised.listeners' property
	// (as the necessary re-pointing will be done by this filter).
	// This collection of rules should cover all brokers in the cluster that is being proxied,
	// otherwise some nodes' addresses might leak to the downstream clients.
	//
	// Types that are valid to be assigned to BrokerAddressRewriteSpec:
	//
	//	*KafkaBroker_IdBasedBrokerAddressRewriteSpec
	BrokerAddressRewriteSpec isKafkaBroker_BrokerAddressRewriteSpec `protobuf_oneof:"broker_address_rewrite_spec"`
	// Optional list of allowed Kafka API keys. Only requests with provided API keys will be
	// routed, otherwise the connection will be closed. No effect if empty.
	ApiKeysAllowed []uint32 `protobuf:"varint,4,rep,packed,name=api_keys_allowed,json=apiKeysAllowed,proto3" json:"api_keys_allowed,omitempty"`
	// Optional list of denied Kafka API keys. Requests with API keys matching this list will have
	// the connection closed. No effect if empty.
	ApiKeysDenied []uint32 `protobuf:"varint,5,rep,packed,name=api_keys_denied,json=apiKeysDenied,proto3" json:"api_keys_denied,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *KafkaBroker) Reset() {
	*x = KafkaBroker{}
	mi := &file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *KafkaBroker) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*KafkaBroker) ProtoMessage() {}

func (x *KafkaBroker) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use KafkaBroker.ProtoReflect.Descriptor instead.
func (*KafkaBroker) Descriptor() ([]byte, []int) {
	return file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescGZIP(), []int{0}
}

func (x *KafkaBroker) GetStatPrefix() string {
	if x != nil {
		return x.StatPrefix
	}
	return ""
}

func (x *KafkaBroker) GetForceResponseRewrite() bool {
	if x != nil {
		return x.ForceResponseRewrite
	}
	return false
}

func (x *KafkaBroker) GetBrokerAddressRewriteSpec() isKafkaBroker_BrokerAddressRewriteSpec {
	if x != nil {
		return x.BrokerAddressRewriteSpec
	}
	return nil
}

func (x *KafkaBroker) GetIdBasedBrokerAddressRewriteSpec() *IdBasedBrokerRewriteSpec {
	if x != nil {
		if x, ok := x.BrokerAddressRewriteSpec.(*KafkaBroker_IdBasedBrokerAddressRewriteSpec); ok {
			return x.IdBasedBrokerAddressRewriteSpec
		}
	}
	return nil
}

func (x *KafkaBroker) GetApiKeysAllowed() []uint32 {
	if x != nil {
		return x.ApiKeysAllowed
	}
	return nil
}

func (x *KafkaBroker) GetApiKeysDenied() []uint32 {
	if x != nil {
		return x.ApiKeysDenied
	}
	return nil
}

type isKafkaBroker_BrokerAddressRewriteSpec interface {
	isKafkaBroker_BrokerAddressRewriteSpec()
}

type KafkaBroker_IdBasedBrokerAddressRewriteSpec struct {
	// Broker address rewrite rules that match by broker ID.
	IdBasedBrokerAddressRewriteSpec *IdBasedBrokerRewriteSpec `protobuf:"bytes,3,opt,name=id_based_broker_address_rewrite_spec,json=idBasedBrokerAddressRewriteSpec,proto3,oneof"`
}

func (*KafkaBroker_IdBasedBrokerAddressRewriteSpec) isKafkaBroker_BrokerAddressRewriteSpec() {}

// Collection of rules matching by broker ID.
type IdBasedBrokerRewriteSpec struct {
	state         protoimpl.MessageState      `protogen:"open.v1"`
	Rules         []*IdBasedBrokerRewriteRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *IdBasedBrokerRewriteSpec) Reset() {
	*x = IdBasedBrokerRewriteSpec{}
	mi := &file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *IdBasedBrokerRewriteSpec) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*IdBasedBrokerRewriteSpec) ProtoMessage() {}

func (x *IdBasedBrokerRewriteSpec) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use IdBasedBrokerRewriteSpec.ProtoReflect.Descriptor instead.
func (*IdBasedBrokerRewriteSpec) Descriptor() ([]byte, []int) {
	return file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescGZIP(), []int{1}
}

func (x *IdBasedBrokerRewriteSpec) GetRules() []*IdBasedBrokerRewriteRule {
	if x != nil {
		return x.Rules
	}
	return nil
}

// Defines a rule to rewrite broker address data.
type IdBasedBrokerRewriteRule struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Broker ID to match.
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// The host value to use (resembling the host part of Kafka's advertised.listeners).
	// The value should point to the Envoy (not Kafka) listener, so that all client traffic goes
	// through Envoy.
	Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	// The port value to use (resembling the port part of Kafka's advertised.listeners).
	// The value should point to the Envoy (not Kafka) listener, so that all client traffic goes
	// through Envoy.
	Port          uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *IdBasedBrokerRewriteRule) Reset() {
	*x = IdBasedBrokerRewriteRule{}
	mi := &file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *IdBasedBrokerRewriteRule) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*IdBasedBrokerRewriteRule) ProtoMessage() {}

func (x *IdBasedBrokerRewriteRule) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use IdBasedBrokerRewriteRule.ProtoReflect.Descriptor instead.
func (*IdBasedBrokerRewriteRule) Descriptor() ([]byte, []int) {
	return file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescGZIP(), []int{2}
}

func (x *IdBasedBrokerRewriteRule) GetId() uint32 {
	if x != nil {
		return x.Id
	}
	return 0
}

func (x *IdBasedBrokerRewriteRule) GetHost() string {
	if x != nil {
		return x.Host
	}
	return ""
}

func (x *IdBasedBrokerRewriteRule) GetPort() uint32 {
	if x != nil {
		return x.Port
	}
	return 0
}

var File_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto protoreflect.FileDescriptor

const file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDesc = "" +
	"\n" +
	"Denvoy/config/filter/network/kafka_broker/v2alpha1/kafka_broker.proto\x121envoy.config.filter.network.kafka_broker.v2alpha1\x1a\x1eudpa/annotations/migrate.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xa1\x03\n" +
	"\vKafkaBroker\x12(\n" +
	"\vstat_prefix\x18\x01 \x01(\tB\a\xfaB\x04r\x02 \x01R\n" +
	"statPrefix\x124\n" +
	"\x16force_response_rewrite\x18\x02 \x01(\bR\x14forceResponseRewrite\x12\x9c\x01\n" +
	"$id_based_broker_address_rewrite_spec\x18\x03 \x01(\v2K.envoy.config.filter.network.kafka_broker.v2alpha1.IdBasedBrokerRewriteSpecH\x00R\x1fidBasedBrokerAddressRewriteSpec\x12:\n" +
	"\x10api_keys_allowed\x18\x04 \x03(\rB\x10\xfaB\r\x92\x01\n" +
	"\"\b*\x06\x18\xff\xff\x01(\x00R\x0eapiKeysAllowed\x128\n" +
	"\x0fapi_keys_denied\x18\x05 \x03(\rB\x10\xfaB\r\x92\x01\n" +
	"\"\b*\x06\x18\xff\xff\x01(\x00R\rapiKeysDeniedB\x1d\n" +
	"\x1bbroker_address_rewrite_spec\"}\n" +
	"\x18IdBasedBrokerRewriteSpec\x12a\n" +
	"\x05rules\x18\x01 \x03(\v2K.envoy.config.filter.network.kafka_broker.v2alpha1.IdBasedBrokerRewriteRuleR\x05rules\"o\n" +
	"\x18IdBasedBrokerRewriteRule\x12\x17\n" +
	"\x02id\x18\x01 \x01(\rB\a\xfaB\x04*\x02(\x00R\x02id\x12\x1b\n" +
	"\x04host\x18\x02 \x01(\tB\a\xfaB\x04r\x02\x10\x01R\x04host\x12\x1d\n" +
	"\x04port\x18\x03 \x01(\rB\t\xfaB\x06*\x04\x18\xff\xff\x03R\x04portB\xef\x01\xf2\x98\xfe\x8f\x052\x120envoy.extensions.filters.network.kafka_broker.v3\xba\x80\xc8\xd1\x06\x02\x10\x01\n" +
	"?io.envoyproxy.envoy.config.filter.network.kafka_broker.v2alpha1B\x10KafkaBrokerProtoP\x01ZXgithub.com/envoyproxy/go-control-plane/envoy/config/filter/network/kafka_broker/v2alpha1b\x06proto3"

var (
	file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescOnce sync.Once
	file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescData []byte
)

func file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescGZIP() []byte {
	file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescOnce.Do(func() {
		file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDesc), len(file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDesc)))
	})
	return file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDescData
}

var file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_goTypes = []any{
	(*KafkaBroker)(nil),              // 0: envoy.config.filter.network.kafka_broker.v2alpha1.KafkaBroker
	(*IdBasedBrokerRewriteSpec)(nil), // 1: envoy.config.filter.network.kafka_broker.v2alpha1.IdBasedBrokerRewriteSpec
	(*IdBasedBrokerRewriteRule)(nil), // 2: envoy.config.filter.network.kafka_broker.v2alpha1.IdBasedBrokerRewriteRule
}
var file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_depIdxs = []int32{
	1, // 0: envoy.config.filter.network.kafka_broker.v2alpha1.KafkaBroker.id_based_broker_address_rewrite_spec:type_name -> envoy.config.filter.network.kafka_broker.v2alpha1.IdBasedBrokerRewriteSpec
	2, // 1: envoy.config.filter.network.kafka_broker.v2alpha1.IdBasedBrokerRewriteSpec.rules:type_name -> envoy.config.filter.network.kafka_broker.v2alpha1.IdBasedBrokerRewriteRule
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_init() }
func file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_init() {
	if File_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto != nil {
		return
	}
	file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes[0].OneofWrappers = []any{
		(*KafkaBroker_IdBasedBrokerAddressRewriteSpec)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDesc), len(file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_goTypes,
		DependencyIndexes: file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_depIdxs,
		MessageInfos:      file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_msgTypes,
	}.Build()
	File_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto = out.File
	file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_goTypes = nil
	file_envoy_config_filter_network_kafka_broker_v2alpha1_kafka_broker_proto_depIdxs = nil
}
