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

package sqlserver

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)
)

// Set of server roles.
type ServerRole int32

const (
	ServerRole_SERVER_ROLE_UNSPECIFIED ServerRole = 0
	// Effectively grants VIEW SERVER STATE to the login.
	//
	// That gives an ability to use various dynamic management views to monitor server state, including Activity Monitor tool that is built-in into SSMS.
	//
	// No intrusive actions are allowed, so this is pretty safe to grant.
	ServerRole_MDB_MONITOR ServerRole = 1
)

// Enum value maps for ServerRole.
var (
	ServerRole_name = map[int32]string{
		0: "SERVER_ROLE_UNSPECIFIED",
		1: "MDB_MONITOR",
	}
	ServerRole_value = map[string]int32{
		"SERVER_ROLE_UNSPECIFIED": 0,
		"MDB_MONITOR":             1,
	}
)

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

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

func (ServerRole) Descriptor() protoreflect.EnumDescriptor {
	return file_yandex_cloud_mdb_sqlserver_v1_user_proto_enumTypes[0].Descriptor()
}

func (ServerRole) Type() protoreflect.EnumType {
	return &file_yandex_cloud_mdb_sqlserver_v1_user_proto_enumTypes[0]
}

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

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

// Role granted to the user within the database.
type Permission_Role int32

const (
	Permission_ROLE_UNSPECIFIED Permission_Role = 0
	// Members of this fixed database role can perform all configuration and maintenance activities on a database and can also drop a database in SQL Server.
	Permission_DB_OWNER Permission_Role = 1
	// Members of this fixed database role can modify role membership for custom roles only and manage permissions. They can potentially elevate their privileges and their actions should be monitored.
	Permission_DB_SECURITYADMIN Permission_Role = 2
	// Members of this fixed database role can add or remove access to a database for Windows logins, Windows groups, and SQL Server logins.
	Permission_DB_ACCESSADMIN Permission_Role = 3
	// Members of this fixed database role can back up the database.
	Permission_DB_BACKUPOPERATOR Permission_Role = 4
	// Members of this fixed database role can run any Data Definition Language (DDL) command in a database.
	Permission_DB_DDLADMIN Permission_Role = 5
	// Members of this fixed database role can add, delete, or change data in all user tables.
	Permission_DB_DATAWRITER Permission_Role = 6
	// Members of this fixed database role can read all data from all user tables.
	Permission_DB_DATAREADER Permission_Role = 7
	// Members of this fixed database role cannot add, modify, or delete any data in the user tables within a database. A denial has a higher priority than a grant, so you can use this role to quickly restrict one's privileges without explicitly revoking permissions or roles.
	Permission_DB_DENYDATAWRITER Permission_Role = 8
	// Members of this fixed database role cannot read any data in the user tables within a database. A denial has a higher priority than a grant, so you can use this role to quickly restrict one's privileges without explicitly revoking permissions or roles.
	Permission_DB_DENYDATAREADER Permission_Role = 9
)

// Enum value maps for Permission_Role.
var (
	Permission_Role_name = map[int32]string{
		0: "ROLE_UNSPECIFIED",
		1: "DB_OWNER",
		2: "DB_SECURITYADMIN",
		3: "DB_ACCESSADMIN",
		4: "DB_BACKUPOPERATOR",
		5: "DB_DDLADMIN",
		6: "DB_DATAWRITER",
		7: "DB_DATAREADER",
		8: "DB_DENYDATAWRITER",
		9: "DB_DENYDATAREADER",
	}
	Permission_Role_value = map[string]int32{
		"ROLE_UNSPECIFIED":  0,
		"DB_OWNER":          1,
		"DB_SECURITYADMIN":  2,
		"DB_ACCESSADMIN":    3,
		"DB_BACKUPOPERATOR": 4,
		"DB_DDLADMIN":       5,
		"DB_DATAWRITER":     6,
		"DB_DATAREADER":     7,
		"DB_DENYDATAWRITER": 8,
		"DB_DENYDATAREADER": 9,
	}
)

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

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

func (Permission_Role) Descriptor() protoreflect.EnumDescriptor {
	return file_yandex_cloud_mdb_sqlserver_v1_user_proto_enumTypes[1].Descriptor()
}

func (Permission_Role) Type() protoreflect.EnumType {
	return &file_yandex_cloud_mdb_sqlserver_v1_user_proto_enumTypes[1]
}

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

// Deprecated: Use Permission_Role.Descriptor instead.
func (Permission_Role) EnumDescriptor() ([]byte, []int) {
	return file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescGZIP(), []int{1, 0}
}

// An SQL Server user.
type User struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the SQL Server user.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// ID of the SQL Server cluster the user belongs to.
	ClusterId string `protobuf:"bytes,2,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
	// Set of permissions granted to the user.
	Permissions []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"`
	// Set of server roles granted to the login.
	ServerRoles   []ServerRole `protobuf:"varint,4,rep,packed,name=server_roles,json=serverRoles,proto3,enum=yandex.cloud.mdb.sqlserver.v1.ServerRole" json:"server_roles,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *User) Reset() {
	*x = User{}
	mi := &file_yandex_cloud_mdb_sqlserver_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_sqlserver_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_sqlserver_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
}

func (x *User) GetServerRoles() []ServerRole {
	if x != nil {
		return x.ServerRoles
	}
	return nil
}

type Permission struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the database the permission grants access to.
	DatabaseName string `protobuf:"bytes,1,opt,name=database_name,json=databaseName,proto3" json:"database_name,omitempty"`
	// Roles granted to the user within the database.
	Roles         []Permission_Role `protobuf:"varint,2,rep,packed,name=roles,proto3,enum=yandex.cloud.mdb.sqlserver.v1.Permission_Role" json:"roles,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Permission) Reset() {
	*x = Permission{}
	mi := &file_yandex_cloud_mdb_sqlserver_v1_user_proto_msgTypes[1]
	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_sqlserver_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 Permission.ProtoReflect.Descriptor instead.
func (*Permission) Descriptor() ([]byte, []int) {
	return file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescGZIP(), []int{1}
}

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

func (x *Permission) GetRoles() []Permission_Role {
	if x != nil {
		return x.Roles
	}
	return nil
}

type UserSpec struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the SQL Server user.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Password of the SQL Server user.
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// Set of permissions to grant to the user.
	Permissions []*Permission `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"`
	// Set of server roles.
	ServerRoles   []ServerRole `protobuf:"varint,4,rep,packed,name=server_roles,json=serverRoles,proto3,enum=yandex.cloud.mdb.sqlserver.v1.ServerRole" json:"server_roles,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *UserSpec) Reset() {
	*x = UserSpec{}
	mi := &file_yandex_cloud_mdb_sqlserver_v1_user_proto_msgTypes[2]
	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_sqlserver_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 UserSpec.ProtoReflect.Descriptor instead.
func (*UserSpec) Descriptor() ([]byte, []int) {
	return file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescGZIP(), []int{2}
}

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
}

func (x *UserSpec) GetServerRoles() []ServerRole {
	if x != nil {
		return x.ServerRoles
	}
	return nil
}

var File_yandex_cloud_mdb_sqlserver_v1_user_proto protoreflect.FileDescriptor

const file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDesc = "" +
	"\n" +
	"(yandex/cloud/mdb/sqlserver/v1/user.proto\x12\x1dyandex.cloud.mdb.sqlserver.v1\x1a\x1dyandex/cloud/validation.proto\"\xd4\x01\n" +
	"\x04User\x12\x12\n" +
	"\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" +
	"\n" +
	"cluster_id\x18\x02 \x01(\tR\tclusterId\x12K\n" +
	"\vpermissions\x18\x03 \x03(\v2).yandex.cloud.mdb.sqlserver.v1.PermissionR\vpermissions\x12L\n" +
	"\fserver_roles\x18\x04 \x03(\x0e2).yandex.cloud.mdb.sqlserver.v1.ServerRoleR\vserverRoles\"\xd3\x02\n" +
	"\n" +
	"Permission\x12#\n" +
	"\rdatabase_name\x18\x01 \x01(\tR\fdatabaseName\x12M\n" +
	"\x05roles\x18\x02 \x03(\x0e2..yandex.cloud.mdb.sqlserver.v1.Permission.RoleB\a\x82\xc81\x03>=1R\x05roles\"\xd0\x01\n" +
	"\x04Role\x12\x14\n" +
	"\x10ROLE_UNSPECIFIED\x10\x00\x12\f\n" +
	"\bDB_OWNER\x10\x01\x12\x14\n" +
	"\x10DB_SECURITYADMIN\x10\x02\x12\x12\n" +
	"\x0eDB_ACCESSADMIN\x10\x03\x12\x15\n" +
	"\x11DB_BACKUPOPERATOR\x10\x04\x12\x0f\n" +
	"\vDB_DDLADMIN\x10\x05\x12\x11\n" +
	"\rDB_DATAWRITER\x10\x06\x12\x11\n" +
	"\rDB_DATAREADER\x10\a\x12\x15\n" +
	"\x11DB_DENYDATAWRITER\x10\b\x12\x15\n" +
	"\x11DB_DENYDATAREADER\x10\t\"\x83\x02\n" +
	"\bUserSpec\x121\n" +
	"\x04name\x18\x01 \x01(\tB\x1d\xe8\xc71\x01\xf2\xc71\r[a-zA-Z0-9_]*\x8a\xc81\x04<=32R\x04name\x12)\n" +
	"\bpassword\x18\x02 \x01(\tB\r\xe8\xc71\x01\x8a\xc81\x058-128R\bpassword\x12K\n" +
	"\vpermissions\x18\x03 \x03(\v2).yandex.cloud.mdb.sqlserver.v1.PermissionR\vpermissions\x12L\n" +
	"\fserver_roles\x18\x04 \x03(\x0e2).yandex.cloud.mdb.sqlserver.v1.ServerRoleR\vserverRoles*:\n" +
	"\n" +
	"ServerRole\x12\x1b\n" +
	"\x17SERVER_ROLE_UNSPECIFIED\x10\x00\x12\x0f\n" +
	"\vMDB_MONITOR\x10\x01Bu\n" +
	"!yandex.cloud.api.mdb.sqlserver.v1B\x03PSUZKgithub.com/yandex-cloud/go-genproto/yandex/cloud/mdb/sqlserver/v1;sqlserverb\x06proto3"

var (
	file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescOnce sync.Once
	file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescData []byte
)

func file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescGZIP() []byte {
	file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescOnce.Do(func() {
		file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDesc), len(file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDesc)))
	})
	return file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDescData
}

var file_yandex_cloud_mdb_sqlserver_v1_user_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_yandex_cloud_mdb_sqlserver_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_yandex_cloud_mdb_sqlserver_v1_user_proto_goTypes = []any{
	(ServerRole)(0),      // 0: yandex.cloud.mdb.sqlserver.v1.ServerRole
	(Permission_Role)(0), // 1: yandex.cloud.mdb.sqlserver.v1.Permission.Role
	(*User)(nil),         // 2: yandex.cloud.mdb.sqlserver.v1.User
	(*Permission)(nil),   // 3: yandex.cloud.mdb.sqlserver.v1.Permission
	(*UserSpec)(nil),     // 4: yandex.cloud.mdb.sqlserver.v1.UserSpec
}
var file_yandex_cloud_mdb_sqlserver_v1_user_proto_depIdxs = []int32{
	3, // 0: yandex.cloud.mdb.sqlserver.v1.User.permissions:type_name -> yandex.cloud.mdb.sqlserver.v1.Permission
	0, // 1: yandex.cloud.mdb.sqlserver.v1.User.server_roles:type_name -> yandex.cloud.mdb.sqlserver.v1.ServerRole
	1, // 2: yandex.cloud.mdb.sqlserver.v1.Permission.roles:type_name -> yandex.cloud.mdb.sqlserver.v1.Permission.Role
	3, // 3: yandex.cloud.mdb.sqlserver.v1.UserSpec.permissions:type_name -> yandex.cloud.mdb.sqlserver.v1.Permission
	0, // 4: yandex.cloud.mdb.sqlserver.v1.UserSpec.server_roles:type_name -> yandex.cloud.mdb.sqlserver.v1.ServerRole
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] 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_yandex_cloud_mdb_sqlserver_v1_user_proto_init() }
func file_yandex_cloud_mdb_sqlserver_v1_user_proto_init() {
	if File_yandex_cloud_mdb_sqlserver_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_sqlserver_v1_user_proto_rawDesc), len(file_yandex_cloud_mdb_sqlserver_v1_user_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_yandex_cloud_mdb_sqlserver_v1_user_proto_goTypes,
		DependencyIndexes: file_yandex_cloud_mdb_sqlserver_v1_user_proto_depIdxs,
		EnumInfos:         file_yandex_cloud_mdb_sqlserver_v1_user_proto_enumTypes,
		MessageInfos:      file_yandex_cloud_mdb_sqlserver_v1_user_proto_msgTypes,
	}.Build()
	File_yandex_cloud_mdb_sqlserver_v1_user_proto = out.File
	file_yandex_cloud_mdb_sqlserver_v1_user_proto_goTypes = nil
	file_yandex_cloud_mdb_sqlserver_v1_user_proto_depIdxs = nil
}
