// 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.11
// 	protoc        (unknown)
// source: buf/registry/priv/extension/v1beta1/extension.proto

//go:build !protoopaque

package extensionv1beta1

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	descriptorpb "google.golang.org/protobuf/types/descriptorpb"
	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)
)

// Constraints on a message.
type MessageConstraints struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	// The given message should only be recursively used as part of RPC requests and should
	// never be part of an RPC response.
	//
	// This is not just for request/response messages, this is also for any message that
	// is part of a request. It says that the message cannot form part of a response.
	//
	// This applies to all nested messages within the message that are marked as request_only.
	//
	// Exclusive with response_only.
	//
	// TODO: Also have a marker for specific request/response messages?
	// TODO: enum?
	RequestOnly bool `protobuf:"varint,1,opt,name=request_only,json=requestOnly,proto3" json:"request_only,omitempty"`
	// The given message should only be recursively used as part of RPC responses and should
	// never be part of an RPC request.
	//
	// This is not just for request/response messages, this is also for any message that
	// is part of a response. It says that the message cannot form part of a request.
	//
	// This applies to all nested messages within the message that are marked as response_only.
	//
	// Exclusive with request_only.
	//
	// TODO: Also have a marker for specific request/response messages?
	// TODO: enum?
	ResponseOnly bool `protobuf:"varint,2,opt,name=response_only,json=responseOnly,proto3" json:"response_only,omitempty"`
	// The given message should only be recursively used as part of RPCs that are marked
	// as NO_SIDE_EFFECTS. Typically used to denote that a message should
	// only be used in read-only contexts.
	//
	// This applies to all nested messages within the message that are marked as no_side_effects_only.
	//
	// This is not just for request/response messages, this is also for any message that
	// is part of an RPC.
	NoSideEffectsOnly bool `protobuf:"varint,3,opt,name=no_side_effects_only,json=noSideEffectsOnly,proto3" json:"no_side_effects_only,omitempty"`
	unknownFields     protoimpl.UnknownFields
	sizeCache         protoimpl.SizeCache
}

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

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

func (*MessageConstraints) ProtoMessage() {}

func (x *MessageConstraints) ProtoReflect() protoreflect.Message {
	mi := &file_buf_registry_priv_extension_v1beta1_extension_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 *MessageConstraints) GetRequestOnly() bool {
	if x != nil {
		return x.RequestOnly
	}
	return false
}

func (x *MessageConstraints) GetResponseOnly() bool {
	if x != nil {
		return x.ResponseOnly
	}
	return false
}

func (x *MessageConstraints) GetNoSideEffectsOnly() bool {
	if x != nil {
		return x.NoSideEffectsOnly
	}
	return false
}

func (x *MessageConstraints) SetRequestOnly(v bool) {
	x.RequestOnly = v
}

func (x *MessageConstraints) SetResponseOnly(v bool) {
	x.ResponseOnly = v
}

func (x *MessageConstraints) SetNoSideEffectsOnly(v bool) {
	x.NoSideEffectsOnly = v
}

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

	// The given message should only be recursively used as part of RPC requests and should
	// never be part of an RPC response.
	//
	// This is not just for request/response messages, this is also for any message that
	// is part of a request. It says that the message cannot form part of a response.
	//
	// This applies to all nested messages within the message that are marked as request_only.
	//
	// Exclusive with response_only.
	//
	// TODO: Also have a marker for specific request/response messages?
	// TODO: enum?
	RequestOnly bool
	// The given message should only be recursively used as part of RPC responses and should
	// never be part of an RPC request.
	//
	// This is not just for request/response messages, this is also for any message that
	// is part of a response. It says that the message cannot form part of a request.
	//
	// This applies to all nested messages within the message that are marked as response_only.
	//
	// Exclusive with request_only.
	//
	// TODO: Also have a marker for specific request/response messages?
	// TODO: enum?
	ResponseOnly bool
	// The given message should only be recursively used as part of RPCs that are marked
	// as NO_SIDE_EFFECTS. Typically used to denote that a message should
	// only be used in read-only contexts.
	//
	// This applies to all nested messages within the message that are marked as no_side_effects_only.
	//
	// This is not just for request/response messages, this is also for any message that
	// is part of an RPC.
	NoSideEffectsOnly bool
}

func (b0 MessageConstraints_builder) Build() *MessageConstraints {
	m0 := &MessageConstraints{}
	b, x := &b0, m0
	_, _ = b, x
	x.RequestOnly = b.RequestOnly
	x.ResponseOnly = b.ResponseOnly
	x.NoSideEffectsOnly = b.NoSideEffectsOnly
	return m0
}

var file_buf_registry_priv_extension_v1beta1_extension_proto_extTypes = []protoimpl.ExtensionInfo{
	{
		ExtendedType:  (*descriptorpb.MessageOptions)(nil),
		ExtensionType: (*MessageConstraints)(nil),
		Field:         89181,
		Name:          "buf.registry.priv.extension.v1beta1.message",
		Tag:           "bytes,89181,opt,name=message",
		Filename:      "buf/registry/priv/extension/v1beta1/extension.proto",
	},
}

// Extension fields to descriptorpb.MessageOptions.
var (
	// Constraints on a message.
	//
	// Prototyping for now - we will want to change this to a number in Buf's reserved range if
	// this goes further.
	//
	// optional buf.registry.priv.extension.v1beta1.MessageConstraints message = 89181;
	E_Message = &file_buf_registry_priv_extension_v1beta1_extension_proto_extTypes[0]
)

var File_buf_registry_priv_extension_v1beta1_extension_proto protoreflect.FileDescriptor

const file_buf_registry_priv_extension_v1beta1_extension_proto_rawDesc = "" +
	"\n" +
	"3buf/registry/priv/extension/v1beta1/extension.proto\x12#buf.registry.priv.extension.v1beta1\x1a google/protobuf/descriptor.proto\"\x8d\x01\n" +
	"\x12MessageConstraints\x12!\n" +
	"\frequest_only\x18\x01 \x01(\bR\vrequestOnly\x12#\n" +
	"\rresponse_only\x18\x02 \x01(\bR\fresponseOnly\x12/\n" +
	"\x14no_side_effects_only\x18\x03 \x01(\bR\x11noSideEffectsOnly:t\n" +
	"\amessage\x12\x1f.google.protobuf.MessageOptions\x18ݸ\x05 \x01(\v27.buf.registry.priv.extension.v1beta1.MessageConstraintsR\amessageBlZjbuf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/priv/extension/v1beta1;extensionv1beta1b\x06proto3"

var file_buf_registry_priv_extension_v1beta1_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_buf_registry_priv_extension_v1beta1_extension_proto_goTypes = []any{
	(*MessageConstraints)(nil),          // 0: buf.registry.priv.extension.v1beta1.MessageConstraints
	(*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions
}
var file_buf_registry_priv_extension_v1beta1_extension_proto_depIdxs = []int32{
	1, // 0: buf.registry.priv.extension.v1beta1.message:extendee -> google.protobuf.MessageOptions
	0, // 1: buf.registry.priv.extension.v1beta1.message:type_name -> buf.registry.priv.extension.v1beta1.MessageConstraints
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	1, // [1:2] is the sub-list for extension type_name
	0, // [0:1] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_buf_registry_priv_extension_v1beta1_extension_proto_init() }
func file_buf_registry_priv_extension_v1beta1_extension_proto_init() {
	if File_buf_registry_priv_extension_v1beta1_extension_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_buf_registry_priv_extension_v1beta1_extension_proto_rawDesc), len(file_buf_registry_priv_extension_v1beta1_extension_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   1,
			NumExtensions: 1,
			NumServices:   0,
		},
		GoTypes:           file_buf_registry_priv_extension_v1beta1_extension_proto_goTypes,
		DependencyIndexes: file_buf_registry_priv_extension_v1beta1_extension_proto_depIdxs,
		MessageInfos:      file_buf_registry_priv_extension_v1beta1_extension_proto_msgTypes,
		ExtensionInfos:    file_buf_registry_priv_extension_v1beta1_extension_proto_extTypes,
	}.Build()
	File_buf_registry_priv_extension_v1beta1_extension_proto = out.File
	file_buf_registry_priv_extension_v1beta1_extension_proto_goTypes = nil
	file_buf_registry_priv_extension_v1beta1_extension_proto_depIdxs = nil
}
