From 33b9737d6d78cad8527dea7c802daaa4c5785560 Mon Sep 17 00:00:00 2001 From: Nick Zelei <2420177+nickzelei@users.noreply.github.com> Date: Fri, 10 Nov 2023 14:25:01 -0500 Subject: [PATCH] [migration] adds crud protos for account api keys (#563) --- .../gen/go/protos/mgmt/v1alpha1/api_key.pb.go | 948 +++++++++++ .../mgmt/v1alpha1/api_key.pb.validate.go | 1394 +++++++++++++++++ .../mgmtv1alpha1connect/api_key.connect.go | 213 +++ backend/protos/mgmt/v1alpha1/api_key.proto | 65 + ...1350_account-api-key-value-unique.down.sql | 7 + ...191350_account-api-key-value-unique.up.sql | 5 + .../mgmt/v1alpha1/api_key_connect.ts | 62 + .../mgmt/v1alpha1/api_key_pb.ts | 467 ++++++ 8 files changed, 3161 insertions(+) create mode 100644 backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.go create mode 100644 backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.validate.go create mode 100644 backend/gen/go/protos/mgmt/v1alpha1/mgmtv1alpha1connect/api_key.connect.go create mode 100644 backend/protos/mgmt/v1alpha1/api_key.proto create mode 100644 backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.down.sql create mode 100644 backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.up.sql create mode 100644 frontend/neosync-api-client/mgmt/v1alpha1/api_key_connect.ts create mode 100644 frontend/neosync-api-client/mgmt/v1alpha1/api_key_pb.ts diff --git a/backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.go b/backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.go new file mode 100644 index 0000000000..7c98d76f54 --- /dev/null +++ b/backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.go @@ -0,0 +1,948 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: mgmt/v1alpha1/api_key.proto + +package mgmtv1alpha1 + +import ( + _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" + 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" +) + +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 CreateAccountApiKeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // Validate between now and one year: now < x < 1year + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` +} + +func (x *CreateAccountApiKeyRequest) Reset() { + *x = CreateAccountApiKeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAccountApiKeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccountApiKeyRequest) ProtoMessage() {} + +func (x *CreateAccountApiKeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAccountApiKeyRequest.ProtoReflect.Descriptor instead. +func (*CreateAccountApiKeyRequest) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateAccountApiKeyRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +func (x *CreateAccountApiKeyRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateAccountApiKeyRequest) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +type CreateAccountApiKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiKey *AccountApiKey `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` +} + +func (x *CreateAccountApiKeyResponse) Reset() { + *x = CreateAccountApiKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAccountApiKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccountApiKeyResponse) ProtoMessage() {} + +func (x *CreateAccountApiKeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAccountApiKeyResponse.ProtoReflect.Descriptor instead. +func (*CreateAccountApiKeyResponse) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateAccountApiKeyResponse) GetApiKey() *AccountApiKey { + if x != nil { + return x.ApiKey + } + return nil +} + +type AccountApiKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + AccountId string `protobuf:"bytes,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + CreatedById string `protobuf:"bytes,4,opt,name=created_by_id,json=createdById,proto3" json:"created_by_id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedById string `protobuf:"bytes,6,opt,name=updated_by_id,json=updatedById,proto3" json:"updated_by_id,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + // key_value is only returned on initial creation or when it is regenerated + KeyValue *string `protobuf:"bytes,8,opt,name=key_value,json=keyValue,proto3,oneof" json:"key_value,omitempty"` +} + +func (x *AccountApiKey) Reset() { + *x = AccountApiKey{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountApiKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountApiKey) ProtoMessage() {} + +func (x *AccountApiKey) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountApiKey.ProtoReflect.Descriptor instead. +func (*AccountApiKey) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{2} +} + +func (x *AccountApiKey) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AccountApiKey) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AccountApiKey) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +func (x *AccountApiKey) GetCreatedById() string { + if x != nil { + return x.CreatedById + } + return "" +} + +func (x *AccountApiKey) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *AccountApiKey) GetUpdatedById() string { + if x != nil { + return x.UpdatedById + } + return "" +} + +func (x *AccountApiKey) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *AccountApiKey) GetKeyValue() string { + if x != nil && x.KeyValue != nil { + return *x.KeyValue + } + return "" +} + +type GetAccountApiKeysRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccountId string `protobuf:"bytes,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` +} + +func (x *GetAccountApiKeysRequest) Reset() { + *x = GetAccountApiKeysRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAccountApiKeysRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountApiKeysRequest) ProtoMessage() {} + +func (x *GetAccountApiKeysRequest) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountApiKeysRequest.ProtoReflect.Descriptor instead. +func (*GetAccountApiKeysRequest) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{3} +} + +func (x *GetAccountApiKeysRequest) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +type GetAccountApiKeysResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiKeys []*AccountApiKey `protobuf:"bytes,1,rep,name=api_keys,json=apiKeys,proto3" json:"api_keys,omitempty"` +} + +func (x *GetAccountApiKeysResponse) Reset() { + *x = GetAccountApiKeysResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAccountApiKeysResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountApiKeysResponse) ProtoMessage() {} + +func (x *GetAccountApiKeysResponse) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountApiKeysResponse.ProtoReflect.Descriptor instead. +func (*GetAccountApiKeysResponse) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{4} +} + +func (x *GetAccountApiKeysResponse) GetApiKeys() []*AccountApiKey { + if x != nil { + return x.ApiKeys + } + return nil +} + +type GetAccountApiKeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetAccountApiKeyRequest) Reset() { + *x = GetAccountApiKeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAccountApiKeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountApiKeyRequest) ProtoMessage() {} + +func (x *GetAccountApiKeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountApiKeyRequest.ProtoReflect.Descriptor instead. +func (*GetAccountApiKeyRequest) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{5} +} + +func (x *GetAccountApiKeyRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetAccountApiKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiKey *AccountApiKey `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` +} + +func (x *GetAccountApiKeyResponse) Reset() { + *x = GetAccountApiKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAccountApiKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAccountApiKeyResponse) ProtoMessage() {} + +func (x *GetAccountApiKeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAccountApiKeyResponse.ProtoReflect.Descriptor instead. +func (*GetAccountApiKeyResponse) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{6} +} + +func (x *GetAccountApiKeyResponse) GetApiKey() *AccountApiKey { + if x != nil { + return x.ApiKey + } + return nil +} + +type RegenerateAccountApiKeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *RegenerateAccountApiKeyRequest) Reset() { + *x = RegenerateAccountApiKeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegenerateAccountApiKeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegenerateAccountApiKeyRequest) ProtoMessage() {} + +func (x *RegenerateAccountApiKeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegenerateAccountApiKeyRequest.ProtoReflect.Descriptor instead. +func (*RegenerateAccountApiKeyRequest) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{7} +} + +func (x *RegenerateAccountApiKeyRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type RegenerateAccountApiKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApiKey *AccountApiKey `protobuf:"bytes,1,opt,name=api_key,json=apiKey,proto3" json:"api_key,omitempty"` +} + +func (x *RegenerateAccountApiKeyResponse) Reset() { + *x = RegenerateAccountApiKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegenerateAccountApiKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegenerateAccountApiKeyResponse) ProtoMessage() {} + +func (x *RegenerateAccountApiKeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegenerateAccountApiKeyResponse.ProtoReflect.Descriptor instead. +func (*RegenerateAccountApiKeyResponse) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{8} +} + +func (x *RegenerateAccountApiKeyResponse) GetApiKey() *AccountApiKey { + if x != nil { + return x.ApiKey + } + return nil +} + +type DeleteAccountApiKeyRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *DeleteAccountApiKeyRequest) Reset() { + *x = DeleteAccountApiKeyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAccountApiKeyRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAccountApiKeyRequest) ProtoMessage() {} + +func (x *DeleteAccountApiKeyRequest) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAccountApiKeyRequest.ProtoReflect.Descriptor instead. +func (*DeleteAccountApiKeyRequest) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteAccountApiKeyRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type DeleteAccountApiKeyResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteAccountApiKeyResponse) Reset() { + *x = DeleteAccountApiKeyResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAccountApiKeyResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAccountApiKeyResponse) ProtoMessage() {} + +func (x *DeleteAccountApiKeyResponse) ProtoReflect() protoreflect.Message { + mi := &file_mgmt_v1alpha1_api_key_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteAccountApiKeyResponse.ProtoReflect.Descriptor instead. +func (*DeleteAccountApiKeyResponse) Descriptor() ([]byte, []int) { + return file_mgmt_v1alpha1_api_key_proto_rawDescGZIP(), []int{10} +} + +var File_mgmt_v1alpha1_api_key_proto protoreflect.FileDescriptor + +var file_mgmt_v1alpha1_api_key_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, + 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6d, + 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1b, 0x62, 0x75, + 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x01, 0x0a, 0x1a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, + 0x48, 0x05, 0x72, 0x03, 0xb0, 0x01, 0x01, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x4a, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, + 0x0f, 0xba, 0x48, 0x0c, 0xb2, 0x01, 0x09, 0x4a, 0x05, 0x08, 0x80, 0xe7, 0x84, 0x0f, 0x40, 0x01, + 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0x54, 0x0a, 0x1b, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x61, 0x70, + 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, + 0x79, 0x22, 0xc0, 0x02, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, + 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x43, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x27, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0x48, 0x05, 0x72, 0x03, 0xb0, 0x01, 0x01, 0x52, 0x09, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x19, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, + 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x07, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x22, + 0x33, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, + 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0x48, 0x05, 0x72, 0x03, 0xb0, 0x01, 0x01, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x35, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, + 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x22, 0x3a, 0x0a, 0x1e, 0x52, 0x65, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0x48, 0x05, 0x72, 0x03, 0xb0, 0x01, 0x01, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x58, 0x0a, 0x1f, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x07, 0x61, 0x70, 0x69, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x22, 0x36, 0x0a, + 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, + 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0x48, 0x05, 0x72, 0x03, 0xb0, 0x01, + 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbc, 0x04, 0x0a, 0x0d, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x27, 0x2e, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x70, 0x69, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x65, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, + 0x69, 0x4b, 0x65, 0x79, 0x12, 0x26, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, + 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, + 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x12, 0x29, + 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, + 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, 0x67, 0x6d, 0x74, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x17, 0x52, 0x65, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, + 0x65, 0x79, 0x12, 0x2d, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x2e, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x52, 0x65, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x12, 0x29, 0x2e, 0x6d, 0x67, 0x6d, + 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x42, 0xc7, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x67, 0x6d, 0x74, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x41, 0x70, 0x69, 0x4b, 0x65, + 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x75, 0x63, 0x6c, 0x65, 0x75, 0x73, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x2f, 0x6e, 0x65, 0x6f, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, + 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, + 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x6d, 0x67, + 0x6d, 0x74, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, + 0xaa, 0x02, 0x0d, 0x4d, 0x67, 0x6d, 0x74, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0xca, 0x02, 0x0d, 0x4d, 0x67, 0x6d, 0x74, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0xe2, 0x02, 0x19, 0x4d, 0x67, 0x6d, 0x74, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, + 0x67, 0x6d, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mgmt_v1alpha1_api_key_proto_rawDescOnce sync.Once + file_mgmt_v1alpha1_api_key_proto_rawDescData = file_mgmt_v1alpha1_api_key_proto_rawDesc +) + +func file_mgmt_v1alpha1_api_key_proto_rawDescGZIP() []byte { + file_mgmt_v1alpha1_api_key_proto_rawDescOnce.Do(func() { + file_mgmt_v1alpha1_api_key_proto_rawDescData = protoimpl.X.CompressGZIP(file_mgmt_v1alpha1_api_key_proto_rawDescData) + }) + return file_mgmt_v1alpha1_api_key_proto_rawDescData +} + +var file_mgmt_v1alpha1_api_key_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_mgmt_v1alpha1_api_key_proto_goTypes = []interface{}{ + (*CreateAccountApiKeyRequest)(nil), // 0: mgmt.v1alpha1.CreateAccountApiKeyRequest + (*CreateAccountApiKeyResponse)(nil), // 1: mgmt.v1alpha1.CreateAccountApiKeyResponse + (*AccountApiKey)(nil), // 2: mgmt.v1alpha1.AccountApiKey + (*GetAccountApiKeysRequest)(nil), // 3: mgmt.v1alpha1.GetAccountApiKeysRequest + (*GetAccountApiKeysResponse)(nil), // 4: mgmt.v1alpha1.GetAccountApiKeysResponse + (*GetAccountApiKeyRequest)(nil), // 5: mgmt.v1alpha1.GetAccountApiKeyRequest + (*GetAccountApiKeyResponse)(nil), // 6: mgmt.v1alpha1.GetAccountApiKeyResponse + (*RegenerateAccountApiKeyRequest)(nil), // 7: mgmt.v1alpha1.RegenerateAccountApiKeyRequest + (*RegenerateAccountApiKeyResponse)(nil), // 8: mgmt.v1alpha1.RegenerateAccountApiKeyResponse + (*DeleteAccountApiKeyRequest)(nil), // 9: mgmt.v1alpha1.DeleteAccountApiKeyRequest + (*DeleteAccountApiKeyResponse)(nil), // 10: mgmt.v1alpha1.DeleteAccountApiKeyResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp +} +var file_mgmt_v1alpha1_api_key_proto_depIdxs = []int32{ + 11, // 0: mgmt.v1alpha1.CreateAccountApiKeyRequest.expires_at:type_name -> google.protobuf.Timestamp + 2, // 1: mgmt.v1alpha1.CreateAccountApiKeyResponse.api_key:type_name -> mgmt.v1alpha1.AccountApiKey + 11, // 2: mgmt.v1alpha1.AccountApiKey.created_at:type_name -> google.protobuf.Timestamp + 11, // 3: mgmt.v1alpha1.AccountApiKey.updated_at:type_name -> google.protobuf.Timestamp + 2, // 4: mgmt.v1alpha1.GetAccountApiKeysResponse.api_keys:type_name -> mgmt.v1alpha1.AccountApiKey + 2, // 5: mgmt.v1alpha1.GetAccountApiKeyResponse.api_key:type_name -> mgmt.v1alpha1.AccountApiKey + 2, // 6: mgmt.v1alpha1.RegenerateAccountApiKeyResponse.api_key:type_name -> mgmt.v1alpha1.AccountApiKey + 3, // 7: mgmt.v1alpha1.ApiKeyService.GetAccountApiKeys:input_type -> mgmt.v1alpha1.GetAccountApiKeysRequest + 5, // 8: mgmt.v1alpha1.ApiKeyService.GetAccountApiKey:input_type -> mgmt.v1alpha1.GetAccountApiKeyRequest + 0, // 9: mgmt.v1alpha1.ApiKeyService.CreateAccountApiKey:input_type -> mgmt.v1alpha1.CreateAccountApiKeyRequest + 7, // 10: mgmt.v1alpha1.ApiKeyService.RegenerateAccountApiKey:input_type -> mgmt.v1alpha1.RegenerateAccountApiKeyRequest + 9, // 11: mgmt.v1alpha1.ApiKeyService.DeleteAccountApiKey:input_type -> mgmt.v1alpha1.DeleteAccountApiKeyRequest + 4, // 12: mgmt.v1alpha1.ApiKeyService.GetAccountApiKeys:output_type -> mgmt.v1alpha1.GetAccountApiKeysResponse + 6, // 13: mgmt.v1alpha1.ApiKeyService.GetAccountApiKey:output_type -> mgmt.v1alpha1.GetAccountApiKeyResponse + 1, // 14: mgmt.v1alpha1.ApiKeyService.CreateAccountApiKey:output_type -> mgmt.v1alpha1.CreateAccountApiKeyResponse + 8, // 15: mgmt.v1alpha1.ApiKeyService.RegenerateAccountApiKey:output_type -> mgmt.v1alpha1.RegenerateAccountApiKeyResponse + 10, // 16: mgmt.v1alpha1.ApiKeyService.DeleteAccountApiKey:output_type -> mgmt.v1alpha1.DeleteAccountApiKeyResponse + 12, // [12:17] is the sub-list for method output_type + 7, // [7:12] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_mgmt_v1alpha1_api_key_proto_init() } +func file_mgmt_v1alpha1_api_key_proto_init() { + if File_mgmt_v1alpha1_api_key_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mgmt_v1alpha1_api_key_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAccountApiKeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAccountApiKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountApiKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAccountApiKeysRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAccountApiKeysResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAccountApiKeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAccountApiKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegenerateAccountApiKeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegenerateAccountApiKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAccountApiKeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAccountApiKeyResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_mgmt_v1alpha1_api_key_proto_msgTypes[2].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mgmt_v1alpha1_api_key_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_mgmt_v1alpha1_api_key_proto_goTypes, + DependencyIndexes: file_mgmt_v1alpha1_api_key_proto_depIdxs, + MessageInfos: file_mgmt_v1alpha1_api_key_proto_msgTypes, + }.Build() + File_mgmt_v1alpha1_api_key_proto = out.File + file_mgmt_v1alpha1_api_key_proto_rawDesc = nil + file_mgmt_v1alpha1_api_key_proto_goTypes = nil + file_mgmt_v1alpha1_api_key_proto_depIdxs = nil +} diff --git a/backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.validate.go b/backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.validate.go new file mode 100644 index 0000000000..30928e2b41 --- /dev/null +++ b/backend/gen/go/protos/mgmt/v1alpha1/api_key.pb.validate.go @@ -0,0 +1,1394 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: mgmt/v1alpha1/api_key.proto + +package mgmtv1alpha1 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on CreateAccountApiKeyRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *CreateAccountApiKeyRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateAccountApiKeyRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateAccountApiKeyRequestMultiError, or nil if none found. +func (m *CreateAccountApiKeyRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateAccountApiKeyRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for AccountId + + // no validation rules for Name + + if all { + switch v := interface{}(m.GetExpiresAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountApiKeyRequestValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountApiKeyRequestValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetExpiresAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAccountApiKeyRequestValidationError{ + field: "ExpiresAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return CreateAccountApiKeyRequestMultiError(errors) + } + + return nil +} + +// CreateAccountApiKeyRequestMultiError is an error wrapping multiple +// validation errors returned by CreateAccountApiKeyRequest.ValidateAll() if +// the designated constraints aren't met. +type CreateAccountApiKeyRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateAccountApiKeyRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateAccountApiKeyRequestMultiError) AllErrors() []error { return m } + +// CreateAccountApiKeyRequestValidationError is the validation error returned +// by CreateAccountApiKeyRequest.Validate if the designated constraints aren't met. +type CreateAccountApiKeyRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateAccountApiKeyRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateAccountApiKeyRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateAccountApiKeyRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateAccountApiKeyRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateAccountApiKeyRequestValidationError) ErrorName() string { + return "CreateAccountApiKeyRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateAccountApiKeyRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateAccountApiKeyRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateAccountApiKeyRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateAccountApiKeyRequestValidationError{} + +// Validate checks the field values on CreateAccountApiKeyResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *CreateAccountApiKeyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateAccountApiKeyResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// CreateAccountApiKeyResponseMultiError, or nil if none found. +func (m *CreateAccountApiKeyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateAccountApiKeyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetApiKey()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetApiKey()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return CreateAccountApiKeyResponseMultiError(errors) + } + + return nil +} + +// CreateAccountApiKeyResponseMultiError is an error wrapping multiple +// validation errors returned by CreateAccountApiKeyResponse.ValidateAll() if +// the designated constraints aren't met. +type CreateAccountApiKeyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateAccountApiKeyResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m CreateAccountApiKeyResponseMultiError) AllErrors() []error { return m } + +// CreateAccountApiKeyResponseValidationError is the validation error returned +// by CreateAccountApiKeyResponse.Validate if the designated constraints +// aren't met. +type CreateAccountApiKeyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateAccountApiKeyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateAccountApiKeyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateAccountApiKeyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateAccountApiKeyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateAccountApiKeyResponseValidationError) ErrorName() string { + return "CreateAccountApiKeyResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateAccountApiKeyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sCreateAccountApiKeyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateAccountApiKeyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateAccountApiKeyResponseValidationError{} + +// Validate checks the field values on AccountApiKey with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *AccountApiKey) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AccountApiKey with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in AccountApiKeyMultiError, or +// nil if none found. +func (m *AccountApiKey) ValidateAll() error { + return m.validate(true) +} + +func (m *AccountApiKey) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + // no validation rules for Name + + // no validation rules for AccountId + + // no validation rules for CreatedById + + if all { + switch v := interface{}(m.GetCreatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AccountApiKeyValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AccountApiKeyValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccountApiKeyValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for UpdatedById + + if all { + switch v := interface{}(m.GetUpdatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AccountApiKeyValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AccountApiKeyValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AccountApiKeyValidationError{ + field: "UpdatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.KeyValue != nil { + // no validation rules for KeyValue + } + + if len(errors) > 0 { + return AccountApiKeyMultiError(errors) + } + + return nil +} + +// AccountApiKeyMultiError is an error wrapping multiple validation errors +// returned by AccountApiKey.ValidateAll() if the designated constraints +// aren't met. +type AccountApiKeyMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AccountApiKeyMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m AccountApiKeyMultiError) AllErrors() []error { return m } + +// AccountApiKeyValidationError is the validation error returned by +// AccountApiKey.Validate if the designated constraints aren't met. +type AccountApiKeyValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AccountApiKeyValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AccountApiKeyValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AccountApiKeyValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AccountApiKeyValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AccountApiKeyValidationError) ErrorName() string { return "AccountApiKeyValidationError" } + +// Error satisfies the builtin error interface +func (e AccountApiKeyValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAccountApiKey.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AccountApiKeyValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AccountApiKeyValidationError{} + +// Validate checks the field values on GetAccountApiKeysRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAccountApiKeysRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAccountApiKeysRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAccountApiKeysRequestMultiError, or nil if none found. +func (m *GetAccountApiKeysRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAccountApiKeysRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for AccountId + + if len(errors) > 0 { + return GetAccountApiKeysRequestMultiError(errors) + } + + return nil +} + +// GetAccountApiKeysRequestMultiError is an error wrapping multiple validation +// errors returned by GetAccountApiKeysRequest.ValidateAll() if the designated +// constraints aren't met. +type GetAccountApiKeysRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAccountApiKeysRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAccountApiKeysRequestMultiError) AllErrors() []error { return m } + +// GetAccountApiKeysRequestValidationError is the validation error returned by +// GetAccountApiKeysRequest.Validate if the designated constraints aren't met. +type GetAccountApiKeysRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAccountApiKeysRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAccountApiKeysRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAccountApiKeysRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAccountApiKeysRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAccountApiKeysRequestValidationError) ErrorName() string { + return "GetAccountApiKeysRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAccountApiKeysRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAccountApiKeysRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAccountApiKeysRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAccountApiKeysRequestValidationError{} + +// Validate checks the field values on GetAccountApiKeysResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAccountApiKeysResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAccountApiKeysResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAccountApiKeysResponseMultiError, or nil if none found. +func (m *GetAccountApiKeysResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAccountApiKeysResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + for idx, item := range m.GetApiKeys() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetAccountApiKeysResponseValidationError{ + field: fmt.Sprintf("ApiKeys[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetAccountApiKeysResponseValidationError{ + field: fmt.Sprintf("ApiKeys[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetAccountApiKeysResponseValidationError{ + field: fmt.Sprintf("ApiKeys[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return GetAccountApiKeysResponseMultiError(errors) + } + + return nil +} + +// GetAccountApiKeysResponseMultiError is an error wrapping multiple validation +// errors returned by GetAccountApiKeysResponse.ValidateAll() if the +// designated constraints aren't met. +type GetAccountApiKeysResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAccountApiKeysResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAccountApiKeysResponseMultiError) AllErrors() []error { return m } + +// GetAccountApiKeysResponseValidationError is the validation error returned by +// GetAccountApiKeysResponse.Validate if the designated constraints aren't met. +type GetAccountApiKeysResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAccountApiKeysResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAccountApiKeysResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAccountApiKeysResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAccountApiKeysResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAccountApiKeysResponseValidationError) ErrorName() string { + return "GetAccountApiKeysResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAccountApiKeysResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAccountApiKeysResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAccountApiKeysResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAccountApiKeysResponseValidationError{} + +// Validate checks the field values on GetAccountApiKeyRequest with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAccountApiKeyRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAccountApiKeyRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAccountApiKeyRequestMultiError, or nil if none found. +func (m *GetAccountApiKeyRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAccountApiKeyRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return GetAccountApiKeyRequestMultiError(errors) + } + + return nil +} + +// GetAccountApiKeyRequestMultiError is an error wrapping multiple validation +// errors returned by GetAccountApiKeyRequest.ValidateAll() if the designated +// constraints aren't met. +type GetAccountApiKeyRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAccountApiKeyRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAccountApiKeyRequestMultiError) AllErrors() []error { return m } + +// GetAccountApiKeyRequestValidationError is the validation error returned by +// GetAccountApiKeyRequest.Validate if the designated constraints aren't met. +type GetAccountApiKeyRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAccountApiKeyRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAccountApiKeyRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAccountApiKeyRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAccountApiKeyRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAccountApiKeyRequestValidationError) ErrorName() string { + return "GetAccountApiKeyRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAccountApiKeyRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAccountApiKeyRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAccountApiKeyRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAccountApiKeyRequestValidationError{} + +// Validate checks the field values on GetAccountApiKeyResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *GetAccountApiKeyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetAccountApiKeyResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// GetAccountApiKeyResponseMultiError, or nil if none found. +func (m *GetAccountApiKeyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetAccountApiKeyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetApiKey()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetApiKey()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GetAccountApiKeyResponseMultiError(errors) + } + + return nil +} + +// GetAccountApiKeyResponseMultiError is an error wrapping multiple validation +// errors returned by GetAccountApiKeyResponse.ValidateAll() if the designated +// constraints aren't met. +type GetAccountApiKeyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetAccountApiKeyResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m GetAccountApiKeyResponseMultiError) AllErrors() []error { return m } + +// GetAccountApiKeyResponseValidationError is the validation error returned by +// GetAccountApiKeyResponse.Validate if the designated constraints aren't met. +type GetAccountApiKeyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetAccountApiKeyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetAccountApiKeyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetAccountApiKeyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetAccountApiKeyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetAccountApiKeyResponseValidationError) ErrorName() string { + return "GetAccountApiKeyResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetAccountApiKeyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sGetAccountApiKeyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetAccountApiKeyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetAccountApiKeyResponseValidationError{} + +// Validate checks the field values on RegenerateAccountApiKeyRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RegenerateAccountApiKeyRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RegenerateAccountApiKeyRequest with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// RegenerateAccountApiKeyRequestMultiError, or nil if none found. +func (m *RegenerateAccountApiKeyRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *RegenerateAccountApiKeyRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return RegenerateAccountApiKeyRequestMultiError(errors) + } + + return nil +} + +// RegenerateAccountApiKeyRequestMultiError is an error wrapping multiple +// validation errors returned by RegenerateAccountApiKeyRequest.ValidateAll() +// if the designated constraints aren't met. +type RegenerateAccountApiKeyRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RegenerateAccountApiKeyRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RegenerateAccountApiKeyRequestMultiError) AllErrors() []error { return m } + +// RegenerateAccountApiKeyRequestValidationError is the validation error +// returned by RegenerateAccountApiKeyRequest.Validate if the designated +// constraints aren't met. +type RegenerateAccountApiKeyRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RegenerateAccountApiKeyRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RegenerateAccountApiKeyRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RegenerateAccountApiKeyRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RegenerateAccountApiKeyRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RegenerateAccountApiKeyRequestValidationError) ErrorName() string { + return "RegenerateAccountApiKeyRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e RegenerateAccountApiKeyRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegenerateAccountApiKeyRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RegenerateAccountApiKeyRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RegenerateAccountApiKeyRequestValidationError{} + +// Validate checks the field values on RegenerateAccountApiKeyResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *RegenerateAccountApiKeyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on RegenerateAccountApiKeyResponse with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// RegenerateAccountApiKeyResponseMultiError, or nil if none found. +func (m *RegenerateAccountApiKeyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *RegenerateAccountApiKeyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetApiKey()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, RegenerateAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, RegenerateAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetApiKey()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return RegenerateAccountApiKeyResponseValidationError{ + field: "ApiKey", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return RegenerateAccountApiKeyResponseMultiError(errors) + } + + return nil +} + +// RegenerateAccountApiKeyResponseMultiError is an error wrapping multiple +// validation errors returned by RegenerateAccountApiKeyResponse.ValidateAll() +// if the designated constraints aren't met. +type RegenerateAccountApiKeyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m RegenerateAccountApiKeyResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m RegenerateAccountApiKeyResponseMultiError) AllErrors() []error { return m } + +// RegenerateAccountApiKeyResponseValidationError is the validation error +// returned by RegenerateAccountApiKeyResponse.Validate if the designated +// constraints aren't met. +type RegenerateAccountApiKeyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e RegenerateAccountApiKeyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e RegenerateAccountApiKeyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e RegenerateAccountApiKeyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e RegenerateAccountApiKeyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e RegenerateAccountApiKeyResponseValidationError) ErrorName() string { + return "RegenerateAccountApiKeyResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e RegenerateAccountApiKeyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sRegenerateAccountApiKeyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = RegenerateAccountApiKeyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = RegenerateAccountApiKeyResponseValidationError{} + +// Validate checks the field values on DeleteAccountApiKeyRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteAccountApiKeyRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteAccountApiKeyRequest with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteAccountApiKeyRequestMultiError, or nil if none found. +func (m *DeleteAccountApiKeyRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteAccountApiKeyRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Id + + if len(errors) > 0 { + return DeleteAccountApiKeyRequestMultiError(errors) + } + + return nil +} + +// DeleteAccountApiKeyRequestMultiError is an error wrapping multiple +// validation errors returned by DeleteAccountApiKeyRequest.ValidateAll() if +// the designated constraints aren't met. +type DeleteAccountApiKeyRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteAccountApiKeyRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteAccountApiKeyRequestMultiError) AllErrors() []error { return m } + +// DeleteAccountApiKeyRequestValidationError is the validation error returned +// by DeleteAccountApiKeyRequest.Validate if the designated constraints aren't met. +type DeleteAccountApiKeyRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteAccountApiKeyRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteAccountApiKeyRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteAccountApiKeyRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteAccountApiKeyRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteAccountApiKeyRequestValidationError) ErrorName() string { + return "DeleteAccountApiKeyRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteAccountApiKeyRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteAccountApiKeyRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteAccountApiKeyRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteAccountApiKeyRequestValidationError{} + +// Validate checks the field values on DeleteAccountApiKeyResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *DeleteAccountApiKeyResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteAccountApiKeyResponse with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// DeleteAccountApiKeyResponseMultiError, or nil if none found. +func (m *DeleteAccountApiKeyResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteAccountApiKeyResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if len(errors) > 0 { + return DeleteAccountApiKeyResponseMultiError(errors) + } + + return nil +} + +// DeleteAccountApiKeyResponseMultiError is an error wrapping multiple +// validation errors returned by DeleteAccountApiKeyResponse.ValidateAll() if +// the designated constraints aren't met. +type DeleteAccountApiKeyResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteAccountApiKeyResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m DeleteAccountApiKeyResponseMultiError) AllErrors() []error { return m } + +// DeleteAccountApiKeyResponseValidationError is the validation error returned +// by DeleteAccountApiKeyResponse.Validate if the designated constraints +// aren't met. +type DeleteAccountApiKeyResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteAccountApiKeyResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteAccountApiKeyResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteAccountApiKeyResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteAccountApiKeyResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteAccountApiKeyResponseValidationError) ErrorName() string { + return "DeleteAccountApiKeyResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteAccountApiKeyResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sDeleteAccountApiKeyResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteAccountApiKeyResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteAccountApiKeyResponseValidationError{} diff --git a/backend/gen/go/protos/mgmt/v1alpha1/mgmtv1alpha1connect/api_key.connect.go b/backend/gen/go/protos/mgmt/v1alpha1/mgmtv1alpha1connect/api_key.connect.go new file mode 100644 index 0000000000..6f48565de9 --- /dev/null +++ b/backend/gen/go/protos/mgmt/v1alpha1/mgmtv1alpha1connect/api_key.connect.go @@ -0,0 +1,213 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: mgmt/v1alpha1/api_key.proto + +package mgmtv1alpha1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion0_1_0 + +const ( + // ApiKeyServiceName is the fully-qualified name of the ApiKeyService service. + ApiKeyServiceName = "mgmt.v1alpha1.ApiKeyService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // ApiKeyServiceGetAccountApiKeysProcedure is the fully-qualified name of the ApiKeyService's + // GetAccountApiKeys RPC. + ApiKeyServiceGetAccountApiKeysProcedure = "/mgmt.v1alpha1.ApiKeyService/GetAccountApiKeys" + // ApiKeyServiceGetAccountApiKeyProcedure is the fully-qualified name of the ApiKeyService's + // GetAccountApiKey RPC. + ApiKeyServiceGetAccountApiKeyProcedure = "/mgmt.v1alpha1.ApiKeyService/GetAccountApiKey" + // ApiKeyServiceCreateAccountApiKeyProcedure is the fully-qualified name of the ApiKeyService's + // CreateAccountApiKey RPC. + ApiKeyServiceCreateAccountApiKeyProcedure = "/mgmt.v1alpha1.ApiKeyService/CreateAccountApiKey" + // ApiKeyServiceRegenerateAccountApiKeyProcedure is the fully-qualified name of the ApiKeyService's + // RegenerateAccountApiKey RPC. + ApiKeyServiceRegenerateAccountApiKeyProcedure = "/mgmt.v1alpha1.ApiKeyService/RegenerateAccountApiKey" + // ApiKeyServiceDeleteAccountApiKeyProcedure is the fully-qualified name of the ApiKeyService's + // DeleteAccountApiKey RPC. + ApiKeyServiceDeleteAccountApiKeyProcedure = "/mgmt.v1alpha1.ApiKeyService/DeleteAccountApiKey" +) + +// ApiKeyServiceClient is a client for the mgmt.v1alpha1.ApiKeyService service. +type ApiKeyServiceClient interface { + GetAccountApiKeys(context.Context, *connect.Request[v1alpha1.GetAccountApiKeysRequest]) (*connect.Response[v1alpha1.GetAccountApiKeysResponse], error) + GetAccountApiKey(context.Context, *connect.Request[v1alpha1.GetAccountApiKeyRequest]) (*connect.Response[v1alpha1.GetAccountApiKeyResponse], error) + CreateAccountApiKey(context.Context, *connect.Request[v1alpha1.CreateAccountApiKeyRequest]) (*connect.Response[v1alpha1.CreateAccountApiKeyResponse], error) + RegenerateAccountApiKey(context.Context, *connect.Request[v1alpha1.RegenerateAccountApiKeyRequest]) (*connect.Response[v1alpha1.RegenerateAccountApiKeyResponse], error) + DeleteAccountApiKey(context.Context, *connect.Request[v1alpha1.DeleteAccountApiKeyRequest]) (*connect.Response[v1alpha1.DeleteAccountApiKeyResponse], error) +} + +// NewApiKeyServiceClient constructs a client for the mgmt.v1alpha1.ApiKeyService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewApiKeyServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ApiKeyServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &apiKeyServiceClient{ + getAccountApiKeys: connect.NewClient[v1alpha1.GetAccountApiKeysRequest, v1alpha1.GetAccountApiKeysResponse]( + httpClient, + baseURL+ApiKeyServiceGetAccountApiKeysProcedure, + opts..., + ), + getAccountApiKey: connect.NewClient[v1alpha1.GetAccountApiKeyRequest, v1alpha1.GetAccountApiKeyResponse]( + httpClient, + baseURL+ApiKeyServiceGetAccountApiKeyProcedure, + opts..., + ), + createAccountApiKey: connect.NewClient[v1alpha1.CreateAccountApiKeyRequest, v1alpha1.CreateAccountApiKeyResponse]( + httpClient, + baseURL+ApiKeyServiceCreateAccountApiKeyProcedure, + opts..., + ), + regenerateAccountApiKey: connect.NewClient[v1alpha1.RegenerateAccountApiKeyRequest, v1alpha1.RegenerateAccountApiKeyResponse]( + httpClient, + baseURL+ApiKeyServiceRegenerateAccountApiKeyProcedure, + opts..., + ), + deleteAccountApiKey: connect.NewClient[v1alpha1.DeleteAccountApiKeyRequest, v1alpha1.DeleteAccountApiKeyResponse]( + httpClient, + baseURL+ApiKeyServiceDeleteAccountApiKeyProcedure, + opts..., + ), + } +} + +// apiKeyServiceClient implements ApiKeyServiceClient. +type apiKeyServiceClient struct { + getAccountApiKeys *connect.Client[v1alpha1.GetAccountApiKeysRequest, v1alpha1.GetAccountApiKeysResponse] + getAccountApiKey *connect.Client[v1alpha1.GetAccountApiKeyRequest, v1alpha1.GetAccountApiKeyResponse] + createAccountApiKey *connect.Client[v1alpha1.CreateAccountApiKeyRequest, v1alpha1.CreateAccountApiKeyResponse] + regenerateAccountApiKey *connect.Client[v1alpha1.RegenerateAccountApiKeyRequest, v1alpha1.RegenerateAccountApiKeyResponse] + deleteAccountApiKey *connect.Client[v1alpha1.DeleteAccountApiKeyRequest, v1alpha1.DeleteAccountApiKeyResponse] +} + +// GetAccountApiKeys calls mgmt.v1alpha1.ApiKeyService.GetAccountApiKeys. +func (c *apiKeyServiceClient) GetAccountApiKeys(ctx context.Context, req *connect.Request[v1alpha1.GetAccountApiKeysRequest]) (*connect.Response[v1alpha1.GetAccountApiKeysResponse], error) { + return c.getAccountApiKeys.CallUnary(ctx, req) +} + +// GetAccountApiKey calls mgmt.v1alpha1.ApiKeyService.GetAccountApiKey. +func (c *apiKeyServiceClient) GetAccountApiKey(ctx context.Context, req *connect.Request[v1alpha1.GetAccountApiKeyRequest]) (*connect.Response[v1alpha1.GetAccountApiKeyResponse], error) { + return c.getAccountApiKey.CallUnary(ctx, req) +} + +// CreateAccountApiKey calls mgmt.v1alpha1.ApiKeyService.CreateAccountApiKey. +func (c *apiKeyServiceClient) CreateAccountApiKey(ctx context.Context, req *connect.Request[v1alpha1.CreateAccountApiKeyRequest]) (*connect.Response[v1alpha1.CreateAccountApiKeyResponse], error) { + return c.createAccountApiKey.CallUnary(ctx, req) +} + +// RegenerateAccountApiKey calls mgmt.v1alpha1.ApiKeyService.RegenerateAccountApiKey. +func (c *apiKeyServiceClient) RegenerateAccountApiKey(ctx context.Context, req *connect.Request[v1alpha1.RegenerateAccountApiKeyRequest]) (*connect.Response[v1alpha1.RegenerateAccountApiKeyResponse], error) { + return c.regenerateAccountApiKey.CallUnary(ctx, req) +} + +// DeleteAccountApiKey calls mgmt.v1alpha1.ApiKeyService.DeleteAccountApiKey. +func (c *apiKeyServiceClient) DeleteAccountApiKey(ctx context.Context, req *connect.Request[v1alpha1.DeleteAccountApiKeyRequest]) (*connect.Response[v1alpha1.DeleteAccountApiKeyResponse], error) { + return c.deleteAccountApiKey.CallUnary(ctx, req) +} + +// ApiKeyServiceHandler is an implementation of the mgmt.v1alpha1.ApiKeyService service. +type ApiKeyServiceHandler interface { + GetAccountApiKeys(context.Context, *connect.Request[v1alpha1.GetAccountApiKeysRequest]) (*connect.Response[v1alpha1.GetAccountApiKeysResponse], error) + GetAccountApiKey(context.Context, *connect.Request[v1alpha1.GetAccountApiKeyRequest]) (*connect.Response[v1alpha1.GetAccountApiKeyResponse], error) + CreateAccountApiKey(context.Context, *connect.Request[v1alpha1.CreateAccountApiKeyRequest]) (*connect.Response[v1alpha1.CreateAccountApiKeyResponse], error) + RegenerateAccountApiKey(context.Context, *connect.Request[v1alpha1.RegenerateAccountApiKeyRequest]) (*connect.Response[v1alpha1.RegenerateAccountApiKeyResponse], error) + DeleteAccountApiKey(context.Context, *connect.Request[v1alpha1.DeleteAccountApiKeyRequest]) (*connect.Response[v1alpha1.DeleteAccountApiKeyResponse], error) +} + +// NewApiKeyServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewApiKeyServiceHandler(svc ApiKeyServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + apiKeyServiceGetAccountApiKeysHandler := connect.NewUnaryHandler( + ApiKeyServiceGetAccountApiKeysProcedure, + svc.GetAccountApiKeys, + opts..., + ) + apiKeyServiceGetAccountApiKeyHandler := connect.NewUnaryHandler( + ApiKeyServiceGetAccountApiKeyProcedure, + svc.GetAccountApiKey, + opts..., + ) + apiKeyServiceCreateAccountApiKeyHandler := connect.NewUnaryHandler( + ApiKeyServiceCreateAccountApiKeyProcedure, + svc.CreateAccountApiKey, + opts..., + ) + apiKeyServiceRegenerateAccountApiKeyHandler := connect.NewUnaryHandler( + ApiKeyServiceRegenerateAccountApiKeyProcedure, + svc.RegenerateAccountApiKey, + opts..., + ) + apiKeyServiceDeleteAccountApiKeyHandler := connect.NewUnaryHandler( + ApiKeyServiceDeleteAccountApiKeyProcedure, + svc.DeleteAccountApiKey, + opts..., + ) + return "/mgmt.v1alpha1.ApiKeyService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ApiKeyServiceGetAccountApiKeysProcedure: + apiKeyServiceGetAccountApiKeysHandler.ServeHTTP(w, r) + case ApiKeyServiceGetAccountApiKeyProcedure: + apiKeyServiceGetAccountApiKeyHandler.ServeHTTP(w, r) + case ApiKeyServiceCreateAccountApiKeyProcedure: + apiKeyServiceCreateAccountApiKeyHandler.ServeHTTP(w, r) + case ApiKeyServiceRegenerateAccountApiKeyProcedure: + apiKeyServiceRegenerateAccountApiKeyHandler.ServeHTTP(w, r) + case ApiKeyServiceDeleteAccountApiKeyProcedure: + apiKeyServiceDeleteAccountApiKeyHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedApiKeyServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedApiKeyServiceHandler struct{} + +func (UnimplementedApiKeyServiceHandler) GetAccountApiKeys(context.Context, *connect.Request[v1alpha1.GetAccountApiKeysRequest]) (*connect.Response[v1alpha1.GetAccountApiKeysResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mgmt.v1alpha1.ApiKeyService.GetAccountApiKeys is not implemented")) +} + +func (UnimplementedApiKeyServiceHandler) GetAccountApiKey(context.Context, *connect.Request[v1alpha1.GetAccountApiKeyRequest]) (*connect.Response[v1alpha1.GetAccountApiKeyResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mgmt.v1alpha1.ApiKeyService.GetAccountApiKey is not implemented")) +} + +func (UnimplementedApiKeyServiceHandler) CreateAccountApiKey(context.Context, *connect.Request[v1alpha1.CreateAccountApiKeyRequest]) (*connect.Response[v1alpha1.CreateAccountApiKeyResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mgmt.v1alpha1.ApiKeyService.CreateAccountApiKey is not implemented")) +} + +func (UnimplementedApiKeyServiceHandler) RegenerateAccountApiKey(context.Context, *connect.Request[v1alpha1.RegenerateAccountApiKeyRequest]) (*connect.Response[v1alpha1.RegenerateAccountApiKeyResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mgmt.v1alpha1.ApiKeyService.RegenerateAccountApiKey is not implemented")) +} + +func (UnimplementedApiKeyServiceHandler) DeleteAccountApiKey(context.Context, *connect.Request[v1alpha1.DeleteAccountApiKeyRequest]) (*connect.Response[v1alpha1.DeleteAccountApiKeyResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mgmt.v1alpha1.ApiKeyService.DeleteAccountApiKey is not implemented")) +} diff --git a/backend/protos/mgmt/v1alpha1/api_key.proto b/backend/protos/mgmt/v1alpha1/api_key.proto new file mode 100644 index 0000000000..620754d0a8 --- /dev/null +++ b/backend/protos/mgmt/v1alpha1/api_key.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; + +package mgmt.v1alpha1; + +import "buf/validate/validate.proto"; +import "google/protobuf/timestamp.proto"; + +message CreateAccountApiKeyRequest { + string account_id = 1 [(buf.validate.field).string.uuid = true]; + string name = 2 [(buf.validate.field).string.min_len = 1]; + // Validate between now and one year: now < x < 1year + google.protobuf.Timestamp expires_at = 3 [ + (buf.validate.field).timestamp.gt_now = true, + (buf.validate.field).timestamp.within = {seconds: 31536000} + ]; +} +message CreateAccountApiKeyResponse { + AccountApiKey api_key = 1; +} + +message AccountApiKey { + string id = 1; + string name = 2; + string account_id = 3; + string created_by_id = 4; + google.protobuf.Timestamp created_at = 5; + string updated_by_id = 6; + google.protobuf.Timestamp updated_at = 7; + /* key_value is only returned on initial creation or when it is regenerated */ + optional string key_value = 8; +} + +message GetAccountApiKeysRequest { + string account_id = 1 [(buf.validate.field).string.uuid = true]; +} +message GetAccountApiKeysResponse { + repeated AccountApiKey api_keys = 1; +} + +message GetAccountApiKeyRequest { + string id = 1 [(buf.validate.field).string.uuid = true]; +} +message GetAccountApiKeyResponse { + AccountApiKey api_key = 1; +} + +message RegenerateAccountApiKeyRequest { + string id = 1 [(buf.validate.field).string.uuid = true]; +} +message RegenerateAccountApiKeyResponse { + AccountApiKey api_key = 1; +} + +message DeleteAccountApiKeyRequest { + string id = 1 [(buf.validate.field).string.uuid = true]; +} +message DeleteAccountApiKeyResponse {} + +service ApiKeyService { + rpc GetAccountApiKeys(GetAccountApiKeysRequest) returns (GetAccountApiKeysResponse) {} + rpc GetAccountApiKey(GetAccountApiKeyRequest) returns (GetAccountApiKeyResponse) {} + rpc CreateAccountApiKey(CreateAccountApiKeyRequest) returns (CreateAccountApiKeyResponse) {} + rpc RegenerateAccountApiKey(RegenerateAccountApiKeyRequest) returns (RegenerateAccountApiKeyResponse) {} + rpc DeleteAccountApiKey(DeleteAccountApiKeyRequest) returns (DeleteAccountApiKeyResponse) {} +} diff --git a/backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.down.sql b/backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.down.sql new file mode 100644 index 0000000000..2c33d1cbd4 --- /dev/null +++ b/backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.down.sql @@ -0,0 +1,7 @@ +ALTER TABLE neosync_api.account_api_keys +DROP CONSTRAINT account_api_keys_key_value; + +ALTER TABLE neosync_api.account_api_keys +ADD CONSTRAINT account_api_keys_account_id_key_value UNIQUE(account_id, key_value); + + diff --git a/backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.up.sql b/backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.up.sql new file mode 100644 index 0000000000..8f93ece185 --- /dev/null +++ b/backend/sql/postgresql/schema/20231110191350_account-api-key-value-unique.up.sql @@ -0,0 +1,5 @@ +ALTER TABLE neosync_api.account_api_keys +DROP CONSTRAINT account_api_keys_account_id_key_value; + +ALTER TABLE neosync_api.account_api_keys +ADD CONSTRAINT account_api_keys_key_value UNIQUE(key_value); diff --git a/frontend/neosync-api-client/mgmt/v1alpha1/api_key_connect.ts b/frontend/neosync-api-client/mgmt/v1alpha1/api_key_connect.ts new file mode 100644 index 0000000000..a70f9fb5d0 --- /dev/null +++ b/frontend/neosync-api-client/mgmt/v1alpha1/api_key_connect.ts @@ -0,0 +1,62 @@ +// @generated by protoc-gen-connect-es v1.0.0 with parameter "target=ts,import_extension=none" +// @generated from file mgmt/v1alpha1/api_key.proto (package mgmt.v1alpha1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CreateAccountApiKeyRequest, CreateAccountApiKeyResponse, DeleteAccountApiKeyRequest, DeleteAccountApiKeyResponse, GetAccountApiKeyRequest, GetAccountApiKeyResponse, GetAccountApiKeysRequest, GetAccountApiKeysResponse, RegenerateAccountApiKeyRequest, RegenerateAccountApiKeyResponse } from "./api_key_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service mgmt.v1alpha1.ApiKeyService + */ +export const ApiKeyService = { + typeName: "mgmt.v1alpha1.ApiKeyService", + methods: { + /** + * @generated from rpc mgmt.v1alpha1.ApiKeyService.GetAccountApiKeys + */ + getAccountApiKeys: { + name: "GetAccountApiKeys", + I: GetAccountApiKeysRequest, + O: GetAccountApiKeysResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc mgmt.v1alpha1.ApiKeyService.GetAccountApiKey + */ + getAccountApiKey: { + name: "GetAccountApiKey", + I: GetAccountApiKeyRequest, + O: GetAccountApiKeyResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc mgmt.v1alpha1.ApiKeyService.CreateAccountApiKey + */ + createAccountApiKey: { + name: "CreateAccountApiKey", + I: CreateAccountApiKeyRequest, + O: CreateAccountApiKeyResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc mgmt.v1alpha1.ApiKeyService.RegenerateAccountApiKey + */ + regenerateAccountApiKey: { + name: "RegenerateAccountApiKey", + I: RegenerateAccountApiKeyRequest, + O: RegenerateAccountApiKeyResponse, + kind: MethodKind.Unary, + }, + /** + * @generated from rpc mgmt.v1alpha1.ApiKeyService.DeleteAccountApiKey + */ + deleteAccountApiKey: { + name: "DeleteAccountApiKey", + I: DeleteAccountApiKeyRequest, + O: DeleteAccountApiKeyResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/frontend/neosync-api-client/mgmt/v1alpha1/api_key_pb.ts b/frontend/neosync-api-client/mgmt/v1alpha1/api_key_pb.ts new file mode 100644 index 0000000000..b5508e6809 --- /dev/null +++ b/frontend/neosync-api-client/mgmt/v1alpha1/api_key_pb.ts @@ -0,0 +1,467 @@ +// @generated by protoc-gen-es v1.3.1 with parameter "target=ts,import_extension=none" +// @generated from file mgmt/v1alpha1/api_key.proto (package mgmt.v1alpha1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; + +/** + * @generated from message mgmt.v1alpha1.CreateAccountApiKeyRequest + */ +export class CreateAccountApiKeyRequest extends Message { + /** + * @generated from field: string account_id = 1; + */ + accountId = ""; + + /** + * @generated from field: string name = 2; + */ + name = ""; + + /** + * Validate between now and one year: now < x < 1year + * + * @generated from field: google.protobuf.Timestamp expires_at = 3; + */ + expiresAt?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.CreateAccountApiKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "expires_at", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateAccountApiKeyRequest { + return new CreateAccountApiKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateAccountApiKeyRequest { + return new CreateAccountApiKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateAccountApiKeyRequest { + return new CreateAccountApiKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateAccountApiKeyRequest | PlainMessage | undefined, b: CreateAccountApiKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateAccountApiKeyRequest, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.CreateAccountApiKeyResponse + */ +export class CreateAccountApiKeyResponse extends Message { + /** + * @generated from field: mgmt.v1alpha1.AccountApiKey api_key = 1; + */ + apiKey?: AccountApiKey; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.CreateAccountApiKeyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "api_key", kind: "message", T: AccountApiKey }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateAccountApiKeyResponse { + return new CreateAccountApiKeyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateAccountApiKeyResponse { + return new CreateAccountApiKeyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateAccountApiKeyResponse { + return new CreateAccountApiKeyResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateAccountApiKeyResponse | PlainMessage | undefined, b: CreateAccountApiKeyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateAccountApiKeyResponse, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.AccountApiKey + */ +export class AccountApiKey extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string name = 2; + */ + name = ""; + + /** + * @generated from field: string account_id = 3; + */ + accountId = ""; + + /** + * @generated from field: string created_by_id = 4; + */ + createdById = ""; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 5; + */ + createdAt?: Timestamp; + + /** + * @generated from field: string updated_by_id = 6; + */ + updatedById = ""; + + /** + * @generated from field: google.protobuf.Timestamp updated_at = 7; + */ + updatedAt?: Timestamp; + + /** + * key_value is only returned on initial creation or when it is regenerated + * + * @generated from field: optional string key_value = 8; + */ + keyValue?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.AccountApiKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "created_by_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "created_at", kind: "message", T: Timestamp }, + { no: 6, name: "updated_by_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "updated_at", kind: "message", T: Timestamp }, + { no: 8, name: "key_value", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AccountApiKey { + return new AccountApiKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AccountApiKey { + return new AccountApiKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AccountApiKey { + return new AccountApiKey().fromJsonString(jsonString, options); + } + + static equals(a: AccountApiKey | PlainMessage | undefined, b: AccountApiKey | PlainMessage | undefined): boolean { + return proto3.util.equals(AccountApiKey, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.GetAccountApiKeysRequest + */ +export class GetAccountApiKeysRequest extends Message { + /** + * @generated from field: string account_id = 1; + */ + accountId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.GetAccountApiKeysRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "account_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAccountApiKeysRequest { + return new GetAccountApiKeysRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAccountApiKeysRequest { + return new GetAccountApiKeysRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAccountApiKeysRequest { + return new GetAccountApiKeysRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetAccountApiKeysRequest | PlainMessage | undefined, b: GetAccountApiKeysRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAccountApiKeysRequest, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.GetAccountApiKeysResponse + */ +export class GetAccountApiKeysResponse extends Message { + /** + * @generated from field: repeated mgmt.v1alpha1.AccountApiKey api_keys = 1; + */ + apiKeys: AccountApiKey[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.GetAccountApiKeysResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "api_keys", kind: "message", T: AccountApiKey, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAccountApiKeysResponse { + return new GetAccountApiKeysResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAccountApiKeysResponse { + return new GetAccountApiKeysResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAccountApiKeysResponse { + return new GetAccountApiKeysResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetAccountApiKeysResponse | PlainMessage | undefined, b: GetAccountApiKeysResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAccountApiKeysResponse, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.GetAccountApiKeyRequest + */ +export class GetAccountApiKeyRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.GetAccountApiKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAccountApiKeyRequest { + return new GetAccountApiKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAccountApiKeyRequest { + return new GetAccountApiKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAccountApiKeyRequest { + return new GetAccountApiKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetAccountApiKeyRequest | PlainMessage | undefined, b: GetAccountApiKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAccountApiKeyRequest, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.GetAccountApiKeyResponse + */ +export class GetAccountApiKeyResponse extends Message { + /** + * @generated from field: mgmt.v1alpha1.AccountApiKey api_key = 1; + */ + apiKey?: AccountApiKey; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.GetAccountApiKeyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "api_key", kind: "message", T: AccountApiKey }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetAccountApiKeyResponse { + return new GetAccountApiKeyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetAccountApiKeyResponse { + return new GetAccountApiKeyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetAccountApiKeyResponse { + return new GetAccountApiKeyResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetAccountApiKeyResponse | PlainMessage | undefined, b: GetAccountApiKeyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetAccountApiKeyResponse, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.RegenerateAccountApiKeyRequest + */ +export class RegenerateAccountApiKeyRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.RegenerateAccountApiKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegenerateAccountApiKeyRequest { + return new RegenerateAccountApiKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegenerateAccountApiKeyRequest { + return new RegenerateAccountApiKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegenerateAccountApiKeyRequest { + return new RegenerateAccountApiKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: RegenerateAccountApiKeyRequest | PlainMessage | undefined, b: RegenerateAccountApiKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RegenerateAccountApiKeyRequest, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.RegenerateAccountApiKeyResponse + */ +export class RegenerateAccountApiKeyResponse extends Message { + /** + * @generated from field: mgmt.v1alpha1.AccountApiKey api_key = 1; + */ + apiKey?: AccountApiKey; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.RegenerateAccountApiKeyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "api_key", kind: "message", T: AccountApiKey }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegenerateAccountApiKeyResponse { + return new RegenerateAccountApiKeyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegenerateAccountApiKeyResponse { + return new RegenerateAccountApiKeyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegenerateAccountApiKeyResponse { + return new RegenerateAccountApiKeyResponse().fromJsonString(jsonString, options); + } + + static equals(a: RegenerateAccountApiKeyResponse | PlainMessage | undefined, b: RegenerateAccountApiKeyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RegenerateAccountApiKeyResponse, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.DeleteAccountApiKeyRequest + */ +export class DeleteAccountApiKeyRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.DeleteAccountApiKeyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAccountApiKeyRequest { + return new DeleteAccountApiKeyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAccountApiKeyRequest { + return new DeleteAccountApiKeyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteAccountApiKeyRequest { + return new DeleteAccountApiKeyRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteAccountApiKeyRequest | PlainMessage | undefined, b: DeleteAccountApiKeyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteAccountApiKeyRequest, a, b); + } +} + +/** + * @generated from message mgmt.v1alpha1.DeleteAccountApiKeyResponse + */ +export class DeleteAccountApiKeyResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "mgmt.v1alpha1.DeleteAccountApiKeyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAccountApiKeyResponse { + return new DeleteAccountApiKeyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAccountApiKeyResponse { + return new DeleteAccountApiKeyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteAccountApiKeyResponse { + return new DeleteAccountApiKeyResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteAccountApiKeyResponse | PlainMessage | undefined, b: DeleteAccountApiKeyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteAccountApiKeyResponse, a, b); + } +} +