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

package mysql

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_Privilege int32

const (
	Permission_PRIVILEGE_UNSPECIFIED Permission_Privilege = 0
	// All privileges that can be made available to the user.
	Permission_ALL_PRIVILEGES Permission_Privilege = 1
	// Altering tables.
	Permission_ALTER Permission_Privilege = 2
	// Altering stored routines (stored procedures and functions).
	Permission_ALTER_ROUTINE Permission_Privilege = 3
	// Creating tables or indexes.
	Permission_CREATE Permission_Privilege = 4
	// Creating stored routines.
	Permission_CREATE_ROUTINE Permission_Privilege = 5
	// Creating temporary tables.
	Permission_CREATE_TEMPORARY_TABLES Permission_Privilege = 6
	// Creating views.
	Permission_CREATE_VIEW Permission_Privilege = 7
	// Deleting tables.
	Permission_DELETE Permission_Privilege = 8
	// Removing tables or views.
	Permission_DROP Permission_Privilege = 9
	// Creating, altering, dropping, or displaying events for the Event Scheduler.
	Permission_EVENT Permission_Privilege = 10
	// Executing stored routines.
	Permission_EXECUTE Permission_Privilege = 11
	// Creating and removing indexes.
	Permission_INDEX Permission_Privilege = 12
	// Inserting rows into the database.
	Permission_INSERT Permission_Privilege = 13
	// Using LOCK TABLES statement for tables available with SELECT privilege.
	Permission_LOCK_TABLES Permission_Privilege = 14
	// Selecting rows from tables.
	//
	// Some SELECT statements can be allowed without the SELECT privilege. All statements that read column values require the SELECT privilege. See details in [MySQL documentation](https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html#priv_select).
	Permission_SELECT Permission_Privilege = 15
	// Using the SHOW CREATE VIEW statement. Also needed for views used with EXPLAIN.
	Permission_SHOW_VIEW Permission_Privilege = 16
	// Creating, removing, executing, or displaying triggers for a table.
	Permission_TRIGGER Permission_Privilege = 17
	// Updating rows in the database.
	Permission_UPDATE Permission_Privilege = 18
)

// Enum value maps for Permission_Privilege.
var (
	Permission_Privilege_name = map[int32]string{
		0:  "PRIVILEGE_UNSPECIFIED",
		1:  "ALL_PRIVILEGES",
		2:  "ALTER",
		3:  "ALTER_ROUTINE",
		4:  "CREATE",
		5:  "CREATE_ROUTINE",
		6:  "CREATE_TEMPORARY_TABLES",
		7:  "CREATE_VIEW",
		8:  "DELETE",
		9:  "DROP",
		10: "EVENT",
		11: "EXECUTE",
		12: "INDEX",
		13: "INSERT",
		14: "LOCK_TABLES",
		15: "SELECT",
		16: "SHOW_VIEW",
		17: "TRIGGER",
		18: "UPDATE",
	}
	Permission_Privilege_value = map[string]int32{
		"PRIVILEGE_UNSPECIFIED":   0,
		"ALL_PRIVILEGES":          1,
		"ALTER":                   2,
		"ALTER_ROUTINE":           3,
		"CREATE":                  4,
		"CREATE_ROUTINE":          5,
		"CREATE_TEMPORARY_TABLES": 6,
		"CREATE_VIEW":             7,
		"DELETE":                  8,
		"DROP":                    9,
		"EVENT":                   10,
		"EXECUTE":                 11,
		"INDEX":                   12,
		"INSERT":                  13,
		"LOCK_TABLES":             14,
		"SELECT":                  15,
		"SHOW_VIEW":               16,
		"TRIGGER":                 17,
		"UPDATE":                  18,
	}
)

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

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

func (Permission_Privilege) Descriptor() protoreflect.EnumDescriptor {
	return file_yandex_cloud_mdb_mysql_v1alpha_user_proto_enumTypes[0].Descriptor()
}

func (Permission_Privilege) Type() protoreflect.EnumType {
	return &file_yandex_cloud_mdb_mysql_v1alpha_user_proto_enumTypes[0]
}

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

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

// A MySQL user. For more information, see the [documentation](/docs/managed-mysql/concepts).
type User struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the MySQL user.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// ID of the MySQL 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"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *User) Reset() {
	*x = User{}
	mi := &file_yandex_cloud_mdb_mysql_v1alpha_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_mysql_v1alpha_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_mysql_v1alpha_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 Permission struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the database that 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_Privilege `protobuf:"varint,2,rep,packed,name=roles,proto3,enum=yandex.cloud.mdb.mysql.v1alpha.Permission_Privilege" json:"roles,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Permission) Reset() {
	*x = Permission{}
	mi := &file_yandex_cloud_mdb_mysql_v1alpha_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_mysql_v1alpha_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_mysql_v1alpha_user_proto_rawDescGZIP(), []int{1}
}

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

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

type UserSpec struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Name of the MySQL user.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Password of the MySQL 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"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *UserSpec) Reset() {
	*x = UserSpec{}
	mi := &file_yandex_cloud_mdb_mysql_v1alpha_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_mysql_v1alpha_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_mysql_v1alpha_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
}

var File_yandex_cloud_mdb_mysql_v1alpha_user_proto protoreflect.FileDescriptor

const file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDesc = "" +
	"\n" +
	")yandex/cloud/mdb/mysql/v1alpha/user.proto\x12\x1eyandex.cloud.mdb.mysql.v1alpha\x1a\x1dyandex/cloud/validation.proto\"\x87\x01\n" +
	"\x04User\x12\x12\n" +
	"\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" +
	"\n" +
	"cluster_id\x18\x02 \x01(\tR\tclusterId\x12L\n" +
	"\vpermissions\x18\x03 \x03(\v2*.yandex.cloud.mdb.mysql.v1alpha.PermissionR\vpermissions\"\xb9\x03\n" +
	"\n" +
	"Permission\x12#\n" +
	"\rdatabase_name\x18\x01 \x01(\tR\fdatabaseName\x12S\n" +
	"\x05roles\x18\x02 \x03(\x0e24.yandex.cloud.mdb.mysql.v1alpha.Permission.PrivilegeB\a\x82\xc81\x03>=1R\x05roles\"\xb0\x02\n" +
	"\tPrivilege\x12\x19\n" +
	"\x15PRIVILEGE_UNSPECIFIED\x10\x00\x12\x12\n" +
	"\x0eALL_PRIVILEGES\x10\x01\x12\t\n" +
	"\x05ALTER\x10\x02\x12\x11\n" +
	"\rALTER_ROUTINE\x10\x03\x12\n" +
	"\n" +
	"\x06CREATE\x10\x04\x12\x12\n" +
	"\x0eCREATE_ROUTINE\x10\x05\x12\x1b\n" +
	"\x17CREATE_TEMPORARY_TABLES\x10\x06\x12\x0f\n" +
	"\vCREATE_VIEW\x10\a\x12\n" +
	"\n" +
	"\x06DELETE\x10\b\x12\b\n" +
	"\x04DROP\x10\t\x12\t\n" +
	"\x05EVENT\x10\n" +
	"\x12\v\n" +
	"\aEXECUTE\x10\v\x12\t\n" +
	"\x05INDEX\x10\f\x12\n" +
	"\n" +
	"\x06INSERT\x10\r\x12\x0f\n" +
	"\vLOCK_TABLES\x10\x0e\x12\n" +
	"\n" +
	"\x06SELECT\x10\x0f\x12\r\n" +
	"\tSHOW_VIEW\x10\x10\x12\v\n" +
	"\aTRIGGER\x10\x11\x12\n" +
	"\n" +
	"\x06UPDATE\x10\x12\"\xb6\x01\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\x12L\n" +
	"\vpermissions\x18\x03 \x03(\v2*.yandex.cloud.mdb.mysql.v1alpha.PermissionR\vpermissionsBn\n" +
	"\"yandex.cloud.api.mdb.mysql.v1alphaZHgithub.com/yandex-cloud/go-genproto/yandex/cloud/mdb/mysql/v1alpha;mysqlb\x06proto3"

var (
	file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDescOnce sync.Once
	file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDescData []byte
)

func file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDescGZIP() []byte {
	file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDescOnce.Do(func() {
		file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDesc), len(file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDesc)))
	})
	return file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDescData
}

var file_yandex_cloud_mdb_mysql_v1alpha_user_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_yandex_cloud_mdb_mysql_v1alpha_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_yandex_cloud_mdb_mysql_v1alpha_user_proto_goTypes = []any{
	(Permission_Privilege)(0), // 0: yandex.cloud.mdb.mysql.v1alpha.Permission.Privilege
	(*User)(nil),              // 1: yandex.cloud.mdb.mysql.v1alpha.User
	(*Permission)(nil),        // 2: yandex.cloud.mdb.mysql.v1alpha.Permission
	(*UserSpec)(nil),          // 3: yandex.cloud.mdb.mysql.v1alpha.UserSpec
}
var file_yandex_cloud_mdb_mysql_v1alpha_user_proto_depIdxs = []int32{
	2, // 0: yandex.cloud.mdb.mysql.v1alpha.User.permissions:type_name -> yandex.cloud.mdb.mysql.v1alpha.Permission
	0, // 1: yandex.cloud.mdb.mysql.v1alpha.Permission.roles:type_name -> yandex.cloud.mdb.mysql.v1alpha.Permission.Privilege
	2, // 2: yandex.cloud.mdb.mysql.v1alpha.UserSpec.permissions:type_name -> yandex.cloud.mdb.mysql.v1alpha.Permission
	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_mysql_v1alpha_user_proto_init() }
func file_yandex_cloud_mdb_mysql_v1alpha_user_proto_init() {
	if File_yandex_cloud_mdb_mysql_v1alpha_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_mysql_v1alpha_user_proto_rawDesc), len(file_yandex_cloud_mdb_mysql_v1alpha_user_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_yandex_cloud_mdb_mysql_v1alpha_user_proto_goTypes,
		DependencyIndexes: file_yandex_cloud_mdb_mysql_v1alpha_user_proto_depIdxs,
		EnumInfos:         file_yandex_cloud_mdb_mysql_v1alpha_user_proto_enumTypes,
		MessageInfos:      file_yandex_cloud_mdb_mysql_v1alpha_user_proto_msgTypes,
	}.Build()
	File_yandex_cloud_mdb_mysql_v1alpha_user_proto = out.File
	file_yandex_cloud_mdb_mysql_v1alpha_user_proto_goTypes = nil
	file_yandex_cloud_mdb_mysql_v1alpha_user_proto_depIdxs = nil
}
