// Copyright 2023-2025 Buf Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: tests/example/v1/filter.proto

//go:build !protoopaque

package examplev1

import (
	_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	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 InvalidRules struct {
	state         protoimpl.MessageState `protogen:"hybrid.v1"`
	Field         int32                  `protobuf:"varint,1,opt,name=field,proto3" json:"field,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*InvalidRules) ProtoMessage() {}

func (x *InvalidRules) ProtoReflect() protoreflect.Message {
	mi := &file_tests_example_v1_filter_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)
}

func (x *InvalidRules) GetField() int32 {
	if x != nil {
		return x.Field
	}
	return 0
}

func (x *InvalidRules) SetField(v int32) {
	x.Field = v
}

type InvalidRules_builder struct {
	_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.

	Field int32
}

func (b0 InvalidRules_builder) Build() *InvalidRules {
	m0 := &InvalidRules{}
	b, x := &b0, m0
	_, _ = b, x
	x.Field = b.Field
	return m0
}

type AllRuleTypes struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	Field int32                  `protobuf:"varint,1,opt,name=field,proto3" json:"field,omitempty"`
	// Types that are valid to be assigned to RequiredOneof:
	//
	//	*AllRuleTypes_OneofField
	RequiredOneof isAllRuleTypes_RequiredOneof `protobuf_oneof:"required_oneof"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*AllRuleTypes) ProtoMessage() {}

func (x *AllRuleTypes) ProtoReflect() protoreflect.Message {
	mi := &file_tests_example_v1_filter_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)
}

func (x *AllRuleTypes) GetField() int32 {
	if x != nil {
		return x.Field
	}
	return 0
}

func (x *AllRuleTypes) GetRequiredOneof() isAllRuleTypes_RequiredOneof {
	if x != nil {
		return x.RequiredOneof
	}
	return nil
}

func (x *AllRuleTypes) GetOneofField() string {
	if x != nil {
		if x, ok := x.RequiredOneof.(*AllRuleTypes_OneofField); ok {
			return x.OneofField
		}
	}
	return ""
}

func (x *AllRuleTypes) SetField(v int32) {
	x.Field = v
}

func (x *AllRuleTypes) SetOneofField(v string) {
	x.RequiredOneof = &AllRuleTypes_OneofField{v}
}

func (x *AllRuleTypes) HasRequiredOneof() bool {
	if x == nil {
		return false
	}
	return x.RequiredOneof != nil
}

func (x *AllRuleTypes) HasOneofField() bool {
	if x == nil {
		return false
	}
	_, ok := x.RequiredOneof.(*AllRuleTypes_OneofField)
	return ok
}

func (x *AllRuleTypes) ClearRequiredOneof() {
	x.RequiredOneof = nil
}

func (x *AllRuleTypes) ClearOneofField() {
	if _, ok := x.RequiredOneof.(*AllRuleTypes_OneofField); ok {
		x.RequiredOneof = nil
	}
}

const AllRuleTypes_RequiredOneof_not_set_case case_AllRuleTypes_RequiredOneof = 0
const AllRuleTypes_OneofField_case case_AllRuleTypes_RequiredOneof = 2

func (x *AllRuleTypes) WhichRequiredOneof() case_AllRuleTypes_RequiredOneof {
	if x == nil {
		return AllRuleTypes_RequiredOneof_not_set_case
	}
	switch x.RequiredOneof.(type) {
	case *AllRuleTypes_OneofField:
		return AllRuleTypes_OneofField_case
	default:
		return AllRuleTypes_RequiredOneof_not_set_case
	}
}

type AllRuleTypes_builder struct {
	_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.

	Field int32
	// Fields of oneof RequiredOneof:
	OneofField *string
	// -- end of RequiredOneof
}

func (b0 AllRuleTypes_builder) Build() *AllRuleTypes {
	m0 := &AllRuleTypes{}
	b, x := &b0, m0
	_, _ = b, x
	x.Field = b.Field
	if b.OneofField != nil {
		x.RequiredOneof = &AllRuleTypes_OneofField{*b.OneofField}
	}
	return m0
}

type case_AllRuleTypes_RequiredOneof protoreflect.FieldNumber

func (x case_AllRuleTypes_RequiredOneof) String() string {
	md := file_tests_example_v1_filter_proto_msgTypes[1].Descriptor()
	if x == 0 {
		return "not set"
	}
	return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))
}

type isAllRuleTypes_RequiredOneof interface {
	isAllRuleTypes_RequiredOneof()
}

type AllRuleTypes_OneofField struct {
	OneofField string `protobuf:"bytes,2,opt,name=oneof_field,json=oneofField,proto3,oneof"`
}

func (*AllRuleTypes_OneofField) isAllRuleTypes_RequiredOneof() {}

type NestedRules struct {
	state         protoimpl.MessageState   `protogen:"hybrid.v1"`
	Field         *AllRuleTypes            `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
	Field2        string                   `protobuf:"bytes,2,opt,name=field2,proto3" json:"field2,omitempty"`
	RepeatedField []*AllRuleTypes          `protobuf:"bytes,3,rep,name=repeated_field,json=repeatedField,proto3" json:"repeated_field,omitempty"`
	MapField      map[string]*AllRuleTypes `protobuf:"bytes,4,rep,name=map_field,json=mapField,proto3" json:"map_field,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// Types that are valid to be assigned to RequiredOneof:
	//
	//	*NestedRules_OneofField
	RequiredOneof isNestedRules_RequiredOneof `protobuf_oneof:"required_oneof"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*NestedRules) ProtoMessage() {}

func (x *NestedRules) ProtoReflect() protoreflect.Message {
	mi := &file_tests_example_v1_filter_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)
}

func (x *NestedRules) GetField() *AllRuleTypes {
	if x != nil {
		return x.Field
	}
	return nil
}

func (x *NestedRules) GetField2() string {
	if x != nil {
		return x.Field2
	}
	return ""
}

func (x *NestedRules) GetRepeatedField() []*AllRuleTypes {
	if x != nil {
		return x.RepeatedField
	}
	return nil
}

func (x *NestedRules) GetMapField() map[string]*AllRuleTypes {
	if x != nil {
		return x.MapField
	}
	return nil
}

func (x *NestedRules) GetRequiredOneof() isNestedRules_RequiredOneof {
	if x != nil {
		return x.RequiredOneof
	}
	return nil
}

func (x *NestedRules) GetOneofField() string {
	if x != nil {
		if x, ok := x.RequiredOneof.(*NestedRules_OneofField); ok {
			return x.OneofField
		}
	}
	return ""
}

func (x *NestedRules) SetField(v *AllRuleTypes) {
	x.Field = v
}

func (x *NestedRules) SetField2(v string) {
	x.Field2 = v
}

func (x *NestedRules) SetRepeatedField(v []*AllRuleTypes) {
	x.RepeatedField = v
}

func (x *NestedRules) SetMapField(v map[string]*AllRuleTypes) {
	x.MapField = v
}

func (x *NestedRules) SetOneofField(v string) {
	x.RequiredOneof = &NestedRules_OneofField{v}
}

func (x *NestedRules) HasField() bool {
	if x == nil {
		return false
	}
	return x.Field != nil
}

func (x *NestedRules) HasRequiredOneof() bool {
	if x == nil {
		return false
	}
	return x.RequiredOneof != nil
}

func (x *NestedRules) HasOneofField() bool {
	if x == nil {
		return false
	}
	_, ok := x.RequiredOneof.(*NestedRules_OneofField)
	return ok
}

func (x *NestedRules) ClearField() {
	x.Field = nil
}

func (x *NestedRules) ClearRequiredOneof() {
	x.RequiredOneof = nil
}

func (x *NestedRules) ClearOneofField() {
	if _, ok := x.RequiredOneof.(*NestedRules_OneofField); ok {
		x.RequiredOneof = nil
	}
}

const NestedRules_RequiredOneof_not_set_case case_NestedRules_RequiredOneof = 0
const NestedRules_OneofField_case case_NestedRules_RequiredOneof = 5

func (x *NestedRules) WhichRequiredOneof() case_NestedRules_RequiredOneof {
	if x == nil {
		return NestedRules_RequiredOneof_not_set_case
	}
	switch x.RequiredOneof.(type) {
	case *NestedRules_OneofField:
		return NestedRules_OneofField_case
	default:
		return NestedRules_RequiredOneof_not_set_case
	}
}

type NestedRules_builder struct {
	_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.

	Field         *AllRuleTypes
	Field2        string
	RepeatedField []*AllRuleTypes
	MapField      map[string]*AllRuleTypes
	// Fields of oneof RequiredOneof:
	OneofField *string
	// -- end of RequiredOneof
}

func (b0 NestedRules_builder) Build() *NestedRules {
	m0 := &NestedRules{}
	b, x := &b0, m0
	_, _ = b, x
	x.Field = b.Field
	x.Field2 = b.Field2
	x.RepeatedField = b.RepeatedField
	x.MapField = b.MapField
	if b.OneofField != nil {
		x.RequiredOneof = &NestedRules_OneofField{*b.OneofField}
	}
	return m0
}

type case_NestedRules_RequiredOneof protoreflect.FieldNumber

func (x case_NestedRules_RequiredOneof) String() string {
	md := file_tests_example_v1_filter_proto_msgTypes[2].Descriptor()
	if x == 0 {
		return "not set"
	}
	return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))
}

type isNestedRules_RequiredOneof interface {
	isNestedRules_RequiredOneof()
}

type NestedRules_OneofField struct {
	OneofField string `protobuf:"bytes,5,opt,name=oneof_field,json=oneofField,proto3,oneof"`
}

func (*NestedRules_OneofField) isNestedRules_RequiredOneof() {}

var File_tests_example_v1_filter_proto protoreflect.FileDescriptor

const file_tests_example_v1_filter_proto_rawDesc = "" +
	"\n" +
	"\x1dtests/example/v1/filter.proto\x12\x10tests.example.v1\x1a\x1bbuf/validate/validate.proto\"\xa3\x01\n" +
	"\fInvalidRules\x12R\n" +
	"\x05field\x18\x01 \x01(\x05B<\xbaH9\xba\x016\n" +
	"\n" +
	"field_rule\x12\x1athis field rule is invalid\x1a\fthis.invalidR\x05field:?\xbaH<\x1a:\n" +
	"\fmessage_rule\x12\x1cthis message rule is invalid\x1a\fthis.invalid\"\xd5\x01\n" +
	"\fAllRuleTypes\x12M\n" +
	"\x05field\x18\x01 \x01(\x05B7\xbaH4\xba\x011\n" +
	"\n" +
	"field_rule\x12\x1cthis field rule always fails\x1a\x05falseR\x05field\x12!\n" +
	"\voneof_field\x18\x02 \x01(\tH\x00R\n" +
	"oneofField::\xbaH7\x1a5\n" +
	"\fmessage_rule\x12\x1ethis message rule always fails\x1a\x05falseB\x17\n" +
	"\x0erequired_oneof\x12\x05\xbaH\x02\b\x01\"\x87\x04\n" +
	"\vNestedRules\x12t\n" +
	"\x05field\x18\x01 \x01(\v2\x1e.tests.example.v1.AllRuleTypesB>\xbaH;\xba\x018\n" +
	"\x11parent_field_rule\x12\x1cthis field rule always fails\x1a\x05falseR\x05field\x12X\n" +
	"\x06field2\x18\x02 \x01(\tB@\xbaH=\xba\x01:\n" +
	"\x13parent_field_2_rule\x12\x1cthis field rule always fails\x1a\x05falseR\x06field2\x12E\n" +
	"\x0erepeated_field\x18\x03 \x03(\v2\x1e.tests.example.v1.AllRuleTypesR\rrepeatedField\x12H\n" +
	"\tmap_field\x18\x04 \x03(\v2+.tests.example.v1.NestedRules.MapFieldEntryR\bmapField\x12!\n" +
	"\voneof_field\x18\x05 \x01(\tH\x00R\n" +
	"oneofField\x1a[\n" +
	"\rMapFieldEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x124\n" +
	"\x05value\x18\x02 \x01(\v2\x1e.tests.example.v1.AllRuleTypesR\x05value:\x028\x01B\x17\n" +
	"\x0erequired_oneof\x12\x05\xbaH\x02\b\x01B\xc9\x01\n" +
	"\x14com.tests.example.v1B\vFilterProtoP\x01ZBbuf.build/go/protovalidate/internal/gen/tests/example/v1;examplev1\xa2\x02\x03TEX\xaa\x02\x10Tests.Example.V1\xca\x02\x10Tests\\Example\\V1\xe2\x02\x1cTests\\Example\\V1\\GPBMetadata\xea\x02\x12Tests::Example::V1b\x06proto3"

var file_tests_example_v1_filter_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_tests_example_v1_filter_proto_goTypes = []any{
	(*InvalidRules)(nil), // 0: tests.example.v1.InvalidRules
	(*AllRuleTypes)(nil), // 1: tests.example.v1.AllRuleTypes
	(*NestedRules)(nil),  // 2: tests.example.v1.NestedRules
	nil,                  // 3: tests.example.v1.NestedRules.MapFieldEntry
}
var file_tests_example_v1_filter_proto_depIdxs = []int32{
	1, // 0: tests.example.v1.NestedRules.field:type_name -> tests.example.v1.AllRuleTypes
	1, // 1: tests.example.v1.NestedRules.repeated_field:type_name -> tests.example.v1.AllRuleTypes
	3, // 2: tests.example.v1.NestedRules.map_field:type_name -> tests.example.v1.NestedRules.MapFieldEntry
	1, // 3: tests.example.v1.NestedRules.MapFieldEntry.value:type_name -> tests.example.v1.AllRuleTypes
	4, // [4:4] is the sub-list for method output_type
	4, // [4:4] is the sub-list for method input_type
	4, // [4:4] is the sub-list for extension type_name
	4, // [4:4] is the sub-list for extension extendee
	0, // [0:4] is the sub-list for field type_name
}

func init() { file_tests_example_v1_filter_proto_init() }
func file_tests_example_v1_filter_proto_init() {
	if File_tests_example_v1_filter_proto != nil {
		return
	}
	file_tests_example_v1_filter_proto_msgTypes[1].OneofWrappers = []any{
		(*AllRuleTypes_OneofField)(nil),
	}
	file_tests_example_v1_filter_proto_msgTypes[2].OneofWrappers = []any{
		(*NestedRules_OneofField)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_tests_example_v1_filter_proto_rawDesc), len(file_tests_example_v1_filter_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_tests_example_v1_filter_proto_goTypes,
		DependencyIndexes: file_tests_example_v1_filter_proto_depIdxs,
		MessageInfos:      file_tests_example_v1_filter_proto_msgTypes,
	}.Build()
	File_tests_example_v1_filter_proto = out.File
	file_tests_example_v1_filter_proto_goTypes = nil
	file_tests_example_v1_filter_proto_depIdxs = nil
}
