// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/extensions/filters/common/set_filter_state/v3/value.proto

package set_filter_statev3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	_ "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)
)

type FilterStateValue_SharedWithUpstream int32

const (
	// Object is not shared with the upstream internal connections.
	FilterStateValue_NONE FilterStateValue_SharedWithUpstream = 0
	// Object is shared with the upstream internal connection.
	FilterStateValue_ONCE FilterStateValue_SharedWithUpstream = 1
	// Object is shared with the upstream internal connection and any internal connection upstream from it.
	FilterStateValue_TRANSITIVE FilterStateValue_SharedWithUpstream = 2
)

// Enum value maps for FilterStateValue_SharedWithUpstream.
var (
	FilterStateValue_SharedWithUpstream_name = map[int32]string{
		0: "NONE",
		1: "ONCE",
		2: "TRANSITIVE",
	}
	FilterStateValue_SharedWithUpstream_value = map[string]int32{
		"NONE":       0,
		"ONCE":       1,
		"TRANSITIVE": 2,
	}
)

func (x FilterStateValue_SharedWithUpstream) Enum() *FilterStateValue_SharedWithUpstream {
	p := new(FilterStateValue_SharedWithUpstream)
	*p = x
	return p
}

func (x FilterStateValue_SharedWithUpstream) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (FilterStateValue_SharedWithUpstream) Descriptor() protoreflect.EnumDescriptor {
	return file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_enumTypes[0].Descriptor()
}

func (FilterStateValue_SharedWithUpstream) Type() protoreflect.EnumType {
	return &file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_enumTypes[0]
}

func (x FilterStateValue_SharedWithUpstream) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use FilterStateValue_SharedWithUpstream.Descriptor instead.
func (FilterStateValue_SharedWithUpstream) EnumDescriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescGZIP(), []int{0, 0}
}

// A filter state key and value pair.
// [#next-free-field: 7]
type FilterStateValue struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Types that are valid to be assigned to Key:
	//
	//	*FilterStateValue_ObjectKey
	Key isFilterStateValue_Key `protobuf_oneof:"key"`
	// Specifies which registered factory should be used to create the filter state object from the
	// provided value. This field is required when :ref:`object_key
	// <envoy_v3_api_field_extensions.filters.common.set_filter_state.v3.FilterStateValue.object_key>`
	// is a custom name not found in the :ref:`well-known filter state keys <well_known_filter_state>`.
	//
	// Each well-known key has a factory registered with the same name (e.g., the key
	// “envoy.tcp_proxy.cluster“ has a factory also named “envoy.tcp_proxy.cluster“). For custom keys,
	// use one of the following generic factories:
	//
	//   - “envoy.string“: Creates a generic string object. Use this for arbitrary string values that
	//     will be accessed via “StringAccessor“.
	//
	// If not specified, defaults to the value of “object_key“.
	FactoryKey string `protobuf:"bytes,6,opt,name=factory_key,json=factoryKey,proto3" json:"factory_key,omitempty"`
	// Types that are valid to be assigned to Value:
	//
	//	*FilterStateValue_FormatString
	Value isFilterStateValue_Value `protobuf_oneof:"value"`
	// If marked as read-only, the filter state key value is locked, and cannot
	// be overridden by any filter, including this filter.
	ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
	// Configures the object to be shared with the upstream internal connections. See :ref:`internal upstream
	// transport <config_internal_upstream_transport>` for more details on the filter state sharing with
	// the internal connections.
	SharedWithUpstream FilterStateValue_SharedWithUpstream `protobuf:"varint,4,opt,name=shared_with_upstream,json=sharedWithUpstream,proto3,enum=envoy.extensions.filters.common.set_filter_state.v3.FilterStateValue_SharedWithUpstream" json:"shared_with_upstream,omitempty"`
	// Skip the update if the value evaluates to an empty string.
	// This option can be used to supply multiple alternatives for the same filter state object key.
	SkipIfEmpty   bool `protobuf:"varint,5,opt,name=skip_if_empty,json=skipIfEmpty,proto3" json:"skip_if_empty,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*FilterStateValue) ProtoMessage() {}

func (x *FilterStateValue) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_filters_common_set_filter_state_v3_value_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 FilterStateValue.ProtoReflect.Descriptor instead.
func (*FilterStateValue) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescGZIP(), []int{0}
}

func (x *FilterStateValue) GetKey() isFilterStateValue_Key {
	if x != nil {
		return x.Key
	}
	return nil
}

func (x *FilterStateValue) GetObjectKey() string {
	if x != nil {
		if x, ok := x.Key.(*FilterStateValue_ObjectKey); ok {
			return x.ObjectKey
		}
	}
	return ""
}

func (x *FilterStateValue) GetFactoryKey() string {
	if x != nil {
		return x.FactoryKey
	}
	return ""
}

func (x *FilterStateValue) GetValue() isFilterStateValue_Value {
	if x != nil {
		return x.Value
	}
	return nil
}

func (x *FilterStateValue) GetFormatString() *v3.SubstitutionFormatString {
	if x != nil {
		if x, ok := x.Value.(*FilterStateValue_FormatString); ok {
			return x.FormatString
		}
	}
	return nil
}

func (x *FilterStateValue) GetReadOnly() bool {
	if x != nil {
		return x.ReadOnly
	}
	return false
}

func (x *FilterStateValue) GetSharedWithUpstream() FilterStateValue_SharedWithUpstream {
	if x != nil {
		return x.SharedWithUpstream
	}
	return FilterStateValue_NONE
}

func (x *FilterStateValue) GetSkipIfEmpty() bool {
	if x != nil {
		return x.SkipIfEmpty
	}
	return false
}

type isFilterStateValue_Key interface {
	isFilterStateValue_Key()
}

type FilterStateValue_ObjectKey struct {
	// The name under which the filter state object will be stored and can be retrieved.
	//
	// When using :ref:`well-known filter state keys <well_known_filter_state>` (e.g.,
	// “envoy.network.upstream_server_name“, “envoy.tcp_proxy.cluster“), the object key serves
	// dual purpose where it identifies both where the data is stored and which factory creates the
	// object. In this case, :ref:`factory_key
	// <envoy_v3_api_field_extensions.filters.common.set_filter_state.v3.FilterStateValue.factory_key>`
	// is not needed.
	//
	// When using a custom key name which is not from the well-known list, you must also specify
	// :ref:`factory_key
	// <envoy_v3_api_field_extensions.filters.common.set_filter_state.v3.FilterStateValue.factory_key>`
	// to indicate which factory should create the object from your value.
	//
	// Example using a well-known key where “factory_key“ is not needed:
	//
	// .. code-block:: yaml
	//
	//	object_key: envoy.tcp_proxy.cluster
	//	format_string:
	//	  text_format_source:
	//	    inline_string: "my-cluster"
	//
	// Example using a custom key which requires a “factory_key“:
	//
	// .. code-block:: yaml
	//
	//	object_key: my.custom.key
	//	factory_key: envoy.string
	//	format_string:
	//	  text_format_source:
	//	    inline_string: "my-value"
	ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3,oneof"`
}

func (*FilterStateValue_ObjectKey) isFilterStateValue_Key() {}

type isFilterStateValue_Value interface {
	isFilterStateValue_Value()
}

type FilterStateValue_FormatString struct {
	// Uses the :ref:`format string <config_access_log_format_strings>` to
	// instantiate the filter state object value.
	FormatString *v3.SubstitutionFormatString `protobuf:"bytes,2,opt,name=format_string,json=formatString,proto3,oneof"`
}

func (*FilterStateValue_FormatString) isFilterStateValue_Value() {}

var File_envoy_extensions_filters_common_set_filter_state_v3_value_proto protoreflect.FileDescriptor

const file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDesc = "" +
	"\n" +
	"?envoy/extensions/filters/common/set_filter_state/v3/value.proto\x123envoy.extensions.filters.common.set_filter_state.v3\x1a5envoy/config/core/v3/substitution_format_string.proto\x1a\x1dudpa/annotations/status.proto\x1a\x17validate/validate.proto\"\xd6\x03\n" +
	"\x10FilterStateValue\x12(\n" +
	"\n" +
	"object_key\x18\x01 \x01(\tB\a\xfaB\x04r\x02\x10\x01H\x00R\tobjectKey\x12\x1f\n" +
	"\vfactory_key\x18\x06 \x01(\tR\n" +
	"factoryKey\x12U\n" +
	"\rformat_string\x18\x02 \x01(\v2..envoy.config.core.v3.SubstitutionFormatStringH\x01R\fformatString\x12\x1b\n" +
	"\tread_only\x18\x03 \x01(\bR\breadOnly\x12\x8a\x01\n" +
	"\x14shared_with_upstream\x18\x04 \x01(\x0e2X.envoy.extensions.filters.common.set_filter_state.v3.FilterStateValue.SharedWithUpstreamR\x12sharedWithUpstream\x12\"\n" +
	"\rskip_if_empty\x18\x05 \x01(\bR\vskipIfEmpty\"8\n" +
	"\x12SharedWithUpstream\x12\b\n" +
	"\x04NONE\x10\x00\x12\b\n" +
	"\x04ONCE\x10\x01\x12\x0e\n" +
	"\n" +
	"TRANSITIVE\x10\x02B\n" +
	"\n" +
	"\x03key\x12\x03\xf8B\x01B\f\n" +
	"\x05value\x12\x03\xf8B\x01B\xc8\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"Aio.envoyproxy.envoy.extensions.filters.common.set_filter_state.v3B\n" +
	"ValueProtoP\x01Zmgithub.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/set_filter_state/v3;set_filter_statev3b\x06proto3"

var (
	file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescOnce sync.Once
	file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescData []byte
)

func file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescGZIP() []byte {
	file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDesc), len(file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDesc)))
	})
	return file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDescData
}

var file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_goTypes = []any{
	(FilterStateValue_SharedWithUpstream)(0), // 0: envoy.extensions.filters.common.set_filter_state.v3.FilterStateValue.SharedWithUpstream
	(*FilterStateValue)(nil),                 // 1: envoy.extensions.filters.common.set_filter_state.v3.FilterStateValue
	(*v3.SubstitutionFormatString)(nil),      // 2: envoy.config.core.v3.SubstitutionFormatString
}
var file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_depIdxs = []int32{
	2, // 0: envoy.extensions.filters.common.set_filter_state.v3.FilterStateValue.format_string:type_name -> envoy.config.core.v3.SubstitutionFormatString
	0, // 1: envoy.extensions.filters.common.set_filter_state.v3.FilterStateValue.shared_with_upstream:type_name -> envoy.extensions.filters.common.set_filter_state.v3.FilterStateValue.SharedWithUpstream
	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_extensions_filters_common_set_filter_state_v3_value_proto_init() }
func file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_init() {
	if File_envoy_extensions_filters_common_set_filter_state_v3_value_proto != nil {
		return
	}
	file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_msgTypes[0].OneofWrappers = []any{
		(*FilterStateValue_ObjectKey)(nil),
		(*FilterStateValue_FormatString)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDesc), len(file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_depIdxs,
		EnumInfos:         file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_enumTypes,
		MessageInfos:      file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_msgTypes,
	}.Build()
	File_envoy_extensions_filters_common_set_filter_state_v3_value_proto = out.File
	file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_goTypes = nil
	file_envoy_extensions_filters_common_set_filter_state_v3_value_proto_depIdxs = nil
}
