// Copyright 2020-2026 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/alpha/registry/v1alpha1/owner.proto

package registryv1alpha1

import (
	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 Owner struct {
	state            protoimpl.MessageState `protogen:"opaque.v1"`
	xxx_hidden_Owner isOwner_Owner          `protobuf_oneof:"owner"`
	unknownFields    protoimpl.UnknownFields
	sizeCache        protoimpl.SizeCache
}

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

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

func (*Owner) ProtoMessage() {}

func (x *Owner) ProtoReflect() protoreflect.Message {
	mi := &file_buf_alpha_registry_v1alpha1_owner_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 *Owner) GetUser() *User {
	if x != nil {
		if x, ok := x.xxx_hidden_Owner.(*owner_User); ok {
			return x.User
		}
	}
	return nil
}

func (x *Owner) GetOrganization() *Organization {
	if x != nil {
		if x, ok := x.xxx_hidden_Owner.(*owner_Organization); ok {
			return x.Organization
		}
	}
	return nil
}

func (x *Owner) SetUser(v *User) {
	if v == nil {
		x.xxx_hidden_Owner = nil
		return
	}
	x.xxx_hidden_Owner = &owner_User{v}
}

func (x *Owner) SetOrganization(v *Organization) {
	if v == nil {
		x.xxx_hidden_Owner = nil
		return
	}
	x.xxx_hidden_Owner = &owner_Organization{v}
}

func (x *Owner) HasOwner() bool {
	if x == nil {
		return false
	}
	return x.xxx_hidden_Owner != nil
}

func (x *Owner) HasUser() bool {
	if x == nil {
		return false
	}
	_, ok := x.xxx_hidden_Owner.(*owner_User)
	return ok
}

func (x *Owner) HasOrganization() bool {
	if x == nil {
		return false
	}
	_, ok := x.xxx_hidden_Owner.(*owner_Organization)
	return ok
}

func (x *Owner) ClearOwner() {
	x.xxx_hidden_Owner = nil
}

func (x *Owner) ClearUser() {
	if _, ok := x.xxx_hidden_Owner.(*owner_User); ok {
		x.xxx_hidden_Owner = nil
	}
}

func (x *Owner) ClearOrganization() {
	if _, ok := x.xxx_hidden_Owner.(*owner_Organization); ok {
		x.xxx_hidden_Owner = nil
	}
}

const Owner_Owner_not_set_case case_Owner_Owner = 0
const Owner_User_case case_Owner_Owner = 1
const Owner_Organization_case case_Owner_Owner = 2

func (x *Owner) WhichOwner() case_Owner_Owner {
	if x == nil {
		return Owner_Owner_not_set_case
	}
	switch x.xxx_hidden_Owner.(type) {
	case *owner_User:
		return Owner_User_case
	case *owner_Organization:
		return Owner_Organization_case
	default:
		return Owner_Owner_not_set_case
	}
}

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

	// Fields of oneof xxx_hidden_Owner:
	// The requested owner is a `User`.
	User *User
	// The requested owner is a `Organization`.
	Organization *Organization
	// -- end of xxx_hidden_Owner
}

func (b0 Owner_builder) Build() *Owner {
	m0 := &Owner{}
	b, x := &b0, m0
	_, _ = b, x
	if b.User != nil {
		x.xxx_hidden_Owner = &owner_User{b.User}
	}
	if b.Organization != nil {
		x.xxx_hidden_Owner = &owner_Organization{b.Organization}
	}
	return m0
}

type case_Owner_Owner protoreflect.FieldNumber

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

type isOwner_Owner interface {
	isOwner_Owner()
}

type owner_User struct {
	// The requested owner is a `User`.
	User *User `protobuf:"bytes,1,opt,name=user,proto3,oneof"`
}

type owner_Organization struct {
	// The requested owner is a `Organization`.
	Organization *Organization `protobuf:"bytes,2,opt,name=organization,proto3,oneof"`
}

func (*owner_User) isOwner_Owner() {}

func (*owner_Organization) isOwner_Owner() {}

type GetOwnerByNameRequest struct {
	state           protoimpl.MessageState `protogen:"opaque.v1"`
	xxx_hidden_Name string                 `protobuf:"bytes,1,opt,name=name,proto3"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

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

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

func (*GetOwnerByNameRequest) ProtoMessage() {}

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

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

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

	// Name of the requested owner.
	Name string
}

func (b0 GetOwnerByNameRequest_builder) Build() *GetOwnerByNameRequest {
	m0 := &GetOwnerByNameRequest{}
	b, x := &b0, m0
	_, _ = b, x
	x.xxx_hidden_Name = b.Name
	return m0
}

type GetOwnerByNameResponse struct {
	state            protoimpl.MessageState `protogen:"opaque.v1"`
	xxx_hidden_Owner *Owner                 `protobuf:"bytes,1,opt,name=owner,proto3"`
	unknownFields    protoimpl.UnknownFields
	sizeCache        protoimpl.SizeCache
}

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

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

func (*GetOwnerByNameResponse) ProtoMessage() {}

func (x *GetOwnerByNameResponse) ProtoReflect() protoreflect.Message {
	mi := &file_buf_alpha_registry_v1alpha1_owner_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 *GetOwnerByNameResponse) GetOwner() *Owner {
	if x != nil {
		return x.xxx_hidden_Owner
	}
	return nil
}

func (x *GetOwnerByNameResponse) SetOwner(v *Owner) {
	x.xxx_hidden_Owner = v
}

func (x *GetOwnerByNameResponse) HasOwner() bool {
	if x == nil {
		return false
	}
	return x.xxx_hidden_Owner != nil
}

func (x *GetOwnerByNameResponse) ClearOwner() {
	x.xxx_hidden_Owner = nil
}

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

	Owner *Owner
}

func (b0 GetOwnerByNameResponse_builder) Build() *GetOwnerByNameResponse {
	m0 := &GetOwnerByNameResponse{}
	b, x := &b0, m0
	_, _ = b, x
	x.xxx_hidden_Owner = b.Owner
	return m0
}

var File_buf_alpha_registry_v1alpha1_owner_proto protoreflect.FileDescriptor

const file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc = "" +
	"\n" +
	"'buf/alpha/registry/v1alpha1/owner.proto\x12\x1bbuf.alpha.registry.v1alpha1\x1a.buf/alpha/registry/v1alpha1/organization.proto\x1a&buf/alpha/registry/v1alpha1/user.proto\"\x9a\x01\n" +
	"\x05Owner\x127\n" +
	"\x04user\x18\x01 \x01(\v2!.buf.alpha.registry.v1alpha1.UserH\x00R\x04user\x12O\n" +
	"\forganization\x18\x02 \x01(\v2).buf.alpha.registry.v1alpha1.OrganizationH\x00R\forganizationB\a\n" +
	"\x05owner\"+\n" +
	"\x15GetOwnerByNameRequest\x12\x12\n" +
	"\x04name\x18\x01 \x01(\tR\x04name\"R\n" +
	"\x16GetOwnerByNameResponse\x128\n" +
	"\x05owner\x18\x01 \x01(\v2\".buf.alpha.registry.v1alpha1.OwnerR\x05owner2\x8e\x01\n" +
	"\fOwnerService\x12~\n" +
	"\x0eGetOwnerByName\x122.buf.alpha.registry.v1alpha1.GetOwnerByNameRequest\x1a3.buf.alpha.registry.v1alpha1.GetOwnerByNameResponse\"\x03\x90\x02\x01B\x97\x02\n" +
	"\x1fcom.buf.alpha.registry.v1alpha1B\n" +
	"OwnerProtoP\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_owner_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_buf_alpha_registry_v1alpha1_owner_proto_goTypes = []any{
	(*Owner)(nil),                  // 0: buf.alpha.registry.v1alpha1.Owner
	(*GetOwnerByNameRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.GetOwnerByNameRequest
	(*GetOwnerByNameResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetOwnerByNameResponse
	(*User)(nil),                   // 3: buf.alpha.registry.v1alpha1.User
	(*Organization)(nil),           // 4: buf.alpha.registry.v1alpha1.Organization
}
var file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs = []int32{
	3, // 0: buf.alpha.registry.v1alpha1.Owner.user:type_name -> buf.alpha.registry.v1alpha1.User
	4, // 1: buf.alpha.registry.v1alpha1.Owner.organization:type_name -> buf.alpha.registry.v1alpha1.Organization
	0, // 2: buf.alpha.registry.v1alpha1.GetOwnerByNameResponse.owner:type_name -> buf.alpha.registry.v1alpha1.Owner
	1, // 3: buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName:input_type -> buf.alpha.registry.v1alpha1.GetOwnerByNameRequest
	2, // 4: buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName:output_type -> buf.alpha.registry.v1alpha1.GetOwnerByNameResponse
	4, // [4:5] is the sub-list for method output_type
	3, // [3:4] 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_owner_proto_init() }
func file_buf_alpha_registry_v1alpha1_owner_proto_init() {
	if File_buf_alpha_registry_v1alpha1_owner_proto != nil {
		return
	}
	file_buf_alpha_registry_v1alpha1_organization_proto_init()
	file_buf_alpha_registry_v1alpha1_user_proto_init()
	file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0].OneofWrappers = []any{
		(*owner_User)(nil),
		(*owner_Organization)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_buf_alpha_registry_v1alpha1_owner_proto_goTypes,
		DependencyIndexes: file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs,
		MessageInfos:      file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes,
	}.Build()
	File_buf_alpha_registry_v1alpha1_owner_proto = out.File
	file_buf_alpha_registry_v1alpha1_owner_proto_goTypes = nil
	file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs = nil
}
