// 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/policy/v1beta1/download_service.proto

//go:build !protoopaque

package policyv1beta1

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 DownloadRequest struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	// The references to get contents for.
	Values        []*DownloadRequest_Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*DownloadRequest) ProtoMessage() {}

func (x *DownloadRequest) ProtoReflect() protoreflect.Message {
	mi := &file_buf_registry_policy_v1beta1_download_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 *DownloadRequest) GetValues() []*DownloadRequest_Value {
	if x != nil {
		return x.Values
	}
	return nil
}

func (x *DownloadRequest) SetValues(v []*DownloadRequest_Value) {
	x.Values = v
}

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

	// The references to get contents for.
	Values []*DownloadRequest_Value
}

func (b0 DownloadRequest_builder) Build() *DownloadRequest {
	m0 := &DownloadRequest{}
	b, x := &b0, m0
	_, _ = b, x
	x.Values = b.Values
	return m0
}

type DownloadResponse struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	// The contents for each reference in the same order as given on the request.
	Contents      []*DownloadResponse_Content `protobuf:"bytes,1,rep,name=contents,proto3" json:"contents,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*DownloadResponse) ProtoMessage() {}

func (x *DownloadResponse) ProtoReflect() protoreflect.Message {
	mi := &file_buf_registry_policy_v1beta1_download_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 *DownloadResponse) GetContents() []*DownloadResponse_Content {
	if x != nil {
		return x.Contents
	}
	return nil
}

func (x *DownloadResponse) SetContents(v []*DownloadResponse_Content) {
	x.Contents = v
}

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

	// The contents for each reference in the same order as given on the request.
	Contents []*DownloadResponse_Content
}

func (b0 DownloadResponse_builder) Build() *DownloadResponse {
	m0 := &DownloadResponse{}
	b, x := &b0, m0
	_, _ = b, x
	x.Contents = b.Contents
	return m0
}

// A request for content for a single version of a Policy.
type DownloadRequest_Value struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	// The reference to get content for.
	//
	// See the documentation on Reference for reference resolution details.
	//
	// Once the resource is resolved, the following content is returned:
	//   - If a Policy is referenced, the content of the latest commit of the default label is
	//     returned.
	//   - If a Label is referenced, the content of the Commit of this Label is returned.
	//   - If a Commit is referenced, the content for this Commit is returned.
	ResourceRef   *ResourceRef `protobuf:"bytes,1,opt,name=resource_ref,json=resourceRef,proto3" json:"resource_ref,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*DownloadRequest_Value) ProtoMessage() {}

func (x *DownloadRequest_Value) ProtoReflect() protoreflect.Message {
	mi := &file_buf_registry_policy_v1beta1_download_service_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 *DownloadRequest_Value) GetResourceRef() *ResourceRef {
	if x != nil {
		return x.ResourceRef
	}
	return nil
}

func (x *DownloadRequest_Value) SetResourceRef(v *ResourceRef) {
	x.ResourceRef = v
}

func (x *DownloadRequest_Value) HasResourceRef() bool {
	if x == nil {
		return false
	}
	return x.ResourceRef != nil
}

func (x *DownloadRequest_Value) ClearResourceRef() {
	x.ResourceRef = nil
}

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

	// The reference to get content for.
	//
	// See the documentation on Reference for reference resolution details.
	//
	// Once the resource is resolved, the following content is returned:
	//   - If a Policy is referenced, the content of the latest commit of the default label is
	//     returned.
	//   - If a Label is referenced, the content of the Commit of this Label is returned.
	//   - If a Commit is referenced, the content for this Commit is returned.
	ResourceRef *ResourceRef
}

func (b0 DownloadRequest_Value_builder) Build() *DownloadRequest_Value {
	m0 := &DownloadRequest_Value{}
	b, x := &b0, m0
	_, _ = b, x
	x.ResourceRef = b.ResourceRef
	return m0
}

// Content for a single version of a Policy.
type DownloadResponse_Content struct {
	state protoimpl.MessageState `protogen:"hybrid.v1"`
	// The Commit associated with the Content.
	Commit *Commit `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"`
	// The Policy config.
	Config        *PolicyConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *DownloadResponse_Content) Reset() {
	*x = DownloadResponse_Content{}
	mi := &file_buf_registry_policy_v1beta1_download_service_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*DownloadResponse_Content) ProtoMessage() {}

func (x *DownloadResponse_Content) ProtoReflect() protoreflect.Message {
	mi := &file_buf_registry_policy_v1beta1_download_service_proto_msgTypes[3]
	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 *DownloadResponse_Content) GetCommit() *Commit {
	if x != nil {
		return x.Commit
	}
	return nil
}

func (x *DownloadResponse_Content) GetConfig() *PolicyConfig {
	if x != nil {
		return x.Config
	}
	return nil
}

func (x *DownloadResponse_Content) SetCommit(v *Commit) {
	x.Commit = v
}

func (x *DownloadResponse_Content) SetConfig(v *PolicyConfig) {
	x.Config = v
}

func (x *DownloadResponse_Content) HasCommit() bool {
	if x == nil {
		return false
	}
	return x.Commit != nil
}

func (x *DownloadResponse_Content) HasConfig() bool {
	if x == nil {
		return false
	}
	return x.Config != nil
}

func (x *DownloadResponse_Content) ClearCommit() {
	x.Commit = nil
}

func (x *DownloadResponse_Content) ClearConfig() {
	x.Config = nil
}

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

	// The Commit associated with the Content.
	Commit *Commit
	// The Policy config.
	Config *PolicyConfig
}

func (b0 DownloadResponse_Content_builder) Build() *DownloadResponse_Content {
	m0 := &DownloadResponse_Content{}
	b, x := &b0, m0
	_, _ = b, x
	x.Commit = b.Commit
	x.Config = b.Config
	return m0
}

var File_buf_registry_policy_v1beta1_download_service_proto protoreflect.FileDescriptor

const file_buf_registry_policy_v1beta1_download_service_proto_rawDesc = "" +
	"\n" +
	"2buf/registry/policy/v1beta1/download_service.proto\x12\x1bbuf.registry.policy.v1beta1\x1a(buf/registry/policy/v1beta1/commit.proto\x1a/buf/registry/policy/v1beta1/configuration.proto\x1a*buf/registry/policy/v1beta1/resource.proto\x1a\x1bbuf/validate/validate.proto\"\xc8\x01\n" +
	"\x0fDownloadRequest\x12W\n" +
	"\x06values\x18\x01 \x03(\v22.buf.registry.policy.v1beta1.DownloadRequest.ValueB\v\xbaH\b\x92\x01\x05\b\x01\x10\xfa\x01R\x06values\x1a\\\n" +
	"\x05Value\x12S\n" +
	"\fresource_ref\x18\x01 \x01(\v2(.buf.registry.policy.v1beta1.ResourceRefB\x06\xbaH\x03\xc8\x01\x01R\vresourceRef\"\x8b\x02\n" +
	"\x10DownloadResponse\x12[\n" +
	"\bcontents\x18\x01 \x03(\v25.buf.registry.policy.v1beta1.DownloadResponse.ContentB\b\xbaH\x05\x92\x01\x02\b\x01R\bcontents\x1a\x99\x01\n" +
	"\aContent\x12C\n" +
	"\x06commit\x18\x01 \x01(\v2#.buf.registry.policy.v1beta1.CommitB\x06\xbaH\x03\xc8\x01\x01R\x06commit\x12I\n" +
	"\x06config\x18\x02 \x01(\v2).buf.registry.policy.v1beta1.PolicyConfigB\x06\xbaH\x03\xc8\x01\x01R\x06config2\x7f\n" +
	"\x0fDownloadService\x12l\n" +
	"\bDownload\x12,.buf.registry.policy.v1beta1.DownloadRequest\x1a-.buf.registry.policy.v1beta1.DownloadResponse\"\x03\x90\x02\x01BaZ_buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1;policyv1beta1b\x06proto3"

var file_buf_registry_policy_v1beta1_download_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_buf_registry_policy_v1beta1_download_service_proto_goTypes = []any{
	(*DownloadRequest)(nil),          // 0: buf.registry.policy.v1beta1.DownloadRequest
	(*DownloadResponse)(nil),         // 1: buf.registry.policy.v1beta1.DownloadResponse
	(*DownloadRequest_Value)(nil),    // 2: buf.registry.policy.v1beta1.DownloadRequest.Value
	(*DownloadResponse_Content)(nil), // 3: buf.registry.policy.v1beta1.DownloadResponse.Content
	(*ResourceRef)(nil),              // 4: buf.registry.policy.v1beta1.ResourceRef
	(*Commit)(nil),                   // 5: buf.registry.policy.v1beta1.Commit
	(*PolicyConfig)(nil),             // 6: buf.registry.policy.v1beta1.PolicyConfig
}
var file_buf_registry_policy_v1beta1_download_service_proto_depIdxs = []int32{
	2, // 0: buf.registry.policy.v1beta1.DownloadRequest.values:type_name -> buf.registry.policy.v1beta1.DownloadRequest.Value
	3, // 1: buf.registry.policy.v1beta1.DownloadResponse.contents:type_name -> buf.registry.policy.v1beta1.DownloadResponse.Content
	4, // 2: buf.registry.policy.v1beta1.DownloadRequest.Value.resource_ref:type_name -> buf.registry.policy.v1beta1.ResourceRef
	5, // 3: buf.registry.policy.v1beta1.DownloadResponse.Content.commit:type_name -> buf.registry.policy.v1beta1.Commit
	6, // 4: buf.registry.policy.v1beta1.DownloadResponse.Content.config:type_name -> buf.registry.policy.v1beta1.PolicyConfig
	0, // 5: buf.registry.policy.v1beta1.DownloadService.Download:input_type -> buf.registry.policy.v1beta1.DownloadRequest
	1, // 6: buf.registry.policy.v1beta1.DownloadService.Download:output_type -> buf.registry.policy.v1beta1.DownloadResponse
	6, // [6:7] is the sub-list for method output_type
	5, // [5:6] is the sub-list for method input_type
	5, // [5:5] is the sub-list for extension type_name
	5, // [5:5] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() { file_buf_registry_policy_v1beta1_download_service_proto_init() }
func file_buf_registry_policy_v1beta1_download_service_proto_init() {
	if File_buf_registry_policy_v1beta1_download_service_proto != nil {
		return
	}
	file_buf_registry_policy_v1beta1_commit_proto_init()
	file_buf_registry_policy_v1beta1_configuration_proto_init()
	file_buf_registry_policy_v1beta1_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_policy_v1beta1_download_service_proto_rawDesc), len(file_buf_registry_policy_v1beta1_download_service_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_buf_registry_policy_v1beta1_download_service_proto_goTypes,
		DependencyIndexes: file_buf_registry_policy_v1beta1_download_service_proto_depIdxs,
		MessageInfos:      file_buf_registry_policy_v1beta1_download_service_proto_msgTypes,
	}.Build()
	File_buf_registry_policy_v1beta1_download_service_proto = out.File
	file_buf_registry_policy_v1beta1_download_service_proto_goTypes = nil
	file_buf_registry_policy_v1beta1_download_service_proto_depIdxs = nil
}
