iamkey.pb.go raw

   1  // Code generated by protoc-gen-go. DO NOT EDIT.
   2  // versions:
   3  // 	protoc-gen-go v1.36.6
   4  // 	protoc        v3.20.3
   5  // source: iamkey.proto
   6  
   7  package iamkey
   8  
   9  import (
  10  	v1 "github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1"
  11  	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  12  	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  13  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
  14  	reflect "reflect"
  15  	sync "sync"
  16  	unsafe "unsafe"
  17  )
  18  
  19  const (
  20  	// Verify that this generated code is sufficiently up-to-date.
  21  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  22  	// Verify that runtime/protoimpl is sufficiently up-to-date.
  23  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  24  )
  25  
  26  // Key is resource managed by IAM Key Service.
  27  // Can be issued for User or Service Account, but key authorization is supported only for Service Accounts.
  28  // Issued key contains private part that is not saved on server side, and should be saved by client.
  29  type Key struct {
  30  	state protoimpl.MessageState `protogen:"open.v1"`
  31  	// ID of the Key resource.
  32  	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
  33  	// Types that are valid to be assigned to Subject:
  34  	//
  35  	//	*Key_UserAccountId
  36  	//	*Key_ServiceAccountId
  37  	Subject isKey_Subject `protobuf_oneof:"subject"`
  38  	// Creation timestamp in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  39  	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
  40  	// Description of the Key resource. 0-256 characters long.
  41  	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
  42  	// An algorithm used to generate a key pair of the Key resource.
  43  	KeyAlgorithm v1.Key_Algorithm `protobuf:"varint,6,opt,name=key_algorithm,json=keyAlgorithm,proto3,enum=yandex.cloud.iam.v1.Key_Algorithm" json:"key_algorithm,omitempty"`
  44  	// A public key of the Key resource.
  45  	PublicKey string `protobuf:"bytes,7,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
  46  	// A public key of the Key resource.
  47  	PrivateKey    string `protobuf:"bytes,8,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
  48  	unknownFields protoimpl.UnknownFields
  49  	sizeCache     protoimpl.SizeCache
  50  }
  51  
  52  func (x *Key) Reset() {
  53  	*x = Key{}
  54  	mi := &file_iamkey_proto_msgTypes[0]
  55  	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  56  	ms.StoreMessageInfo(mi)
  57  }
  58  
  59  func (x *Key) String() string {
  60  	return protoimpl.X.MessageStringOf(x)
  61  }
  62  
  63  func (*Key) ProtoMessage() {}
  64  
  65  func (x *Key) ProtoReflect() protoreflect.Message {
  66  	mi := &file_iamkey_proto_msgTypes[0]
  67  	if x != nil {
  68  		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  69  		if ms.LoadMessageInfo() == nil {
  70  			ms.StoreMessageInfo(mi)
  71  		}
  72  		return ms
  73  	}
  74  	return mi.MessageOf(x)
  75  }
  76  
  77  // Deprecated: Use Key.ProtoReflect.Descriptor instead.
  78  func (*Key) Descriptor() ([]byte, []int) {
  79  	return file_iamkey_proto_rawDescGZIP(), []int{0}
  80  }
  81  
  82  func (x *Key) GetId() string {
  83  	if x != nil {
  84  		return x.Id
  85  	}
  86  	return ""
  87  }
  88  
  89  func (x *Key) GetSubject() isKey_Subject {
  90  	if x != nil {
  91  		return x.Subject
  92  	}
  93  	return nil
  94  }
  95  
  96  func (x *Key) GetUserAccountId() string {
  97  	if x != nil {
  98  		if x, ok := x.Subject.(*Key_UserAccountId); ok {
  99  			return x.UserAccountId
 100  		}
 101  	}
 102  	return ""
 103  }
 104  
 105  func (x *Key) GetServiceAccountId() string {
 106  	if x != nil {
 107  		if x, ok := x.Subject.(*Key_ServiceAccountId); ok {
 108  			return x.ServiceAccountId
 109  		}
 110  	}
 111  	return ""
 112  }
 113  
 114  func (x *Key) GetCreatedAt() *timestamppb.Timestamp {
 115  	if x != nil {
 116  		return x.CreatedAt
 117  	}
 118  	return nil
 119  }
 120  
 121  func (x *Key) GetDescription() string {
 122  	if x != nil {
 123  		return x.Description
 124  	}
 125  	return ""
 126  }
 127  
 128  func (x *Key) GetKeyAlgorithm() v1.Key_Algorithm {
 129  	if x != nil {
 130  		return x.KeyAlgorithm
 131  	}
 132  	return v1.Key_Algorithm(0)
 133  }
 134  
 135  func (x *Key) GetPublicKey() string {
 136  	if x != nil {
 137  		return x.PublicKey
 138  	}
 139  	return ""
 140  }
 141  
 142  func (x *Key) GetPrivateKey() string {
 143  	if x != nil {
 144  		return x.PrivateKey
 145  	}
 146  	return ""
 147  }
 148  
 149  type isKey_Subject interface {
 150  	isKey_Subject()
 151  }
 152  
 153  type Key_UserAccountId struct {
 154  	// ID of the user account that the Key resource belongs to.
 155  	UserAccountId string `protobuf:"bytes,2,opt,name=user_account_id,json=userAccountId,proto3,oneof"`
 156  }
 157  
 158  type Key_ServiceAccountId struct {
 159  	// ID of the service account that the Key resource belongs to.
 160  	ServiceAccountId string `protobuf:"bytes,3,opt,name=service_account_id,json=serviceAccountId,proto3,oneof"`
 161  }
 162  
 163  func (*Key_UserAccountId) isKey_Subject() {}
 164  
 165  func (*Key_ServiceAccountId) isKey_Subject() {}
 166  
 167  var File_iamkey_proto protoreflect.FileDescriptor
 168  
 169  const file_iamkey_proto_rawDesc = "" +
 170  	"\n" +
 171  	"\fiamkey.proto\x12\x13yandex.cloud.sdk.v2\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1dyandex/cloud/iam/v1/key.proto\"\xe0\x02\n" +
 172  	"\x03Key\x12\x0e\n" +
 173  	"\x02id\x18\x01 \x01(\tR\x02id\x12(\n" +
 174  	"\x0fuser_account_id\x18\x02 \x01(\tH\x00R\ruserAccountId\x12.\n" +
 175  	"\x12service_account_id\x18\x03 \x01(\tH\x00R\x10serviceAccountId\x129\n" +
 176  	"\n" +
 177  	"created_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12 \n" +
 178  	"\vdescription\x18\x05 \x01(\tR\vdescription\x12G\n" +
 179  	"\rkey_algorithm\x18\x06 \x01(\x0e2\".yandex.cloud.iam.v1.Key.AlgorithmR\fkeyAlgorithm\x12\x1d\n" +
 180  	"\n" +
 181  	"public_key\x18\a \x01(\tR\tpublicKey\x12\x1f\n" +
 182  	"\vprivate_key\x18\b \x01(\tR\n" +
 183  	"privateKeyB\t\n" +
 184  	"\asubjectB\x0fZ\rsdk/v2/iamkeyb\x06proto3"
 185  
 186  var (
 187  	file_iamkey_proto_rawDescOnce sync.Once
 188  	file_iamkey_proto_rawDescData []byte
 189  )
 190  
 191  func file_iamkey_proto_rawDescGZIP() []byte {
 192  	file_iamkey_proto_rawDescOnce.Do(func() {
 193  		file_iamkey_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_iamkey_proto_rawDesc), len(file_iamkey_proto_rawDesc)))
 194  	})
 195  	return file_iamkey_proto_rawDescData
 196  }
 197  
 198  var file_iamkey_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
 199  var file_iamkey_proto_goTypes = []any{
 200  	(*Key)(nil),                   // 0: yandex.cloud.sdk.v2.Key
 201  	(*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp
 202  	(v1.Key_Algorithm)(0),         // 2: yandex.cloud.iam.v1.Key.Algorithm
 203  }
 204  var file_iamkey_proto_depIdxs = []int32{
 205  	1, // 0: yandex.cloud.sdk.v2.Key.created_at:type_name -> google.protobuf.Timestamp
 206  	2, // 1: yandex.cloud.sdk.v2.Key.key_algorithm:type_name -> yandex.cloud.iam.v1.Key.Algorithm
 207  	2, // [2:2] is the sub-list for method output_type
 208  	2, // [2:2] is the sub-list for method input_type
 209  	2, // [2:2] is the sub-list for extension type_name
 210  	2, // [2:2] is the sub-list for extension extendee
 211  	0, // [0:2] is the sub-list for field type_name
 212  }
 213  
 214  func init() { file_iamkey_proto_init() }
 215  func file_iamkey_proto_init() {
 216  	if File_iamkey_proto != nil {
 217  		return
 218  	}
 219  	file_iamkey_proto_msgTypes[0].OneofWrappers = []any{
 220  		(*Key_UserAccountId)(nil),
 221  		(*Key_ServiceAccountId)(nil),
 222  	}
 223  	type x struct{}
 224  	out := protoimpl.TypeBuilder{
 225  		File: protoimpl.DescBuilder{
 226  			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 227  			RawDescriptor: unsafe.Slice(unsafe.StringData(file_iamkey_proto_rawDesc), len(file_iamkey_proto_rawDesc)),
 228  			NumEnums:      0,
 229  			NumMessages:   1,
 230  			NumExtensions: 0,
 231  			NumServices:   0,
 232  		},
 233  		GoTypes:           file_iamkey_proto_goTypes,
 234  		DependencyIndexes: file_iamkey_proto_depIdxs,
 235  		MessageInfos:      file_iamkey_proto_msgTypes,
 236  	}.Build()
 237  	File_iamkey_proto = out.File
 238  	file_iamkey_proto_goTypes = nil
 239  	file_iamkey_proto_depIdxs = nil
 240  }
 241