// 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/module/v1/graph_service.proto

//go:build !protoopaque

package modulev1

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 GetGraphRequest struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	// The references to resolve to Commits to include in the graph.
	//
	// See the documentation on ResourceRef for resource resolution details.
	//
	// Once the resource is resolved, the following Commit is included:
	//   - If a Module is referenced, the Commit of the default Label is included.
	//   - If a Label is referenced, the Commit of this Label is included.
	//   - If a Commit is referenced, the Commit is included.
	//
	// The specified ResourceRefs must reference unique Modules, that is no two ResourceRefs
	// may resolve to the same Module.
	ResourceRefs  []*ResourceRef `protobuf:"bytes,1,rep,name=resource_refs,json=resourceRefs,proto3" json:"resource_refs,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*GetGraphRequest) ProtoMessage() {}

func (x *GetGraphRequest) ProtoReflect() protoreflect.Message {
	mi := &file_buf_registry_module_v1_graph_service_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 *GetGraphRequest) GetResourceRefs() []*ResourceRef {
	if x != nil {
		return x.ResourceRefs
	}
	return nil
}

func (x *GetGraphRequest) SetResourceRefs(v []*ResourceRef) {
	x.ResourceRefs = v
}

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

	// The references to resolve to Commits to include in the graph.
	//
	// See the documentation on ResourceRef for resource resolution details.
	//
	// Once the resource is resolved, the following Commit is included:
	//   - If a Module is referenced, the Commit of the default Label is included.
	//   - If a Label is referenced, the Commit of this Label is included.
	//   - If a Commit is referenced, the Commit is included.
	//
	// The specified ResourceRefs must reference unique Modules, that is no two ResourceRefs
	// may resolve to the same Module.
	ResourceRefs []*ResourceRef
}

func (b0 GetGraphRequest_builder) Build() *GetGraphRequest {
	m0 := &GetGraphRequest{}
	b, x := &b0, m0
	_, _ = b, x
	x.ResourceRefs = b.ResourceRefs
	return m0
}

type GetGraphResponse struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	// The Graph calculated for the Commits.
	Graph         *Graph `protobuf:"bytes,1,opt,name=graph,proto3" json:"graph,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*GetGraphResponse) ProtoMessage() {}

func (x *GetGraphResponse) ProtoReflect() protoreflect.Message {
	mi := &file_buf_registry_module_v1_graph_service_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 *GetGraphResponse) GetGraph() *Graph {
	if x != nil {
		return x.Graph
	}
	return nil
}

func (x *GetGraphResponse) SetGraph(v *Graph) {
	x.Graph = v
}

func (x *GetGraphResponse) HasGraph() bool {
	if x == nil {
		return false
	}
	return x.Graph != nil
}

func (x *GetGraphResponse) ClearGraph() {
	x.Graph = nil
}

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

	// The Graph calculated for the Commits.
	Graph *Graph
}

func (b0 GetGraphResponse_builder) Build() *GetGraphResponse {
	m0 := &GetGraphResponse{}
	b, x := &b0, m0
	_, _ = b, x
	x.Graph = b.Graph
	return m0
}

var File_buf_registry_module_v1_graph_service_proto protoreflect.FileDescriptor

const file_buf_registry_module_v1_graph_service_proto_rawDesc = "" +
	"\n" +
	"*buf/registry/module/v1/graph_service.proto\x12\x16buf.registry.module.v1\x1a\"buf/registry/module/v1/graph.proto\x1a%buf/registry/module/v1/resource.proto\x1a\x1bbuf/validate/validate.proto\"h\n" +
	"\x0fGetGraphRequest\x12U\n" +
	"\rresource_refs\x18\x01 \x03(\v2#.buf.registry.module.v1.ResourceRefB\v\xbaH\b\x92\x01\x05\b\x01\x10\xfa\x01R\fresourceRefs\"O\n" +
	"\x10GetGraphResponse\x12;\n" +
	"\x05graph\x18\x01 \x01(\v2\x1d.buf.registry.module.v1.GraphB\x06\xbaH\x03\xc8\x01\x01R\x05graph2r\n" +
	"\fGraphService\x12b\n" +
	"\bGetGraph\x12'.buf.registry.module.v1.GetGraphRequest\x1a(.buf.registry.module.v1.GetGraphResponse\"\x03\x90\x02\x01BWZUbuf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1;modulev1b\x06proto3"

var file_buf_registry_module_v1_graph_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_buf_registry_module_v1_graph_service_proto_goTypes = []any{
	(*GetGraphRequest)(nil),  // 0: buf.registry.module.v1.GetGraphRequest
	(*GetGraphResponse)(nil), // 1: buf.registry.module.v1.GetGraphResponse
	(*ResourceRef)(nil),      // 2: buf.registry.module.v1.ResourceRef
	(*Graph)(nil),            // 3: buf.registry.module.v1.Graph
}
var file_buf_registry_module_v1_graph_service_proto_depIdxs = []int32{
	2, // 0: buf.registry.module.v1.GetGraphRequest.resource_refs:type_name -> buf.registry.module.v1.ResourceRef
	3, // 1: buf.registry.module.v1.GetGraphResponse.graph:type_name -> buf.registry.module.v1.Graph
	0, // 2: buf.registry.module.v1.GraphService.GetGraph:input_type -> buf.registry.module.v1.GetGraphRequest
	1, // 3: buf.registry.module.v1.GraphService.GetGraph:output_type -> buf.registry.module.v1.GetGraphResponse
	3, // [3:4] is the sub-list for method output_type
	2, // [2:3] 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_buf_registry_module_v1_graph_service_proto_init() }
func file_buf_registry_module_v1_graph_service_proto_init() {
	if File_buf_registry_module_v1_graph_service_proto != nil {
		return
	}
	file_buf_registry_module_v1_graph_proto_init()
	file_buf_registry_module_v1_resource_proto_init()
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_buf_registry_module_v1_graph_service_proto_rawDesc), len(file_buf_registry_module_v1_graph_service_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_buf_registry_module_v1_graph_service_proto_goTypes,
		DependencyIndexes: file_buf_registry_module_v1_graph_service_proto_depIdxs,
		MessageInfos:      file_buf_registry_module_v1_graph_service_proto_msgTypes,
	}.Build()
	File_buf_registry_module_v1_graph_service_proto = out.File
	file_buf_registry_module_v1_graph_service_proto_goTypes = nil
	file_buf_registry_module_v1_graph_service_proto_depIdxs = nil
}
