// Copyright 2020-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.9
// 	protoc        (unknown)
// source: buf/alpha/registry/v1alpha1/git_metadata.proto

package registryv1alpha1

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

// GitIdentity is a Git user identity, typically either an author or a committer.
type GitIdentity struct {
	state            protoimpl.MessageState `protogen:"opaque.v1"`
	xxx_hidden_Name  string                 `protobuf:"bytes,1,opt,name=name,proto3"`
	xxx_hidden_Email string                 `protobuf:"bytes,2,opt,name=email,proto3"`
	xxx_hidden_Time  *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3"`
	unknownFields    protoimpl.UnknownFields
	sizeCache        protoimpl.SizeCache
}

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

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

func (*GitIdentity) ProtoMessage() {}

func (x *GitIdentity) ProtoReflect() protoreflect.Message {
	mi := &file_buf_alpha_registry_v1alpha1_git_metadata_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 *GitIdentity) GetName() string {
	if x != nil {
		return x.xxx_hidden_Name
	}
	return ""
}

func (x *GitIdentity) GetEmail() string {
	if x != nil {
		return x.xxx_hidden_Email
	}
	return ""
}

func (x *GitIdentity) GetTime() *timestamppb.Timestamp {
	if x != nil {
		return x.xxx_hidden_Time
	}
	return nil
}

func (x *GitIdentity) SetName(v string) {
	x.xxx_hidden_Name = v
}

func (x *GitIdentity) SetEmail(v string) {
	x.xxx_hidden_Email = v
}

func (x *GitIdentity) SetTime(v *timestamppb.Timestamp) {
	x.xxx_hidden_Time = v
}

func (x *GitIdentity) HasTime() bool {
	if x == nil {
		return false
	}
	return x.xxx_hidden_Time != nil
}

func (x *GitIdentity) ClearTime() {
	x.xxx_hidden_Time = nil
}

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

	// Name is the name of the Git identity. This is not the BSR user's username.
	Name string
	// Email is the email of the Git identity. This is not the BSR user's email.
	Email string
	// Time is the time at which this identity was captured.
	Time *timestamppb.Timestamp
}

func (b0 GitIdentity_builder) Build() *GitIdentity {
	m0 := &GitIdentity{}
	b, x := &b0, m0
	_, _ = b, x
	x.xxx_hidden_Name = b.Name
	x.xxx_hidden_Email = b.Email
	x.xxx_hidden_Time = b.Time
	return m0
}

// GitCommitInformation is the information associated with a Git commit.
// This always includes the hash.
// The author and/or committer user identities are included when available.
type GitCommitInformation struct {
	state                protoimpl.MessageState `protogen:"opaque.v1"`
	xxx_hidden_Hash      string                 `protobuf:"bytes,1,opt,name=hash,proto3"`
	xxx_hidden_Author    *GitIdentity           `protobuf:"bytes,2,opt,name=author,proto3"`
	xxx_hidden_Committer *GitIdentity           `protobuf:"bytes,3,opt,name=committer,proto3"`
	unknownFields        protoimpl.UnknownFields
	sizeCache            protoimpl.SizeCache
}

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

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

func (*GitCommitInformation) ProtoMessage() {}

func (x *GitCommitInformation) ProtoReflect() protoreflect.Message {
	mi := &file_buf_alpha_registry_v1alpha1_git_metadata_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 *GitCommitInformation) GetHash() string {
	if x != nil {
		return x.xxx_hidden_Hash
	}
	return ""
}

func (x *GitCommitInformation) GetAuthor() *GitIdentity {
	if x != nil {
		return x.xxx_hidden_Author
	}
	return nil
}

func (x *GitCommitInformation) GetCommitter() *GitIdentity {
	if x != nil {
		return x.xxx_hidden_Committer
	}
	return nil
}

func (x *GitCommitInformation) SetHash(v string) {
	x.xxx_hidden_Hash = v
}

func (x *GitCommitInformation) SetAuthor(v *GitIdentity) {
	x.xxx_hidden_Author = v
}

func (x *GitCommitInformation) SetCommitter(v *GitIdentity) {
	x.xxx_hidden_Committer = v
}

func (x *GitCommitInformation) HasAuthor() bool {
	if x == nil {
		return false
	}
	return x.xxx_hidden_Author != nil
}

func (x *GitCommitInformation) HasCommitter() bool {
	if x == nil {
		return false
	}
	return x.xxx_hidden_Committer != nil
}

func (x *GitCommitInformation) ClearAuthor() {
	x.xxx_hidden_Author = nil
}

func (x *GitCommitInformation) ClearCommitter() {
	x.xxx_hidden_Committer = nil
}

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

	// Hash is the SHA1 hash of the git commit.
	Hash string
	// Author is metadata associated with the author of the git commit.
	// This may not always be available, so it is not always populated.
	Author *GitIdentity
	// Committer is the metadata associated with the committer of the git commit.
	// This may not always be available, so it is not always populated.
	Committer *GitIdentity
}

func (b0 GitCommitInformation_builder) Build() *GitCommitInformation {
	m0 := &GitCommitInformation{}
	b, x := &b0, m0
	_, _ = b, x
	x.xxx_hidden_Hash = b.Hash
	x.xxx_hidden_Author = b.Author
	x.xxx_hidden_Committer = b.Committer
	return m0
}

var File_buf_alpha_registry_v1alpha1_git_metadata_proto protoreflect.FileDescriptor

const file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc = "" +
	"\n" +
	".buf/alpha/registry/v1alpha1/git_metadata.proto\x12\x1bbuf.alpha.registry.v1alpha1\x1a\x1fgoogle/protobuf/timestamp.proto\"g\n" +
	"\vGitIdentity\x12\x12\n" +
	"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
	"\x05email\x18\x02 \x01(\tR\x05email\x12.\n" +
	"\x04time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\"\xb4\x01\n" +
	"\x14GitCommitInformation\x12\x12\n" +
	"\x04hash\x18\x01 \x01(\tR\x04hash\x12@\n" +
	"\x06author\x18\x02 \x01(\v2(.buf.alpha.registry.v1alpha1.GitIdentityR\x06author\x12F\n" +
	"\tcommitter\x18\x03 \x01(\v2(.buf.alpha.registry.v1alpha1.GitIdentityR\tcommitterB\x9d\x02\n" +
	"\x1fcom.buf.alpha.registry.v1alpha1B\x10GitMetadataProtoP\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\xa2\x02\x03BAR\xaa\x02\x1bBuf.Alpha.Registry.V1alpha1\xca\x02\x1bBuf\\Alpha\\Registry\\V1alpha1\xe2\x02'Buf\\Alpha\\Registry\\V1alpha1\\GPBMetadata\xea\x02\x1eBuf::Alpha::Registry::V1alpha1b\x06proto3"

var file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes = []any{
	(*GitIdentity)(nil),           // 0: buf.alpha.registry.v1alpha1.GitIdentity
	(*GitCommitInformation)(nil),  // 1: buf.alpha.registry.v1alpha1.GitCommitInformation
	(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
}
var file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs = []int32{
	2, // 0: buf.alpha.registry.v1alpha1.GitIdentity.time:type_name -> google.protobuf.Timestamp
	0, // 1: buf.alpha.registry.v1alpha1.GitCommitInformation.author:type_name -> buf.alpha.registry.v1alpha1.GitIdentity
	0, // 2: buf.alpha.registry.v1alpha1.GitCommitInformation.committer:type_name -> buf.alpha.registry.v1alpha1.GitIdentity
	3, // [3:3] is the sub-list for method output_type
	3, // [3:3] is the sub-list for method input_type
	3, // [3:3] is the sub-list for extension type_name
	3, // [3:3] is the sub-list for extension extendee
	0, // [0:3] is the sub-list for field type_name
}

func init() { file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() }
func file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() {
	if File_buf_alpha_registry_v1alpha1_git_metadata_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes,
		DependencyIndexes: file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs,
		MessageInfos:      file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes,
	}.Build()
	File_buf_alpha_registry_v1alpha1_git_metadata_proto = out.File
	file_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes = nil
	file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs = nil
}
