// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v3.21.12
// source: yandex/cloud/mdb/kafka/v1/user.proto

package kafka

import (
	_ "github.com/yandex-cloud/go-genproto/yandex/cloud"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	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 Permission_AccessRole int32

const (
	Permission_ACCESS_ROLE_UNSPECIFIED Permission_AccessRole = 0
	// Producer role for the user.
	Permission_ACCESS_ROLE_PRODUCER Permission_AccessRole = 1
	// Consumer role for the user.
	Permission_ACCESS_ROLE_CONSUMER Permission_AccessRole = 2
	// Admin role for the user.
	Permission_ACCESS_ROLE_ADMIN Permission_AccessRole = 3
	// Admin permissions on topics role for the user.
	Permission_ACCESS_ROLE_TOPIC_ADMIN    Permission_AccessRole = 4
	Permission_ACCESS_ROLE_TOPIC_PRODUCER Permission_AccessRole = 5
	Permission_ACCESS_ROLE_TOPIC_CONSUMER Permission_AccessRole = 6
	Permission_ACCESS_ROLE_SCHEMA_READER  Permission_AccessRole = 7
	Permission_ACCESS_ROLE_SCHEMA_WRITER  Permission_AccessRole = 8
)

// Enum value maps for Permission_AccessRole.
var (
	Permission_AccessRole_name = map[int32]string{
		0: "ACCESS_ROLE_UNSPECIFIED",
		1: "ACCESS_ROLE_PRODUCER",
		2: "ACCESS_ROLE_CONSUMER",
		3: "ACCESS_ROLE_ADMIN",
		4: "ACCESS_ROLE_TOPIC_ADMIN",
		5: "ACCESS_ROLE_TOPIC_PRODUCER",
		6: "ACCESS_ROLE_TOPIC_CONSUMER",
		7: "ACCESS_ROLE_SCHEMA_READER",
		8: "ACCESS_ROLE_SCHEMA_WRITER",
	}
	Permission_AccessRole_value = map[string]int32{
		"ACCESS_ROLE_UNSPECIFIED":    0,
		"ACCESS_ROLE_PRODUCER":       1,
		"ACCESS_ROLE_CONSUMER":       2,
		"ACCESS_ROLE_ADMIN":          3,
		"ACCESS_ROLE_TOPIC_ADMIN":    4,
		"ACCESS_ROLE_TOPIC_PRODUCER": 5,
		"ACCESS_ROLE_TOPIC_CONSUMER": 6,
		"ACCESS_ROLE_SCHEMA_READER":  7,
		"ACCESS_ROLE_SCHEMA_WRITER":  8,
	}
)

func (x Permission_AccessRole) Enum() *Permission_AccessRole {
	p := new(Permission_AccessRole)
	*p = x
	return p
}

func (x Permission_AccessRole) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (Permission_AccessRole) Descriptor() protoreflect.EnumDescriptor {
	return file_yandex_cloud_mdb_kafka_v1_user_proto_enumTypes[0].Descriptor()
}

func (Permission_AccessRole) Type() protoreflect.EnumType {
	return &file_yandex_cloud_mdb_kafka_v1_user_proto_enumTypes[0]
}

func (x Permission_AccessRole) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use Permission_AccessRole.Descriptor instead.
func (Permission_AccessRole) EnumDescriptor() ([]byte, []int) {
	return file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescGZIP(), []int{2, 0}
}

// A Kafka user.
// For more information, see the [Operations -> Accounts](/docs/managed-kafka/operations/cluster-accounts) section of the documentation.
type User struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the Kafka user.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// ID of the Apache Kafka® cluster the user belongs to.
	//
	// To get the Apache Kafka® cluster ID, make a [ClusterService.List] request.
	ClusterId string `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
	// Set of permissions granted to this user.
	Permissions   []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*User) ProtoMessage() {}

func (x *User) ProtoReflect() protoreflect.Message {
	mi := &file_yandex_cloud_mdb_kafka_v1_user_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)
}

// Deprecated: Use User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
	return file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescGZIP(), []int{0}
}

func (x *User) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}

func (x *User) GetClusterId() string {
	if x != nil {
		return x.ClusterId
	}
	return ""
}

func (x *User) GetPermissions() []*Permission {
	if x != nil {
		return x.Permissions
	}
	return nil
}

type UserSpec struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the Kafka user.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Password of the Kafka user.
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// Set of permissions granted to the user.
	Permissions   []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*UserSpec) ProtoMessage() {}

func (x *UserSpec) ProtoReflect() protoreflect.Message {
	mi := &file_yandex_cloud_mdb_kafka_v1_user_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)
}

// Deprecated: Use UserSpec.ProtoReflect.Descriptor instead.
func (*UserSpec) Descriptor() ([]byte, []int) {
	return file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescGZIP(), []int{1}
}

func (x *UserSpec) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}

func (x *UserSpec) GetPassword() string {
	if x != nil {
		return x.Password
	}
	return ""
}

func (x *UserSpec) GetPermissions() []*Permission {
	if x != nil {
		return x.Permissions
	}
	return nil
}

type Permission struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name or prefix-pattern with wildcard for the topic that the permission grants access to.
	// With roles SCHEMA_READER and SCHEMA_WRITER: string that contains set of schema registry subjects, separated by ';'.
	//
	// To get the topic name, make a [TopicService.List] request.
	TopicName string `protobuf:"bytes,1,opt,name=topic_name,json=topicName,proto3" json:"topic_name,omitempty"`
	// Access role type to grant to the user.
	Role Permission_AccessRole `protobuf:"varint,2,opt,name=role,proto3,enum=yandex.cloud.mdb.kafka.v1.Permission_AccessRole" json:"role,omitempty"`
	// Lists hosts allowed for this permission.
	// Only ip-addresses allowed as value of single host.
	// When not defined, access from any host is allowed.
	//
	// Bare in mind that the same host might appear in multiple permissions at the same time,
	// hence removing individual permission doesn't automatically restricts access from the [allow_hosts] of the permission.
	// If the same host(s) is listed for another permission of the same principal/topic, the host(s) remains allowed.
	AllowHosts    []string `protobuf:"bytes,4,rep,name=allow_hosts,json=allowHosts,proto3" json:"allow_hosts,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Permission) ProtoMessage() {}

func (x *Permission) ProtoReflect() protoreflect.Message {
	mi := &file_yandex_cloud_mdb_kafka_v1_user_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)
}

// Deprecated: Use Permission.ProtoReflect.Descriptor instead.
func (*Permission) Descriptor() ([]byte, []int) {
	return file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescGZIP(), []int{2}
}

func (x *Permission) GetTopicName() string {
	if x != nil {
		return x.TopicName
	}
	return ""
}

func (x *Permission) GetRole() Permission_AccessRole {
	if x != nil {
		return x.Role
	}
	return Permission_ACCESS_ROLE_UNSPECIFIED
}

func (x *Permission) GetAllowHosts() []string {
	if x != nil {
		return x.AllowHosts
	}
	return nil
}

var File_yandex_cloud_mdb_kafka_v1_user_proto protoreflect.FileDescriptor

const file_yandex_cloud_mdb_kafka_v1_user_proto_rawDesc = "" +
	"\n" +
	"$yandex/cloud/mdb/kafka/v1/user.proto\x12\x19yandex.cloud.mdb.kafka.v1\x1a\x1dyandex/cloud/validation.proto\"\x82\x01\n" +
	"\x04User\x12\x12\n" +
	"\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" +
	"\n" +
	"cluster_id\x18\x02 \x01(\tR\tclusterId\x12G\n" +
	"\vpermissions\x18\x03 \x03(\v2%.yandex.cloud.mdb.kafka.v1.PermissionR\vpermissions\"\xb2\x01\n" +
	"\bUserSpec\x122\n" +
	"\x04name\x18\x01 \x01(\tB\x1e\xe8\xc71\x01\xf2\xc71\r[a-zA-Z0-9_]*\x8a\xc81\x051-256R\x04name\x12)\n" +
	"\bpassword\x18\x02 \x01(\tB\r\xe8\xc71\x01\x8a\xc81\x058-128R\bpassword\x12G\n" +
	"\vpermissions\x18\x03 \x03(\v2%.yandex.cloud.mdb.kafka.v1.PermissionR\vpermissions\"\xaa\x03\n" +
	"\n" +
	"Permission\x12\x1d\n" +
	"\n" +
	"topic_name\x18\x01 \x01(\tR\ttopicName\x12D\n" +
	"\x04role\x18\x02 \x01(\x0e20.yandex.cloud.mdb.kafka.v1.Permission.AccessRoleR\x04role\x12\x1f\n" +
	"\vallow_hosts\x18\x04 \x03(\tR\n" +
	"allowHosts\"\x8f\x02\n" +
	"\n" +
	"AccessRole\x12\x1b\n" +
	"\x17ACCESS_ROLE_UNSPECIFIED\x10\x00\x12\x18\n" +
	"\x14ACCESS_ROLE_PRODUCER\x10\x01\x12\x18\n" +
	"\x14ACCESS_ROLE_CONSUMER\x10\x02\x12\x15\n" +
	"\x11ACCESS_ROLE_ADMIN\x10\x03\x12\x1b\n" +
	"\x17ACCESS_ROLE_TOPIC_ADMIN\x10\x04\x12\x1e\n" +
	"\x1aACCESS_ROLE_TOPIC_PRODUCER\x10\x05\x12\x1e\n" +
	"\x1aACCESS_ROLE_TOPIC_CONSUMER\x10\x06\x12\x1d\n" +
	"\x19ACCESS_ROLE_SCHEMA_READER\x10\a\x12\x1d\n" +
	"\x19ACCESS_ROLE_SCHEMA_WRITER\x10\bJ\x04\b\x03\x10\x04Bd\n" +
	"\x1dyandex.cloud.api.mdb.kafka.v1ZCgithub.com/yandex-cloud/go-genproto/yandex/cloud/mdb/kafka/v1;kafkab\x06proto3"

var (
	file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescOnce sync.Once
	file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescData []byte
)

func file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescGZIP() []byte {
	file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescOnce.Do(func() {
		file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_yandex_cloud_mdb_kafka_v1_user_proto_rawDesc), len(file_yandex_cloud_mdb_kafka_v1_user_proto_rawDesc)))
	})
	return file_yandex_cloud_mdb_kafka_v1_user_proto_rawDescData
}

var file_yandex_cloud_mdb_kafka_v1_user_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_yandex_cloud_mdb_kafka_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_yandex_cloud_mdb_kafka_v1_user_proto_goTypes = []any{
	(Permission_AccessRole)(0), // 0: yandex.cloud.mdb.kafka.v1.Permission.AccessRole
	(*User)(nil),               // 1: yandex.cloud.mdb.kafka.v1.User
	(*UserSpec)(nil),           // 2: yandex.cloud.mdb.kafka.v1.UserSpec
	(*Permission)(nil),         // 3: yandex.cloud.mdb.kafka.v1.Permission
}
var file_yandex_cloud_mdb_kafka_v1_user_proto_depIdxs = []int32{
	3, // 0: yandex.cloud.mdb.kafka.v1.User.permissions:type_name -> yandex.cloud.mdb.kafka.v1.Permission
	3, // 1: yandex.cloud.mdb.kafka.v1.UserSpec.permissions:type_name -> yandex.cloud.mdb.kafka.v1.Permission
	0, // 2: yandex.cloud.mdb.kafka.v1.Permission.role:type_name -> yandex.cloud.mdb.kafka.v1.Permission.AccessRole
	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_yandex_cloud_mdb_kafka_v1_user_proto_init() }
func file_yandex_cloud_mdb_kafka_v1_user_proto_init() {
	if File_yandex_cloud_mdb_kafka_v1_user_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_yandex_cloud_mdb_kafka_v1_user_proto_rawDesc), len(file_yandex_cloud_mdb_kafka_v1_user_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_yandex_cloud_mdb_kafka_v1_user_proto_goTypes,
		DependencyIndexes: file_yandex_cloud_mdb_kafka_v1_user_proto_depIdxs,
		EnumInfos:         file_yandex_cloud_mdb_kafka_v1_user_proto_enumTypes,
		MessageInfos:      file_yandex_cloud_mdb_kafka_v1_user_proto_msgTypes,
	}.Build()
	File_yandex_cloud_mdb_kafka_v1_user_proto = out.File
	file_yandex_cloud_mdb_kafka_v1_user_proto_goTypes = nil
	file_yandex_cloud_mdb_kafka_v1_user_proto_depIdxs = nil
}
