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

package iam

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"
	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 Key_Algorithm int32

const (
	Key_ALGORITHM_UNSPECIFIED Key_Algorithm = 0
	// RSA with a 2048-bit key size. Default value.
	Key_RSA_2048 Key_Algorithm = 1
	// RSA with a 4096-bit key size.
	Key_RSA_4096 Key_Algorithm = 2
)

// Enum value maps for Key_Algorithm.
var (
	Key_Algorithm_name = map[int32]string{
		0: "ALGORITHM_UNSPECIFIED",
		1: "RSA_2048",
		2: "RSA_4096",
	}
	Key_Algorithm_value = map[string]int32{
		"ALGORITHM_UNSPECIFIED": 0,
		"RSA_2048":              1,
		"RSA_4096":              2,
	}
)

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

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

func (Key_Algorithm) Descriptor() protoreflect.EnumDescriptor {
	return file_yandex_cloud_iam_v1_key_proto_enumTypes[0].Descriptor()
}

func (Key_Algorithm) Type() protoreflect.EnumType {
	return &file_yandex_cloud_iam_v1_key_proto_enumTypes[0]
}

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

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

// A Key resource. For more information, see [Authorized keys](/docs/iam/concepts/authorization/key).
type Key struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// ID of the Key resource.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are valid to be assigned to Subject:
	//
	//	*Key_UserAccountId
	//	*Key_ServiceAccountId
	Subject isKey_Subject `protobuf_oneof:"subject"`
	// Creation timestamp.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Description of the Key resource. 0-256 characters long.
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// An algorithm used to generate a key pair of the Key resource.
	KeyAlgorithm Key_Algorithm `protobuf:"varint,6,opt,name=key_algorithm,json=keyAlgorithm,proto3,enum=yandex.cloud.iam.v1.Key_Algorithm" json:"key_algorithm,omitempty"`
	// A public key of the Key resource.
	PublicKey string `protobuf:"bytes,7,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// Timestamp for the last use of this key.
	LastUsedAt    *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=last_used_at,json=lastUsedAt,proto3" json:"last_used_at,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Key) ProtoMessage() {}

func (x *Key) ProtoReflect() protoreflect.Message {
	mi := &file_yandex_cloud_iam_v1_key_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 Key.ProtoReflect.Descriptor instead.
func (*Key) Descriptor() ([]byte, []int) {
	return file_yandex_cloud_iam_v1_key_proto_rawDescGZIP(), []int{0}
}

func (x *Key) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *Key) GetSubject() isKey_Subject {
	if x != nil {
		return x.Subject
	}
	return nil
}

func (x *Key) GetUserAccountId() string {
	if x != nil {
		if x, ok := x.Subject.(*Key_UserAccountId); ok {
			return x.UserAccountId
		}
	}
	return ""
}

func (x *Key) GetServiceAccountId() string {
	if x != nil {
		if x, ok := x.Subject.(*Key_ServiceAccountId); ok {
			return x.ServiceAccountId
		}
	}
	return ""
}

func (x *Key) GetCreatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.CreatedAt
	}
	return nil
}

func (x *Key) GetDescription() string {
	if x != nil {
		return x.Description
	}
	return ""
}

func (x *Key) GetKeyAlgorithm() Key_Algorithm {
	if x != nil {
		return x.KeyAlgorithm
	}
	return Key_ALGORITHM_UNSPECIFIED
}

func (x *Key) GetPublicKey() string {
	if x != nil {
		return x.PublicKey
	}
	return ""
}

func (x *Key) GetLastUsedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.LastUsedAt
	}
	return nil
}

type isKey_Subject interface {
	isKey_Subject()
}

type Key_UserAccountId struct {
	// ID of the user account that the Key resource belongs to.
	UserAccountId string `protobuf:"bytes,2,opt,name=user_account_id,json=userAccountId,proto3,oneof"`
}

type Key_ServiceAccountId struct {
	// ID of the service account that the Key resource belongs to.
	ServiceAccountId string `protobuf:"bytes,3,opt,name=service_account_id,json=serviceAccountId,proto3,oneof"`
}

func (*Key_UserAccountId) isKey_Subject() {}

func (*Key_ServiceAccountId) isKey_Subject() {}

var File_yandex_cloud_iam_v1_key_proto protoreflect.FileDescriptor

const file_yandex_cloud_iam_v1_key_proto_rawDesc = "" +
	"\n" +
	"\x1dyandex/cloud/iam/v1/key.proto\x12\x13yandex.cloud.iam.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc7\x03\n" +
	"\x03Key\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\tR\x02id\x12(\n" +
	"\x0fuser_account_id\x18\x02 \x01(\tH\x00R\ruserAccountId\x12.\n" +
	"\x12service_account_id\x18\x03 \x01(\tH\x00R\x10serviceAccountId\x129\n" +
	"\n" +
	"created_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12 \n" +
	"\vdescription\x18\x05 \x01(\tR\vdescription\x12G\n" +
	"\rkey_algorithm\x18\x06 \x01(\x0e2\".yandex.cloud.iam.v1.Key.AlgorithmR\fkeyAlgorithm\x12\x1d\n" +
	"\n" +
	"public_key\x18\a \x01(\tR\tpublicKey\x12<\n" +
	"\flast_used_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\n" +
	"lastUsedAt\"B\n" +
	"\tAlgorithm\x12\x19\n" +
	"\x15ALGORITHM_UNSPECIFIED\x10\x00\x12\f\n" +
	"\bRSA_2048\x10\x01\x12\f\n" +
	"\bRSA_4096\x10\x02B\t\n" +
	"\asubjectJ\x04\b\b\x10\tBV\n" +
	"\x17yandex.cloud.api.iam.v1Z;github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1;iamb\x06proto3"

var (
	file_yandex_cloud_iam_v1_key_proto_rawDescOnce sync.Once
	file_yandex_cloud_iam_v1_key_proto_rawDescData []byte
)

func file_yandex_cloud_iam_v1_key_proto_rawDescGZIP() []byte {
	file_yandex_cloud_iam_v1_key_proto_rawDescOnce.Do(func() {
		file_yandex_cloud_iam_v1_key_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_yandex_cloud_iam_v1_key_proto_rawDesc), len(file_yandex_cloud_iam_v1_key_proto_rawDesc)))
	})
	return file_yandex_cloud_iam_v1_key_proto_rawDescData
}

var file_yandex_cloud_iam_v1_key_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_yandex_cloud_iam_v1_key_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_yandex_cloud_iam_v1_key_proto_goTypes = []any{
	(Key_Algorithm)(0),            // 0: yandex.cloud.iam.v1.Key.Algorithm
	(*Key)(nil),                   // 1: yandex.cloud.iam.v1.Key
	(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
}
var file_yandex_cloud_iam_v1_key_proto_depIdxs = []int32{
	2, // 0: yandex.cloud.iam.v1.Key.created_at:type_name -> google.protobuf.Timestamp
	0, // 1: yandex.cloud.iam.v1.Key.key_algorithm:type_name -> yandex.cloud.iam.v1.Key.Algorithm
	2, // 2: yandex.cloud.iam.v1.Key.last_used_at:type_name -> google.protobuf.Timestamp
	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_iam_v1_key_proto_init() }
func file_yandex_cloud_iam_v1_key_proto_init() {
	if File_yandex_cloud_iam_v1_key_proto != nil {
		return
	}
	file_yandex_cloud_iam_v1_key_proto_msgTypes[0].OneofWrappers = []any{
		(*Key_UserAccountId)(nil),
		(*Key_ServiceAccountId)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_yandex_cloud_iam_v1_key_proto_rawDesc), len(file_yandex_cloud_iam_v1_key_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_yandex_cloud_iam_v1_key_proto_goTypes,
		DependencyIndexes: file_yandex_cloud_iam_v1_key_proto_depIdxs,
		EnumInfos:         file_yandex_cloud_iam_v1_key_proto_enumTypes,
		MessageInfos:      file_yandex_cloud_iam_v1_key_proto_msgTypes,
	}.Build()
	File_yandex_cloud_iam_v1_key_proto = out.File
	file_yandex_cloud_iam_v1_key_proto_goTypes = nil
	file_yandex_cloud_iam_v1_key_proto_depIdxs = nil
}
