From 3ce4492f93c9832f84636b320e9e88ca818580ff Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Tue, 21 Jan 2025 14:45:11 -0500 Subject: [PATCH 1/7] blob: early blob upload service and models --- generated/go/blob/v1/blob_service.pb.go | 461 +++++++++++ .../go/blob/v1/blob_service.pb.validate.go | 738 ++++++++++++++++++ generated/go/blob/v1/blob_service_grpc.pb.go | 205 +++++ generated/go/blob/v1/model.pb.go | 633 +++++++++++++++ generated/go/blob/v1/model.pb.validate.go | 625 +++++++++++++++ proto/blob/v1/blob_service.proto | 58 ++ proto/blob/v1/model.proto | 70 ++ 7 files changed, 2790 insertions(+) create mode 100644 generated/go/blob/v1/blob_service.pb.go create mode 100644 generated/go/blob/v1/blob_service.pb.validate.go create mode 100644 generated/go/blob/v1/blob_service_grpc.pb.go create mode 100644 generated/go/blob/v1/model.pb.go create mode 100644 generated/go/blob/v1/model.pb.validate.go create mode 100644 proto/blob/v1/blob_service.proto create mode 100644 proto/blob/v1/model.proto diff --git a/generated/go/blob/v1/blob_service.pb.go b/generated/go/blob/v1/blob_service.pb.go new file mode 100644 index 0000000..c84c2c2 --- /dev/null +++ b/generated/go/blob/v1/blob_service.pb.go @@ -0,0 +1,461 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.21.12 +// source: blob/v1/blob_service.proto + +package blobpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + 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) +) + +// Request for a smaller/single-shot upload +type UploadRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OwnerId string `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` + RawData []byte `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` +} + +func (x *UploadRequest) Reset() { + *x = UploadRequest{} + mi := &file_blob_v1_blob_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadRequest) ProtoMessage() {} + +func (x *UploadRequest) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_blob_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead. +func (*UploadRequest) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{0} +} + +func (x *UploadRequest) GetOwnerId() string { + if x != nil { + return x.OwnerId + } + return "" +} + +func (x *UploadRequest) GetBlobType() BlobType { + if x != nil { + return x.BlobType + } + return BlobType_BLOB_TYPE_UNKNOWN +} + +func (x *UploadRequest) GetRawData() []byte { + if x != nil { + return x.RawData + } + return nil +} + +// Single-shot upload response +type UploadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` +} + +func (x *UploadResponse) Reset() { + *x = UploadResponse{} + mi := &file_blob_v1_blob_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadResponse) ProtoMessage() {} + +func (x *UploadResponse) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_blob_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead. +func (*UploadResponse) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{1} +} + +func (x *UploadResponse) GetBlob() *Blob { + if x != nil { + return x.Blob + } + return nil +} + +// Client-streaming chunk for large uploads +type UploadChunk struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OwnerId string `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *UploadChunk) Reset() { + *x = UploadChunk{} + mi := &file_blob_v1_blob_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadChunk) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadChunk) ProtoMessage() {} + +func (x *UploadChunk) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_blob_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadChunk.ProtoReflect.Descriptor instead. +func (*UploadChunk) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{2} +} + +func (x *UploadChunk) GetOwnerId() string { + if x != nil { + return x.OwnerId + } + return "" +} + +func (x *UploadChunk) GetBlobType() BlobType { + if x != nil { + return x.BlobType + } + return BlobType_BLOB_TYPE_UNKNOWN +} + +func (x *UploadChunk) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Chunked upload final response +type UploadChunkedResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` +} + +func (x *UploadChunkedResponse) Reset() { + *x = UploadChunkedResponse{} + mi := &file_blob_v1_blob_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadChunkedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadChunkedResponse) ProtoMessage() {} + +func (x *UploadChunkedResponse) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_blob_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadChunkedResponse.ProtoReflect.Descriptor instead. +func (*UploadChunkedResponse) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{3} +} + +func (x *UploadChunkedResponse) GetBlob() *Blob { + if x != nil { + return x.Blob + } + return nil +} + +// Retrieve existing blob info +type GetInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlobId []byte `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` +} + +func (x *GetInfoRequest) Reset() { + *x = GetInfoRequest{} + mi := &file_blob_v1_blob_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetInfoRequest) ProtoMessage() {} + +func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_blob_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetInfoRequest.ProtoReflect.Descriptor instead. +func (*GetInfoRequest) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{4} +} + +func (x *GetInfoRequest) GetBlobId() []byte { + if x != nil { + return x.BlobId + } + return nil +} + +type GetInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` +} + +func (x *GetInfoResponse) Reset() { + *x = GetInfoResponse{} + mi := &file_blob_v1_blob_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetInfoResponse) ProtoMessage() {} + +func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_blob_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetInfoResponse.ProtoReflect.Descriptor instead. +func (*GetInfoResponse) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{5} +} + +func (x *GetInfoResponse) GetBlob() *Blob { + if x != nil { + return x.Blob + } + return nil +} + +var File_blob_v1_blob_service_proto protoreflect.FileDescriptor + +var file_blob_v1_blob_service_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x66, 0x6c, + 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x13, + 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, + 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x61, 0x77, 0x44, + 0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, + 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, + 0x62, 0x22, 0x75, 0x0a, 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, + 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x15, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x29, 0x0a, + 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x17, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, + 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, + 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0x85, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, + 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, + 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, + 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, + 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, + 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, + 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, + 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, + 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_blob_v1_blob_service_proto_rawDescOnce sync.Once + file_blob_v1_blob_service_proto_rawDescData = file_blob_v1_blob_service_proto_rawDesc +) + +func file_blob_v1_blob_service_proto_rawDescGZIP() []byte { + file_blob_v1_blob_service_proto_rawDescOnce.Do(func() { + file_blob_v1_blob_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_blob_v1_blob_service_proto_rawDescData) + }) + return file_blob_v1_blob_service_proto_rawDescData +} + +var file_blob_v1_blob_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_blob_v1_blob_service_proto_goTypes = []any{ + (*UploadRequest)(nil), // 0: flipchat.blob.v1.UploadRequest + (*UploadResponse)(nil), // 1: flipchat.blob.v1.UploadResponse + (*UploadChunk)(nil), // 2: flipchat.blob.v1.UploadChunk + (*UploadChunkedResponse)(nil), // 3: flipchat.blob.v1.UploadChunkedResponse + (*GetInfoRequest)(nil), // 4: flipchat.blob.v1.GetInfoRequest + (*GetInfoResponse)(nil), // 5: flipchat.blob.v1.GetInfoResponse + (BlobType)(0), // 6: flipchat.blob.v1.BlobType + (*Blob)(nil), // 7: flipchat.blob.v1.Blob +} +var file_blob_v1_blob_service_proto_depIdxs = []int32{ + 6, // 0: flipchat.blob.v1.UploadRequest.blob_type:type_name -> flipchat.blob.v1.BlobType + 7, // 1: flipchat.blob.v1.UploadResponse.blob:type_name -> flipchat.blob.v1.Blob + 6, // 2: flipchat.blob.v1.UploadChunk.blob_type:type_name -> flipchat.blob.v1.BlobType + 7, // 3: flipchat.blob.v1.UploadChunkedResponse.blob:type_name -> flipchat.blob.v1.Blob + 7, // 4: flipchat.blob.v1.GetInfoResponse.blob:type_name -> flipchat.blob.v1.Blob + 0, // 5: flipchat.blob.v1.BlobService.Upload:input_type -> flipchat.blob.v1.UploadRequest + 2, // 6: flipchat.blob.v1.BlobService.UploadChunked:input_type -> flipchat.blob.v1.UploadChunk + 4, // 7: flipchat.blob.v1.BlobService.GetInfo:input_type -> flipchat.blob.v1.GetInfoRequest + 1, // 8: flipchat.blob.v1.BlobService.Upload:output_type -> flipchat.blob.v1.UploadResponse + 3, // 9: flipchat.blob.v1.BlobService.UploadChunked:output_type -> flipchat.blob.v1.UploadChunkedResponse + 5, // 10: flipchat.blob.v1.BlobService.GetInfo:output_type -> flipchat.blob.v1.GetInfoResponse + 8, // [8:11] is the sub-list for method output_type + 5, // [5:8] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_blob_v1_blob_service_proto_init() } +func file_blob_v1_blob_service_proto_init() { + if File_blob_v1_blob_service_proto != nil { + return + } + file_blob_v1_model_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_blob_v1_blob_service_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_blob_v1_blob_service_proto_goTypes, + DependencyIndexes: file_blob_v1_blob_service_proto_depIdxs, + MessageInfos: file_blob_v1_blob_service_proto_msgTypes, + }.Build() + File_blob_v1_blob_service_proto = out.File + file_blob_v1_blob_service_proto_rawDesc = nil + file_blob_v1_blob_service_proto_goTypes = nil + file_blob_v1_blob_service_proto_depIdxs = nil +} diff --git a/generated/go/blob/v1/blob_service.pb.validate.go b/generated/go/blob/v1/blob_service.pb.validate.go new file mode 100644 index 0000000..72d75f9 --- /dev/null +++ b/generated/go/blob/v1/blob_service.pb.validate.go @@ -0,0 +1,738 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: blob/v1/blob_service.proto + +package blobpb + +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 UploadRequest 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 *UploadRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UploadRequest 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 UploadRequestMultiError, or +// nil if none found. +func (m *UploadRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UploadRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for OwnerId + + // no validation rules for BlobType + + // no validation rules for RawData + + if len(errors) > 0 { + return UploadRequestMultiError(errors) + } + + return nil +} + +// UploadRequestMultiError is an error wrapping multiple validation errors +// returned by UploadRequest.ValidateAll() if the designated constraints +// aren't met. +type UploadRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UploadRequestMultiError) 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 UploadRequestMultiError) AllErrors() []error { return m } + +// UploadRequestValidationError is the validation error returned by +// UploadRequest.Validate if the designated constraints aren't met. +type UploadRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UploadRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UploadRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UploadRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UploadRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UploadRequestValidationError) ErrorName() string { return "UploadRequestValidationError" } + +// Error satisfies the builtin error interface +func (e UploadRequestValidationError) 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 %sUploadRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UploadRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UploadRequestValidationError{} + +// Validate checks the field values on UploadResponse 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 *UploadResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UploadResponse 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 UploadResponseMultiError, +// or nil if none found. +func (m *UploadResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UploadResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetBlob()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UploadResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlob()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UploadResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UploadResponseMultiError(errors) + } + + return nil +} + +// UploadResponseMultiError is an error wrapping multiple validation errors +// returned by UploadResponse.ValidateAll() if the designated constraints +// aren't met. +type UploadResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UploadResponseMultiError) 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 UploadResponseMultiError) AllErrors() []error { return m } + +// UploadResponseValidationError is the validation error returned by +// UploadResponse.Validate if the designated constraints aren't met. +type UploadResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UploadResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UploadResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UploadResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UploadResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UploadResponseValidationError) ErrorName() string { return "UploadResponseValidationError" } + +// Error satisfies the builtin error interface +func (e UploadResponseValidationError) 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 %sUploadResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UploadResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UploadResponseValidationError{} + +// Validate checks the field values on UploadChunk 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 *UploadChunk) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UploadChunk 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 UploadChunkMultiError, or +// nil if none found. +func (m *UploadChunk) ValidateAll() error { + return m.validate(true) +} + +func (m *UploadChunk) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for OwnerId + + // no validation rules for BlobType + + // no validation rules for Data + + if len(errors) > 0 { + return UploadChunkMultiError(errors) + } + + return nil +} + +// UploadChunkMultiError is an error wrapping multiple validation errors +// returned by UploadChunk.ValidateAll() if the designated constraints aren't met. +type UploadChunkMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UploadChunkMultiError) 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 UploadChunkMultiError) AllErrors() []error { return m } + +// UploadChunkValidationError is the validation error returned by +// UploadChunk.Validate if the designated constraints aren't met. +type UploadChunkValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UploadChunkValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UploadChunkValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UploadChunkValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UploadChunkValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UploadChunkValidationError) ErrorName() string { return "UploadChunkValidationError" } + +// Error satisfies the builtin error interface +func (e UploadChunkValidationError) 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 %sUploadChunk.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UploadChunkValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UploadChunkValidationError{} + +// Validate checks the field values on UploadChunkedResponse 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 *UploadChunkedResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UploadChunkedResponse 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 +// UploadChunkedResponseMultiError, or nil if none found. +func (m *UploadChunkedResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UploadChunkedResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetBlob()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UploadChunkedResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadChunkedResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlob()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UploadChunkedResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UploadChunkedResponseMultiError(errors) + } + + return nil +} + +// UploadChunkedResponseMultiError is an error wrapping multiple validation +// errors returned by UploadChunkedResponse.ValidateAll() if the designated +// constraints aren't met. +type UploadChunkedResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UploadChunkedResponseMultiError) 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 UploadChunkedResponseMultiError) AllErrors() []error { return m } + +// UploadChunkedResponseValidationError is the validation error returned by +// UploadChunkedResponse.Validate if the designated constraints aren't met. +type UploadChunkedResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UploadChunkedResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UploadChunkedResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UploadChunkedResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UploadChunkedResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UploadChunkedResponseValidationError) ErrorName() string { + return "UploadChunkedResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UploadChunkedResponseValidationError) 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 %sUploadChunkedResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UploadChunkedResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UploadChunkedResponseValidationError{} + +// Validate checks the field values on GetInfoRequest 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 *GetInfoRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetInfoRequest 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 GetInfoRequestMultiError, +// or nil if none found. +func (m *GetInfoRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetInfoRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for BlobId + + if len(errors) > 0 { + return GetInfoRequestMultiError(errors) + } + + return nil +} + +// GetInfoRequestMultiError is an error wrapping multiple validation errors +// returned by GetInfoRequest.ValidateAll() if the designated constraints +// aren't met. +type GetInfoRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetInfoRequestMultiError) 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 GetInfoRequestMultiError) AllErrors() []error { return m } + +// GetInfoRequestValidationError is the validation error returned by +// GetInfoRequest.Validate if the designated constraints aren't met. +type GetInfoRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetInfoRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetInfoRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetInfoRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetInfoRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetInfoRequestValidationError) ErrorName() string { return "GetInfoRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetInfoRequestValidationError) 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 %sGetInfoRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetInfoRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetInfoRequestValidationError{} + +// Validate checks the field values on GetInfoResponse 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 *GetInfoResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetInfoResponse 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 +// GetInfoResponseMultiError, or nil if none found. +func (m *GetInfoResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetInfoResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetBlob()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetInfoResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetInfoResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlob()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetInfoResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GetInfoResponseMultiError(errors) + } + + return nil +} + +// GetInfoResponseMultiError is an error wrapping multiple validation errors +// returned by GetInfoResponse.ValidateAll() if the designated constraints +// aren't met. +type GetInfoResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetInfoResponseMultiError) 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 GetInfoResponseMultiError) AllErrors() []error { return m } + +// GetInfoResponseValidationError is the validation error returned by +// GetInfoResponse.Validate if the designated constraints aren't met. +type GetInfoResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetInfoResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetInfoResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetInfoResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetInfoResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetInfoResponseValidationError) ErrorName() string { return "GetInfoResponseValidationError" } + +// Error satisfies the builtin error interface +func (e GetInfoResponseValidationError) 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 %sGetInfoResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetInfoResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetInfoResponseValidationError{} diff --git a/generated/go/blob/v1/blob_service_grpc.pb.go b/generated/go/blob/v1/blob_service_grpc.pb.go new file mode 100644 index 0000000..4f4cef8 --- /dev/null +++ b/generated/go/blob/v1/blob_service_grpc.pb.go @@ -0,0 +1,205 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.21.12 +// source: blob/v1/blob_service.proto + +package blobpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + BlobService_Upload_FullMethodName = "/flipchat.blob.v1.BlobService/Upload" + BlobService_UploadChunked_FullMethodName = "/flipchat.blob.v1.BlobService/UploadChunked" + BlobService_GetInfo_FullMethodName = "/flipchat.blob.v1.BlobService/GetInfo" +) + +// BlobServiceClient is the client API for BlobService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BlobServiceClient interface { + // Request for a smaller/single-shot upload + Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) + // Placeholder for future work + // - helps with large files that exceed gRPC message limits + // - avoids high memory usage by streaming in chunks + // - can allow better upload progress tracking + // - can *maybe* support live audio/video + UploadChunked(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadChunk, UploadChunkedResponse], error) + // Get the metadata for a previously uploaded blob + GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) +} + +type blobServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBlobServiceClient(cc grpc.ClientConnInterface) BlobServiceClient { + return &blobServiceClient{cc} +} + +func (c *blobServiceClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UploadResponse) + err := c.cc.Invoke(ctx, BlobService_Upload_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *blobServiceClient) UploadChunked(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadChunk, UploadChunkedResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &BlobService_ServiceDesc.Streams[0], BlobService_UploadChunked_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[UploadChunk, UploadChunkedResponse]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BlobService_UploadChunkedClient = grpc.ClientStreamingClient[UploadChunk, UploadChunkedResponse] + +func (c *blobServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetInfoResponse) + err := c.cc.Invoke(ctx, BlobService_GetInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// BlobServiceServer is the server API for BlobService service. +// All implementations must embed UnimplementedBlobServiceServer +// for forward compatibility. +type BlobServiceServer interface { + // Request for a smaller/single-shot upload + Upload(context.Context, *UploadRequest) (*UploadResponse, error) + // Placeholder for future work + // - helps with large files that exceed gRPC message limits + // - avoids high memory usage by streaming in chunks + // - can allow better upload progress tracking + // - can *maybe* support live audio/video + UploadChunked(grpc.ClientStreamingServer[UploadChunk, UploadChunkedResponse]) error + // Get the metadata for a previously uploaded blob + GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) + mustEmbedUnimplementedBlobServiceServer() +} + +// UnimplementedBlobServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedBlobServiceServer struct{} + +func (UnimplementedBlobServiceServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented") +} +func (UnimplementedBlobServiceServer) UploadChunked(grpc.ClientStreamingServer[UploadChunk, UploadChunkedResponse]) error { + return status.Errorf(codes.Unimplemented, "method UploadChunked not implemented") +} +func (UnimplementedBlobServiceServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedBlobServiceServer) mustEmbedUnimplementedBlobServiceServer() {} +func (UnimplementedBlobServiceServer) testEmbeddedByValue() {} + +// UnsafeBlobServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BlobServiceServer will +// result in compilation errors. +type UnsafeBlobServiceServer interface { + mustEmbedUnimplementedBlobServiceServer() +} + +func RegisterBlobServiceServer(s grpc.ServiceRegistrar, srv BlobServiceServer) { + // If the following call pancis, it indicates UnimplementedBlobServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&BlobService_ServiceDesc, srv) +} + +func _BlobService_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlobServiceServer).Upload(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlobService_Upload_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlobServiceServer).Upload(ctx, req.(*UploadRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _BlobService_UploadChunked_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(BlobServiceServer).UploadChunked(&grpc.GenericServerStream[UploadChunk, UploadChunkedResponse]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type BlobService_UploadChunkedServer = grpc.ClientStreamingServer[UploadChunk, UploadChunkedResponse] + +func _BlobService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BlobServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: BlobService_GetInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BlobServiceServer).GetInfo(ctx, req.(*GetInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// BlobService_ServiceDesc is the grpc.ServiceDesc for BlobService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BlobService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipchat.blob.v1.BlobService", + HandlerType: (*BlobServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Upload", + Handler: _BlobService_Upload_Handler, + }, + { + MethodName: "GetInfo", + Handler: _BlobService_GetInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "UploadChunked", + Handler: _BlobService_UploadChunked_Handler, + ClientStreams: true, + }, + }, + Metadata: "blob/v1/blob_service.proto", +} diff --git a/generated/go/blob/v1/model.pb.go b/generated/go/blob/v1/model.pb.go new file mode 100644 index 0000000..c440bd6 --- /dev/null +++ b/generated/go/blob/v1/model.pb.go @@ -0,0 +1,633 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.1 +// protoc v3.21.12 +// source: blob/v1/model.proto + +package blobpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +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 BlobType int32 + +const ( + BlobType_BLOB_TYPE_UNKNOWN BlobType = 0 + BlobType_BLOB_TYPE_IMAGE BlobType = 1 + BlobType_BLOB_TYPE_VIDEO BlobType = 2 + BlobType_BLOB_TYPE_AUDIO BlobType = 3 +) + +// Enum value maps for BlobType. +var ( + BlobType_name = map[int32]string{ + 0: "BLOB_TYPE_UNKNOWN", + 1: "BLOB_TYPE_IMAGE", + 2: "BLOB_TYPE_VIDEO", + 3: "BLOB_TYPE_AUDIO", + } + BlobType_value = map[string]int32{ + "BLOB_TYPE_UNKNOWN": 0, + "BLOB_TYPE_IMAGE": 1, + "BLOB_TYPE_VIDEO": 2, + "BLOB_TYPE_AUDIO": 3, + } +) + +func (x BlobType) Enum() *BlobType { + p := new(BlobType) + *p = x + return p +} + +func (x BlobType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BlobType) Descriptor() protoreflect.EnumDescriptor { + return file_blob_v1_model_proto_enumTypes[0].Descriptor() +} + +func (BlobType) Type() protoreflect.EnumType { + return &file_blob_v1_model_proto_enumTypes[0] +} + +func (x BlobType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BlobType.Descriptor instead. +func (BlobType) EnumDescriptor() ([]byte, []int) { + return file_blob_v1_model_proto_rawDescGZIP(), []int{0} +} + +type ImageMetadata_Format int32 + +const ( + ImageMetadata_IMAGE_FORMAT_UNKNOWN ImageMetadata_Format = 0 + ImageMetadata_IMAGE_FORMAT_JPEG ImageMetadata_Format = 1 + ImageMetadata_IMAGE_FORMAT_PNG ImageMetadata_Format = 2 + ImageMetadata_IMAGE_FORMAT_GIF ImageMetadata_Format = 3 + ImageMetadata_IMAGE_FORMAT_WEBP ImageMetadata_Format = 4 +) + +// Enum value maps for ImageMetadata_Format. +var ( + ImageMetadata_Format_name = map[int32]string{ + 0: "IMAGE_FORMAT_UNKNOWN", + 1: "IMAGE_FORMAT_JPEG", + 2: "IMAGE_FORMAT_PNG", + 3: "IMAGE_FORMAT_GIF", + 4: "IMAGE_FORMAT_WEBP", + } + ImageMetadata_Format_value = map[string]int32{ + "IMAGE_FORMAT_UNKNOWN": 0, + "IMAGE_FORMAT_JPEG": 1, + "IMAGE_FORMAT_PNG": 2, + "IMAGE_FORMAT_GIF": 3, + "IMAGE_FORMAT_WEBP": 4, + } +) + +func (x ImageMetadata_Format) Enum() *ImageMetadata_Format { + p := new(ImageMetadata_Format) + *p = x + return p +} + +func (x ImageMetadata_Format) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ImageMetadata_Format) Descriptor() protoreflect.EnumDescriptor { + return file_blob_v1_model_proto_enumTypes[1].Descriptor() +} + +func (ImageMetadata_Format) Type() protoreflect.EnumType { + return &file_blob_v1_model_proto_enumTypes[1] +} + +func (x ImageMetadata_Format) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ImageMetadata_Format.Descriptor instead. +func (ImageMetadata_Format) EnumDescriptor() ([]byte, []int) { + return file_blob_v1_model_proto_rawDescGZIP(), []int{1, 0} +} + +// Common blob info returned in responses +type Blob struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlobId []byte `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` + BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` + OwnerId string `protobuf:"bytes,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + S3Url string `protobuf:"bytes,4,opt,name=s3_url,json=s3Url,proto3" json:"s3_url,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + // Types that are assignable to Metadata: + // + // *Blob_ImageMetadata + // *Blob_VideoMetadata + // *Blob_AudioMetadata + Metadata isBlob_Metadata `protobuf_oneof:"metadata"` +} + +func (x *Blob) Reset() { + *x = Blob{} + mi := &file_blob_v1_model_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Blob) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Blob) ProtoMessage() {} + +func (x *Blob) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_model_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Blob.ProtoReflect.Descriptor instead. +func (*Blob) Descriptor() ([]byte, []int) { + return file_blob_v1_model_proto_rawDescGZIP(), []int{0} +} + +func (x *Blob) GetBlobId() []byte { + if x != nil { + return x.BlobId + } + return nil +} + +func (x *Blob) GetBlobType() BlobType { + if x != nil { + return x.BlobType + } + return BlobType_BLOB_TYPE_UNKNOWN +} + +func (x *Blob) GetOwnerId() string { + if x != nil { + return x.OwnerId + } + return "" +} + +func (x *Blob) GetS3Url() string { + if x != nil { + return x.S3Url + } + return "" +} + +func (x *Blob) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (m *Blob) GetMetadata() isBlob_Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (x *Blob) GetImageMetadata() *ImageMetadata { + if x, ok := x.GetMetadata().(*Blob_ImageMetadata); ok { + return x.ImageMetadata + } + return nil +} + +func (x *Blob) GetVideoMetadata() *VideoMetadata { + if x, ok := x.GetMetadata().(*Blob_VideoMetadata); ok { + return x.VideoMetadata + } + return nil +} + +func (x *Blob) GetAudioMetadata() *AudioMetadata { + if x, ok := x.GetMetadata().(*Blob_AudioMetadata); ok { + return x.AudioMetadata + } + return nil +} + +type isBlob_Metadata interface { + isBlob_Metadata() +} + +type Blob_ImageMetadata struct { + ImageMetadata *ImageMetadata `protobuf:"bytes,6,opt,name=image_metadata,json=imageMetadata,proto3,oneof"` +} + +type Blob_VideoMetadata struct { + VideoMetadata *VideoMetadata `protobuf:"bytes,7,opt,name=video_metadata,json=videoMetadata,proto3,oneof"` +} + +type Blob_AudioMetadata struct { + AudioMetadata *AudioMetadata `protobuf:"bytes,8,opt,name=audio_metadata,json=audioMetadata,proto3,oneof"` +} + +func (*Blob_ImageMetadata) isBlob_Metadata() {} + +func (*Blob_VideoMetadata) isBlob_Metadata() {} + +func (*Blob_AudioMetadata) isBlob_Metadata() {} + +type ImageMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Format ImageMetadata_Format `protobuf:"varint,4,opt,name=format,proto3,enum=flipchat.blob.v1.ImageMetadata_Format" json:"format,omitempty"` +} + +func (x *ImageMetadata) Reset() { + *x = ImageMetadata{} + mi := &file_blob_v1_model_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImageMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageMetadata) ProtoMessage() {} + +func (x *ImageMetadata) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_model_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageMetadata.ProtoReflect.Descriptor instead. +func (*ImageMetadata) Descriptor() ([]byte, []int) { + return file_blob_v1_model_proto_rawDescGZIP(), []int{1} +} + +func (x *ImageMetadata) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ImageMetadata) GetWidth() int32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *ImageMetadata) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *ImageMetadata) GetFormat() ImageMetadata_Format { + if x != nil { + return x.Format + } + return ImageMetadata_IMAGE_FORMAT_UNKNOWN +} + +type VideoMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + DurationSeconds int32 `protobuf:"varint,4,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration_seconds,omitempty"` + FrameRate float32 `protobuf:"fixed32,5,opt,name=frame_rate,json=frameRate,proto3" json:"frame_rate,omitempty"` + Codec string `protobuf:"bytes,6,opt,name=codec,proto3" json:"codec,omitempty"` +} + +func (x *VideoMetadata) Reset() { + *x = VideoMetadata{} + mi := &file_blob_v1_model_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoMetadata) ProtoMessage() {} + +func (x *VideoMetadata) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_model_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoMetadata.ProtoReflect.Descriptor instead. +func (*VideoMetadata) Descriptor() ([]byte, []int) { + return file_blob_v1_model_proto_rawDescGZIP(), []int{2} +} + +func (x *VideoMetadata) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *VideoMetadata) GetWidth() int32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *VideoMetadata) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *VideoMetadata) GetDurationSeconds() int32 { + if x != nil { + return x.DurationSeconds + } + return 0 +} + +func (x *VideoMetadata) GetFrameRate() float32 { + if x != nil { + return x.FrameRate + } + return 0 +} + +func (x *VideoMetadata) GetCodec() string { + if x != nil { + return x.Codec + } + return "" +} + +type AudioMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + DurationSeconds int32 `protobuf:"varint,2,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration_seconds,omitempty"` + Codec string `protobuf:"bytes,3,opt,name=codec,proto3" json:"codec,omitempty"` +} + +func (x *AudioMetadata) Reset() { + *x = AudioMetadata{} + mi := &file_blob_v1_model_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AudioMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AudioMetadata) ProtoMessage() {} + +func (x *AudioMetadata) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_model_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AudioMetadata.ProtoReflect.Descriptor instead. +func (*AudioMetadata) Descriptor() ([]byte, []int) { + return file_blob_v1_model_proto_rawDescGZIP(), []int{3} +} + +func (x *AudioMetadata) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *AudioMetadata) GetDurationSeconds() int32 { + if x != nil { + return x.DurationSeconds + } + return 0 +} + +func (x *AudioMetadata) GetCodec() string { + if x != nil { + return x.Codec + } + return "" +} + +var File_blob_v1_model_proto protoreflect.FileDescriptor + +var file_blob_v1_model_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 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, 0xaf, 0x03, 0x0a, 0x04, 0x42, 0x6c, 0x6f, + 0x62, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, + 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, + 0x0a, 0x06, 0x73, 0x33, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x73, 0x33, 0x55, 0x72, 0x6c, 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, 0x48, 0x0a, 0x0e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x69, + 0x64, 0x65, 0x6f, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0d, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x0e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x41, 0x75, 0x64, 0x69, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, + 0x0d, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x0a, + 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, 0x02, 0x0a, 0x0d, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x12, 0x3e, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, + 0x72, 0x6d, 0x61, 0x74, 0x22, 0x7c, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x18, + 0x0a, 0x14, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4d, 0x41, 0x47, + 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4a, 0x50, 0x45, 0x47, 0x10, 0x01, 0x12, + 0x14, 0x0a, 0x10, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, + 0x50, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, + 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x47, 0x49, 0x46, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x49, + 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x57, 0x45, 0x42, 0x50, + 0x10, 0x04, 0x22, 0xb7, 0x01, 0x0a, 0x0d, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, + 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, + 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x29, 0x0a, 0x10, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x6d, 0x65, + 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x66, 0x72, 0x61, + 0x6d, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x22, 0x6a, 0x0a, 0x0d, + 0x41, 0x75, 0x64, 0x69, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, + 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x2a, 0x60, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x42, + 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x01, + 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x49, + 0x44, 0x45, 0x4f, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x03, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, + 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, + 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, + 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, + 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, + 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_blob_v1_model_proto_rawDescOnce sync.Once + file_blob_v1_model_proto_rawDescData = file_blob_v1_model_proto_rawDesc +) + +func file_blob_v1_model_proto_rawDescGZIP() []byte { + file_blob_v1_model_proto_rawDescOnce.Do(func() { + file_blob_v1_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_blob_v1_model_proto_rawDescData) + }) + return file_blob_v1_model_proto_rawDescData +} + +var file_blob_v1_model_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_blob_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_blob_v1_model_proto_goTypes = []any{ + (BlobType)(0), // 0: flipchat.blob.v1.BlobType + (ImageMetadata_Format)(0), // 1: flipchat.blob.v1.ImageMetadata.Format + (*Blob)(nil), // 2: flipchat.blob.v1.Blob + (*ImageMetadata)(nil), // 3: flipchat.blob.v1.ImageMetadata + (*VideoMetadata)(nil), // 4: flipchat.blob.v1.VideoMetadata + (*AudioMetadata)(nil), // 5: flipchat.blob.v1.AudioMetadata + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_blob_v1_model_proto_depIdxs = []int32{ + 0, // 0: flipchat.blob.v1.Blob.blob_type:type_name -> flipchat.blob.v1.BlobType + 6, // 1: flipchat.blob.v1.Blob.created_at:type_name -> google.protobuf.Timestamp + 3, // 2: flipchat.blob.v1.Blob.image_metadata:type_name -> flipchat.blob.v1.ImageMetadata + 4, // 3: flipchat.blob.v1.Blob.video_metadata:type_name -> flipchat.blob.v1.VideoMetadata + 5, // 4: flipchat.blob.v1.Blob.audio_metadata:type_name -> flipchat.blob.v1.AudioMetadata + 1, // 5: flipchat.blob.v1.ImageMetadata.format:type_name -> flipchat.blob.v1.ImageMetadata.Format + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_blob_v1_model_proto_init() } +func file_blob_v1_model_proto_init() { + if File_blob_v1_model_proto != nil { + return + } + file_blob_v1_model_proto_msgTypes[0].OneofWrappers = []any{ + (*Blob_ImageMetadata)(nil), + (*Blob_VideoMetadata)(nil), + (*Blob_AudioMetadata)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_blob_v1_model_proto_rawDesc, + NumEnums: 2, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_blob_v1_model_proto_goTypes, + DependencyIndexes: file_blob_v1_model_proto_depIdxs, + EnumInfos: file_blob_v1_model_proto_enumTypes, + MessageInfos: file_blob_v1_model_proto_msgTypes, + }.Build() + File_blob_v1_model_proto = out.File + file_blob_v1_model_proto_rawDesc = nil + file_blob_v1_model_proto_goTypes = nil + file_blob_v1_model_proto_depIdxs = nil +} diff --git a/generated/go/blob/v1/model.pb.validate.go b/generated/go/blob/v1/model.pb.validate.go new file mode 100644 index 0000000..6925b7f --- /dev/null +++ b/generated/go/blob/v1/model.pb.validate.go @@ -0,0 +1,625 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: blob/v1/model.proto + +package blobpb + +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 Blob 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 *Blob) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Blob 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 BlobMultiError, or nil if none found. +func (m *Blob) ValidateAll() error { + return m.validate(true) +} + +func (m *Blob) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for BlobId + + // no validation rules for BlobType + + // no validation rules for OwnerId + + // no validation rules for S3Url + + if all { + switch v := interface{}(m.GetCreatedAt()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BlobValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BlobValidationError{ + 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 BlobValidationError{ + field: "CreatedAt", + reason: "embedded message failed validation", + cause: err, + } + } + } + + switch v := m.Metadata.(type) { + case *Blob_ImageMetadata: + if v == nil { + err := BlobValidationError{ + field: "Metadata", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetImageMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BlobValidationError{ + field: "ImageMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BlobValidationError{ + field: "ImageMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetImageMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BlobValidationError{ + field: "ImageMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Blob_VideoMetadata: + if v == nil { + err := BlobValidationError{ + field: "Metadata", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetVideoMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BlobValidationError{ + field: "VideoMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BlobValidationError{ + field: "VideoMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetVideoMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BlobValidationError{ + field: "VideoMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Blob_AudioMetadata: + if v == nil { + err := BlobValidationError{ + field: "Metadata", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAudioMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BlobValidationError{ + field: "AudioMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BlobValidationError{ + field: "AudioMetadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAudioMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BlobValidationError{ + field: "AudioMetadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return BlobMultiError(errors) + } + + return nil +} + +// BlobMultiError is an error wrapping multiple validation errors returned by +// Blob.ValidateAll() if the designated constraints aren't met. +type BlobMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BlobMultiError) 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 BlobMultiError) AllErrors() []error { return m } + +// BlobValidationError is the validation error returned by Blob.Validate if the +// designated constraints aren't met. +type BlobValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BlobValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BlobValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BlobValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BlobValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BlobValidationError) ErrorName() string { return "BlobValidationError" } + +// Error satisfies the builtin error interface +func (e BlobValidationError) 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 %sBlob.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BlobValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BlobValidationError{} + +// Validate checks the field values on ImageMetadata 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 *ImageMetadata) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ImageMetadata 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 ImageMetadataMultiError, or +// nil if none found. +func (m *ImageMetadata) ValidateAll() error { + return m.validate(true) +} + +func (m *ImageMetadata) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Version + + // no validation rules for Width + + // no validation rules for Height + + // no validation rules for Format + + if len(errors) > 0 { + return ImageMetadataMultiError(errors) + } + + return nil +} + +// ImageMetadataMultiError is an error wrapping multiple validation errors +// returned by ImageMetadata.ValidateAll() if the designated constraints +// aren't met. +type ImageMetadataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ImageMetadataMultiError) 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 ImageMetadataMultiError) AllErrors() []error { return m } + +// ImageMetadataValidationError is the validation error returned by +// ImageMetadata.Validate if the designated constraints aren't met. +type ImageMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ImageMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ImageMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ImageMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ImageMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ImageMetadataValidationError) ErrorName() string { return "ImageMetadataValidationError" } + +// Error satisfies the builtin error interface +func (e ImageMetadataValidationError) 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 %sImageMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ImageMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ImageMetadataValidationError{} + +// Validate checks the field values on VideoMetadata 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 *VideoMetadata) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on VideoMetadata 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 VideoMetadataMultiError, or +// nil if none found. +func (m *VideoMetadata) ValidateAll() error { + return m.validate(true) +} + +func (m *VideoMetadata) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Version + + // no validation rules for Width + + // no validation rules for Height + + // no validation rules for DurationSeconds + + // no validation rules for FrameRate + + // no validation rules for Codec + + if len(errors) > 0 { + return VideoMetadataMultiError(errors) + } + + return nil +} + +// VideoMetadataMultiError is an error wrapping multiple validation errors +// returned by VideoMetadata.ValidateAll() if the designated constraints +// aren't met. +type VideoMetadataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m VideoMetadataMultiError) 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 VideoMetadataMultiError) AllErrors() []error { return m } + +// VideoMetadataValidationError is the validation error returned by +// VideoMetadata.Validate if the designated constraints aren't met. +type VideoMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e VideoMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e VideoMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e VideoMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e VideoMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e VideoMetadataValidationError) ErrorName() string { return "VideoMetadataValidationError" } + +// Error satisfies the builtin error interface +func (e VideoMetadataValidationError) 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 %sVideoMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = VideoMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = VideoMetadataValidationError{} + +// Validate checks the field values on AudioMetadata 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 *AudioMetadata) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AudioMetadata 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 AudioMetadataMultiError, or +// nil if none found. +func (m *AudioMetadata) ValidateAll() error { + return m.validate(true) +} + +func (m *AudioMetadata) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Version + + // no validation rules for DurationSeconds + + // no validation rules for Codec + + if len(errors) > 0 { + return AudioMetadataMultiError(errors) + } + + return nil +} + +// AudioMetadataMultiError is an error wrapping multiple validation errors +// returned by AudioMetadata.ValidateAll() if the designated constraints +// aren't met. +type AudioMetadataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AudioMetadataMultiError) 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 AudioMetadataMultiError) AllErrors() []error { return m } + +// AudioMetadataValidationError is the validation error returned by +// AudioMetadata.Validate if the designated constraints aren't met. +type AudioMetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AudioMetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AudioMetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AudioMetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AudioMetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AudioMetadataValidationError) ErrorName() string { return "AudioMetadataValidationError" } + +// Error satisfies the builtin error interface +func (e AudioMetadataValidationError) 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 %sAudioMetadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AudioMetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AudioMetadataValidationError{} diff --git a/proto/blob/v1/blob_service.proto b/proto/blob/v1/blob_service.proto new file mode 100644 index 0000000..de285fc --- /dev/null +++ b/proto/blob/v1/blob_service.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; + +package flipchat.blob.v1; + +option go_package = "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1;blobpb"; +option java_package = "com.codeinc.flipchat.gen.blob.v1"; +option objc_class_prefix = "FCPBBlobV1"; + +import "blob/v1/model.proto"; + +service BlobService { + // Request for a smaller/single-shot upload + rpc Upload (UploadRequest) returns (UploadResponse); + + // Placeholder for future work + // - helps with large files that exceed gRPC message limits + // - avoids high memory usage by streaming in chunks + // - can allow better upload progress tracking + // - can *maybe* support live audio/video + rpc UploadChunked (stream UploadChunk) returns (UploadChunkedResponse); + + // Get the metadata for a previously uploaded blob + rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); +} + +// Request for a smaller/single-shot upload +message UploadRequest { + string owner_id = 1; + BlobType blob_type = 2; + bytes raw_data = 3; +} + +// Single-shot upload response +message UploadResponse { + Blob blob = 1; +} + +// Client-streaming chunk for large uploads +message UploadChunk { + string owner_id = 1; + BlobType blob_type = 2; + + bytes data = 3; +} + +// Chunked upload final response +message UploadChunkedResponse { + Blob blob = 1; +} + +// Retrieve existing blob info +message GetInfoRequest { + bytes blob_id = 1; +} + +message GetInfoResponse { + Blob blob = 1; +} diff --git a/proto/blob/v1/model.proto b/proto/blob/v1/model.proto new file mode 100644 index 0000000..3bf1ec3 --- /dev/null +++ b/proto/blob/v1/model.proto @@ -0,0 +1,70 @@ +syntax = "proto3"; + +package flipchat.blob.v1; + +option go_package = "github.com/code-payments/flipchat-protobuf-api/generated/go/blob/v1;blobpb"; +option java_package = "com.codeinc.flipchat.gen.blob.v1"; +option objc_class_prefix = "FCPBBlobV1"; + +import "google/protobuf/timestamp.proto"; + +enum BlobType { + BLOB_TYPE_UNKNOWN = 0; + BLOB_TYPE_IMAGE = 1; + BLOB_TYPE_VIDEO = 2; + BLOB_TYPE_AUDIO = 3; + + // Additional types like can be added as needed +} + +// Common blob info returned in responses +message Blob { + bytes blob_id = 1; + BlobType blob_type = 2; + + string owner_id = 3; + string s3_url = 4; + + google.protobuf.Timestamp created_at = 5; + + oneof metadata { + ImageMetadata image_metadata = 6; + VideoMetadata video_metadata = 7; + AudioMetadata audio_metadata = 8; + } +} + +message ImageMetadata { + int32 version = 1; + + int32 width = 2; + int32 height = 3; + + enum Format { + IMAGE_FORMAT_UNKNOWN = 0; + IMAGE_FORMAT_JPEG = 1; + IMAGE_FORMAT_PNG = 2; + IMAGE_FORMAT_GIF = 3; + IMAGE_FORMAT_WEBP = 4; + } + Format format = 4; +} + +message VideoMetadata { + int32 version = 1; + + int32 width = 2; + int32 height = 3; + + int32 duration_seconds = 4; + float frame_rate = 5; + string codec = 6; +} + +message AudioMetadata { + int32 version = 1; + + int32 duration_seconds = 2; + string codec = 3; +} + From 7adaf401d40434d7636353b6ab427a3662c7529f Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Tue, 21 Jan 2025 17:22:23 -0500 Subject: [PATCH 2/7] blob: upgraded id values to typed ones --- generated/go/blob/v1/blob_service.pb.go | 187 ++++++------ .../go/blob/v1/blob_service.pb.validate.go | 87 +++++- generated/go/blob/v1/model.pb.go | 64 ++-- generated/go/blob/v1/model.pb.validate.go | 58 +++- generated/go/common/v1/common.pb.go | 287 ++++++++++-------- generated/go/common/v1/common.pb.validate.go | 109 +++++++ proto/blob/v1/blob_service.proto | 7 +- proto/blob/v1/model.proto | 5 +- proto/common/v1/common.proto | 6 + 9 files changed, 567 insertions(+), 243 deletions(-) diff --git a/generated/go/blob/v1/blob_service.pb.go b/generated/go/blob/v1/blob_service.pb.go index c84c2c2..daed273 100644 --- a/generated/go/blob/v1/blob_service.pb.go +++ b/generated/go/blob/v1/blob_service.pb.go @@ -7,6 +7,7 @@ package blobpb import ( + v1 "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -26,9 +27,9 @@ type UploadRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OwnerId string `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` - BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` - RawData []byte `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` + OwnerId *v1.UserId `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` + RawData []byte `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` } func (x *UploadRequest) Reset() { @@ -61,11 +62,11 @@ func (*UploadRequest) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{0} } -func (x *UploadRequest) GetOwnerId() string { +func (x *UploadRequest) GetOwnerId() *v1.UserId { if x != nil { return x.OwnerId } - return "" + return nil } func (x *UploadRequest) GetBlobType() BlobType { @@ -134,9 +135,9 @@ type UploadChunk struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OwnerId string `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` - BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + OwnerId *v1.UserId `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` } func (x *UploadChunk) Reset() { @@ -169,11 +170,11 @@ func (*UploadChunk) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{2} } -func (x *UploadChunk) GetOwnerId() string { +func (x *UploadChunk) GetOwnerId() *v1.UserId { if x != nil { return x.OwnerId } - return "" + return nil } func (x *UploadChunk) GetBlobType() BlobType { @@ -242,7 +243,7 @@ type GetInfoRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BlobId []byte `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` + BlobId *v1.BlobId `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` } func (x *GetInfoRequest) Reset() { @@ -275,7 +276,7 @@ func (*GetInfoRequest) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{4} } -func (x *GetInfoRequest) GetBlobId() []byte { +func (x *GetInfoRequest) GetBlobId() *v1.BlobId { if x != nil { return x.BlobId } @@ -332,64 +333,71 @@ var File_blob_v1_blob_service_proto protoreflect.FileDescriptor var file_blob_v1_blob_service_proto_rawDesc = []byte{ 0x0a, 0x1a, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x66, 0x6c, - 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x13, - 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x7e, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, - 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, - 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x61, 0x77, 0x44, - 0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, - 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, - 0x62, 0x22, 0x75, 0x0a, 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, - 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, - 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x15, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x29, 0x0a, - 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x17, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, - 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, - 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0x85, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x12, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, - 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, - 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, - 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, - 0x68, 0x75, 0x6e, 0x6b, 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, - 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, - 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x66, 0x6c, 0x69, + 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x16, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x0d, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, + 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, + 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, + 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x91, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, + 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, + 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x15, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, + 0x45, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, + 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, + 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, + 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0x85, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, + 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, + 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, + 0x6e, 0x6b, 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, + 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x4e, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, - 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, - 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, - 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, - 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, - 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x7b, 0x0a, + 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, + 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, + 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, + 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, + 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -412,26 +420,31 @@ var file_blob_v1_blob_service_proto_goTypes = []any{ (*UploadChunkedResponse)(nil), // 3: flipchat.blob.v1.UploadChunkedResponse (*GetInfoRequest)(nil), // 4: flipchat.blob.v1.GetInfoRequest (*GetInfoResponse)(nil), // 5: flipchat.blob.v1.GetInfoResponse - (BlobType)(0), // 6: flipchat.blob.v1.BlobType - (*Blob)(nil), // 7: flipchat.blob.v1.Blob + (*v1.UserId)(nil), // 6: flipchat.common.v1.UserId + (BlobType)(0), // 7: flipchat.blob.v1.BlobType + (*Blob)(nil), // 8: flipchat.blob.v1.Blob + (*v1.BlobId)(nil), // 9: flipchat.common.v1.BlobId } var file_blob_v1_blob_service_proto_depIdxs = []int32{ - 6, // 0: flipchat.blob.v1.UploadRequest.blob_type:type_name -> flipchat.blob.v1.BlobType - 7, // 1: flipchat.blob.v1.UploadResponse.blob:type_name -> flipchat.blob.v1.Blob - 6, // 2: flipchat.blob.v1.UploadChunk.blob_type:type_name -> flipchat.blob.v1.BlobType - 7, // 3: flipchat.blob.v1.UploadChunkedResponse.blob:type_name -> flipchat.blob.v1.Blob - 7, // 4: flipchat.blob.v1.GetInfoResponse.blob:type_name -> flipchat.blob.v1.Blob - 0, // 5: flipchat.blob.v1.BlobService.Upload:input_type -> flipchat.blob.v1.UploadRequest - 2, // 6: flipchat.blob.v1.BlobService.UploadChunked:input_type -> flipchat.blob.v1.UploadChunk - 4, // 7: flipchat.blob.v1.BlobService.GetInfo:input_type -> flipchat.blob.v1.GetInfoRequest - 1, // 8: flipchat.blob.v1.BlobService.Upload:output_type -> flipchat.blob.v1.UploadResponse - 3, // 9: flipchat.blob.v1.BlobService.UploadChunked:output_type -> flipchat.blob.v1.UploadChunkedResponse - 5, // 10: flipchat.blob.v1.BlobService.GetInfo:output_type -> flipchat.blob.v1.GetInfoResponse - 8, // [8:11] is the sub-list for method output_type - 5, // [5:8] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 6, // 0: flipchat.blob.v1.UploadRequest.owner_id:type_name -> flipchat.common.v1.UserId + 7, // 1: flipchat.blob.v1.UploadRequest.blob_type:type_name -> flipchat.blob.v1.BlobType + 8, // 2: flipchat.blob.v1.UploadResponse.blob:type_name -> flipchat.blob.v1.Blob + 6, // 3: flipchat.blob.v1.UploadChunk.owner_id:type_name -> flipchat.common.v1.UserId + 7, // 4: flipchat.blob.v1.UploadChunk.blob_type:type_name -> flipchat.blob.v1.BlobType + 8, // 5: flipchat.blob.v1.UploadChunkedResponse.blob:type_name -> flipchat.blob.v1.Blob + 9, // 6: flipchat.blob.v1.GetInfoRequest.blob_id:type_name -> flipchat.common.v1.BlobId + 8, // 7: flipchat.blob.v1.GetInfoResponse.blob:type_name -> flipchat.blob.v1.Blob + 0, // 8: flipchat.blob.v1.BlobService.Upload:input_type -> flipchat.blob.v1.UploadRequest + 2, // 9: flipchat.blob.v1.BlobService.UploadChunked:input_type -> flipchat.blob.v1.UploadChunk + 4, // 10: flipchat.blob.v1.BlobService.GetInfo:input_type -> flipchat.blob.v1.GetInfoRequest + 1, // 11: flipchat.blob.v1.BlobService.Upload:output_type -> flipchat.blob.v1.UploadResponse + 3, // 12: flipchat.blob.v1.BlobService.UploadChunked:output_type -> flipchat.blob.v1.UploadChunkedResponse + 5, // 13: flipchat.blob.v1.BlobService.GetInfo:output_type -> flipchat.blob.v1.GetInfoResponse + 11, // [11:14] is the sub-list for method output_type + 8, // [8:11] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_blob_v1_blob_service_proto_init() } diff --git a/generated/go/blob/v1/blob_service.pb.validate.go b/generated/go/blob/v1/blob_service.pb.validate.go index 72d75f9..e902651 100644 --- a/generated/go/blob/v1/blob_service.pb.validate.go +++ b/generated/go/blob/v1/blob_service.pb.validate.go @@ -57,7 +57,34 @@ func (m *UploadRequest) validate(all bool) error { var errors []error - // no validation rules for OwnerId + if all { + switch v := interface{}(m.GetOwnerId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UploadRequestValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadRequestValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOwnerId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UploadRequestValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + } + } + } // no validation rules for BlobType @@ -292,7 +319,34 @@ func (m *UploadChunk) validate(all bool) error { var errors []error - // no validation rules for OwnerId + if all { + switch v := interface{}(m.GetOwnerId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UploadChunkValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadChunkValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOwnerId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UploadChunkValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + } + } + } // no validation rules for BlobType @@ -528,7 +582,34 @@ func (m *GetInfoRequest) validate(all bool) error { var errors []error - // no validation rules for BlobId + if all { + switch v := interface{}(m.GetBlobId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetInfoRequestValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetInfoRequestValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetInfoRequestValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + } + } + } if len(errors) > 0 { return GetInfoRequestMultiError(errors) diff --git a/generated/go/blob/v1/model.pb.go b/generated/go/blob/v1/model.pb.go index c440bd6..43fe3f2 100644 --- a/generated/go/blob/v1/model.pb.go +++ b/generated/go/blob/v1/model.pb.go @@ -7,6 +7,7 @@ package blobpb import ( + v1 "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -134,9 +135,9 @@ type Blob struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - BlobId []byte `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` + BlobId *v1.BlobId `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` - OwnerId string `protobuf:"bytes,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` + OwnerId *v1.UserId `protobuf:"bytes,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` S3Url string `protobuf:"bytes,4,opt,name=s3_url,json=s3Url,proto3" json:"s3_url,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Types that are assignable to Metadata: @@ -177,7 +178,7 @@ func (*Blob) Descriptor() ([]byte, []int) { return file_blob_v1_model_proto_rawDescGZIP(), []int{0} } -func (x *Blob) GetBlobId() []byte { +func (x *Blob) GetBlobId() *v1.BlobId { if x != nil { return x.BlobId } @@ -191,11 +192,11 @@ func (x *Blob) GetBlobType() BlobType { return BlobType_BLOB_TYPE_UNKNOWN } -func (x *Blob) GetOwnerId() string { +func (x *Blob) GetOwnerId() *v1.UserId { if x != nil { return x.OwnerId } - return "" + return nil } func (x *Blob) GetS3Url() string { @@ -482,16 +483,21 @@ var File_blob_v1_model_proto protoreflect.FileDescriptor var file_blob_v1_model_proto_rawDesc = []byte{ 0x0a, 0x13, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 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, 0xaf, 0x03, 0x0a, 0x04, 0x42, 0x6c, 0x6f, - 0x62, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, - 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, + 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 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, 0xe7, 0x03, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, + 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, + 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, + 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x33, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x33, 0x55, 0x72, 0x6c, 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, @@ -585,20 +591,24 @@ var file_blob_v1_model_proto_goTypes = []any{ (*ImageMetadata)(nil), // 3: flipchat.blob.v1.ImageMetadata (*VideoMetadata)(nil), // 4: flipchat.blob.v1.VideoMetadata (*AudioMetadata)(nil), // 5: flipchat.blob.v1.AudioMetadata - (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*v1.BlobId)(nil), // 6: flipchat.common.v1.BlobId + (*v1.UserId)(nil), // 7: flipchat.common.v1.UserId + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp } var file_blob_v1_model_proto_depIdxs = []int32{ - 0, // 0: flipchat.blob.v1.Blob.blob_type:type_name -> flipchat.blob.v1.BlobType - 6, // 1: flipchat.blob.v1.Blob.created_at:type_name -> google.protobuf.Timestamp - 3, // 2: flipchat.blob.v1.Blob.image_metadata:type_name -> flipchat.blob.v1.ImageMetadata - 4, // 3: flipchat.blob.v1.Blob.video_metadata:type_name -> flipchat.blob.v1.VideoMetadata - 5, // 4: flipchat.blob.v1.Blob.audio_metadata:type_name -> flipchat.blob.v1.AudioMetadata - 1, // 5: flipchat.blob.v1.ImageMetadata.format:type_name -> flipchat.blob.v1.ImageMetadata.Format - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 6, // 0: flipchat.blob.v1.Blob.blob_id:type_name -> flipchat.common.v1.BlobId + 0, // 1: flipchat.blob.v1.Blob.blob_type:type_name -> flipchat.blob.v1.BlobType + 7, // 2: flipchat.blob.v1.Blob.owner_id:type_name -> flipchat.common.v1.UserId + 8, // 3: flipchat.blob.v1.Blob.created_at:type_name -> google.protobuf.Timestamp + 3, // 4: flipchat.blob.v1.Blob.image_metadata:type_name -> flipchat.blob.v1.ImageMetadata + 4, // 5: flipchat.blob.v1.Blob.video_metadata:type_name -> flipchat.blob.v1.VideoMetadata + 5, // 6: flipchat.blob.v1.Blob.audio_metadata:type_name -> flipchat.blob.v1.AudioMetadata + 1, // 7: flipchat.blob.v1.ImageMetadata.format:type_name -> flipchat.blob.v1.ImageMetadata.Format + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_blob_v1_model_proto_init() } diff --git a/generated/go/blob/v1/model.pb.validate.go b/generated/go/blob/v1/model.pb.validate.go index 6925b7f..b2acefa 100644 --- a/generated/go/blob/v1/model.pb.validate.go +++ b/generated/go/blob/v1/model.pb.validate.go @@ -56,11 +56,65 @@ func (m *Blob) validate(all bool) error { var errors []error - // no validation rules for BlobId + if all { + switch v := interface{}(m.GetBlobId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BlobValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BlobValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BlobValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + } + } + } // no validation rules for BlobType - // no validation rules for OwnerId + if all { + switch v := interface{}(m.GetOwnerId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BlobValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BlobValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOwnerId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BlobValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + } + } + } // no validation rules for S3Url diff --git a/generated/go/common/v1/common.pb.go b/generated/go/common/v1/common.pb.go index 42ad16f..8c0d292 100644 --- a/generated/go/common/v1/common.pb.go +++ b/generated/go/common/v1/common.pb.go @@ -115,7 +115,7 @@ func (x QueryOptions_Order) Number() protoreflect.EnumNumber { // Deprecated: Use QueryOptions_Order.Descriptor instead. func (QueryOptions_Order) EnumDescriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{12, 0} + return file_common_v1_common_proto_rawDescGZIP(), []int{13, 0} } // Auth provides an authentication information for RPCs/messages. @@ -280,6 +280,51 @@ func (x *ChatId) GetValue() []byte { return nil } +type BlobId struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *BlobId) Reset() { + *x = BlobId{} + mi := &file_common_v1_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BlobId) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlobId) ProtoMessage() {} + +func (x *BlobId) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_common_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlobId.ProtoReflect.Descriptor instead. +func (*BlobId) Descriptor() ([]byte, []int) { + return file_common_v1_common_proto_rawDescGZIP(), []int{3} +} + +func (x *BlobId) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + // AppInstallId is a unque ID tied to a client app installation. It does not // identify a device. Value should remain private and not be shared across // installs. @@ -293,7 +338,7 @@ type AppInstallId struct { func (x *AppInstallId) Reset() { *x = AppInstallId{} - mi := &file_common_v1_common_proto_msgTypes[3] + mi := &file_common_v1_common_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -305,7 +350,7 @@ func (x *AppInstallId) String() string { func (*AppInstallId) ProtoMessage() {} func (x *AppInstallId) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[3] + mi := &file_common_v1_common_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -318,7 +363,7 @@ func (x *AppInstallId) ProtoReflect() protoreflect.Message { // Deprecated: Use AppInstallId.ProtoReflect.Descriptor instead. func (*AppInstallId) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{3} + return file_common_v1_common_proto_rawDescGZIP(), []int{4} } func (x *AppInstallId) GetValue() string { @@ -339,7 +384,7 @@ type Locale struct { func (x *Locale) Reset() { *x = Locale{} - mi := &file_common_v1_common_proto_msgTypes[4] + mi := &file_common_v1_common_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -351,7 +396,7 @@ func (x *Locale) String() string { func (*Locale) ProtoMessage() {} func (x *Locale) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[4] + mi := &file_common_v1_common_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -364,7 +409,7 @@ func (x *Locale) ProtoReflect() protoreflect.Message { // Deprecated: Use Locale.ProtoReflect.Descriptor instead. func (*Locale) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{4} + return file_common_v1_common_proto_rawDescGZIP(), []int{5} } func (x *Locale) GetValue() string { @@ -384,7 +429,7 @@ type PublicKey struct { func (x *PublicKey) Reset() { *x = PublicKey{} - mi := &file_common_v1_common_proto_msgTypes[5] + mi := &file_common_v1_common_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -396,7 +441,7 @@ func (x *PublicKey) String() string { func (*PublicKey) ProtoMessage() {} func (x *PublicKey) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[5] + mi := &file_common_v1_common_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -409,7 +454,7 @@ func (x *PublicKey) ProtoReflect() protoreflect.Message { // Deprecated: Use PublicKey.ProtoReflect.Descriptor instead. func (*PublicKey) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{5} + return file_common_v1_common_proto_rawDescGZIP(), []int{6} } func (x *PublicKey) GetValue() []byte { @@ -429,7 +474,7 @@ type IntentId struct { func (x *IntentId) Reset() { *x = IntentId{} - mi := &file_common_v1_common_proto_msgTypes[6] + mi := &file_common_v1_common_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -441,7 +486,7 @@ func (x *IntentId) String() string { func (*IntentId) ProtoMessage() {} func (x *IntentId) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[6] + mi := &file_common_v1_common_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -454,7 +499,7 @@ func (x *IntentId) ProtoReflect() protoreflect.Message { // Deprecated: Use IntentId.ProtoReflect.Descriptor instead. func (*IntentId) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{6} + return file_common_v1_common_proto_rawDescGZIP(), []int{7} } func (x *IntentId) GetValue() []byte { @@ -474,7 +519,7 @@ type Signature struct { func (x *Signature) Reset() { *x = Signature{} - mi := &file_common_v1_common_proto_msgTypes[7] + mi := &file_common_v1_common_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -486,7 +531,7 @@ func (x *Signature) String() string { func (*Signature) ProtoMessage() {} func (x *Signature) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[7] + mi := &file_common_v1_common_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -499,7 +544,7 @@ func (x *Signature) ProtoReflect() protoreflect.Message { // Deprecated: Use Signature.ProtoReflect.Descriptor instead. func (*Signature) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{7} + return file_common_v1_common_proto_rawDescGZIP(), []int{8} } func (x *Signature) GetValue() []byte { @@ -519,7 +564,7 @@ type PaymentAmount struct { func (x *PaymentAmount) Reset() { *x = PaymentAmount{} - mi := &file_common_v1_common_proto_msgTypes[8] + mi := &file_common_v1_common_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -531,7 +576,7 @@ func (x *PaymentAmount) String() string { func (*PaymentAmount) ProtoMessage() {} func (x *PaymentAmount) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[8] + mi := &file_common_v1_common_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -544,7 +589,7 @@ func (x *PaymentAmount) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentAmount.ProtoReflect.Descriptor instead. func (*PaymentAmount) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{8} + return file_common_v1_common_proto_rawDescGZIP(), []int{9} } func (x *PaymentAmount) GetQuarks() uint64 { @@ -568,7 +613,7 @@ type ServerPing struct { func (x *ServerPing) Reset() { *x = ServerPing{} - mi := &file_common_v1_common_proto_msgTypes[9] + mi := &file_common_v1_common_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -580,7 +625,7 @@ func (x *ServerPing) String() string { func (*ServerPing) ProtoMessage() {} func (x *ServerPing) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[9] + mi := &file_common_v1_common_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -593,7 +638,7 @@ func (x *ServerPing) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerPing.ProtoReflect.Descriptor instead. func (*ServerPing) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{9} + return file_common_v1_common_proto_rawDescGZIP(), []int{10} } func (x *ServerPing) GetTimestamp() *timestamppb.Timestamp { @@ -622,7 +667,7 @@ type ClientPong struct { func (x *ClientPong) Reset() { *x = ClientPong{} - mi := &file_common_v1_common_proto_msgTypes[10] + mi := &file_common_v1_common_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -634,7 +679,7 @@ func (x *ClientPong) String() string { func (*ClientPong) ProtoMessage() {} func (x *ClientPong) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[10] + mi := &file_common_v1_common_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -647,7 +692,7 @@ func (x *ClientPong) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPong.ProtoReflect.Descriptor instead. func (*ClientPong) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{10} + return file_common_v1_common_proto_rawDescGZIP(), []int{11} } func (x *ClientPong) GetTimestamp() *timestamppb.Timestamp { @@ -671,7 +716,7 @@ type PagingToken struct { func (x *PagingToken) Reset() { *x = PagingToken{} - mi := &file_common_v1_common_proto_msgTypes[11] + mi := &file_common_v1_common_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -683,7 +728,7 @@ func (x *PagingToken) String() string { func (*PagingToken) ProtoMessage() {} func (x *PagingToken) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[11] + mi := &file_common_v1_common_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -696,7 +741,7 @@ func (x *PagingToken) ProtoReflect() protoreflect.Message { // Deprecated: Use PagingToken.ProtoReflect.Descriptor instead. func (*PagingToken) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{11} + return file_common_v1_common_proto_rawDescGZIP(), []int{12} } func (x *PagingToken) GetValue() []byte { @@ -724,7 +769,7 @@ type QueryOptions struct { func (x *QueryOptions) Reset() { *x = QueryOptions{} - mi := &file_common_v1_common_proto_msgTypes[12] + mi := &file_common_v1_common_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -736,7 +781,7 @@ func (x *QueryOptions) String() string { func (*QueryOptions) ProtoMessage() {} func (x *QueryOptions) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[12] + mi := &file_common_v1_common_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -749,7 +794,7 @@ func (x *QueryOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryOptions.ProtoReflect.Descriptor instead. func (*QueryOptions) Descriptor() ([]byte, []int) { - return file_common_v1_common_proto_rawDescGZIP(), []int{12} + return file_common_v1_common_proto_rawDescGZIP(), []int{13} } func (x *QueryOptions) GetPageSize() int64 { @@ -788,7 +833,7 @@ type Auth_KeyPair struct { func (x *Auth_KeyPair) Reset() { *x = Auth_KeyPair{} - mi := &file_common_v1_common_proto_msgTypes[13] + mi := &file_common_v1_common_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -800,7 +845,7 @@ func (x *Auth_KeyPair) String() string { func (*Auth_KeyPair) ProtoMessage() {} func (x *Auth_KeyPair) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[13] + mi := &file_common_v1_common_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -861,70 +906,73 @@ var file_common_v1_common_proto_rawDesc = []byte{ 0x10, 0x01, 0x18, 0x20, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x0a, 0x06, 0x43, 0x68, 0x61, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, 0x10, 0x18, 0x20, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x30, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, - 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x06, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x65, 0x12, 0x5b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x45, 0xfa, 0x42, 0x42, 0x72, 0x40, 0x32, 0x3e, 0x5e, 0x5b, 0x41, 0x2d, 0x5a, 0x61, - 0x2d, 0x7a, 0x5d, 0x7b, 0x32, 0x2c, 0x34, 0x7d, 0x28, 0x5b, 0x5f, 0x2d, 0x5d, 0x5b, 0x41, 0x2d, - 0x5a, 0x61, 0x2d, 0x7a, 0x5d, 0x7b, 0x34, 0x7d, 0x29, 0x3f, 0x28, 0x5b, 0x5f, 0x2d, 0x5d, 0x28, - 0x5b, 0x41, 0x2d, 0x5a, 0x61, 0x2d, 0x7a, 0x5d, 0x7b, 0x32, 0x7d, 0x7c, 0x5b, 0x30, 0x2d, 0x39, - 0x5d, 0x7b, 0x33, 0x7d, 0x29, 0x29, 0x3f, 0x24, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x2c, 0x0a, 0x09, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, - 0x7a, 0x04, 0x10, 0x20, 0x18, 0x20, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2b, 0x0a, - 0x08, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, - 0x20, 0x18, 0x20, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x09, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, 0x40, 0x18, - 0x40, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x30, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6d, - 0x65, 0x6e, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x71, 0x75, 0x61, - 0x72, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, - 0x20, 0x00, 0x52, 0x06, 0x71, 0x75, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x0a, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 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, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, - 0x08, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x42, 0x0a, - 0x0a, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0xaa, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x70, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x61, - 0x79, 0x22, 0x50, 0x0a, 0x0a, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6e, 0x67, 0x12, - 0x42, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 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, 0x08, - 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x22, 0x2f, 0x0a, 0x0b, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x7a, 0x05, 0x10, 0x01, 0x18, 0x80, 0x01, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc9, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x42, 0x0a, 0x0c, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, - 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, - 0x67, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, - 0x03, 0x41, 0x53, 0x43, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, - 0x2a, 0x2e, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x50, 0x50, - 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, - 0x42, 0x82, 0x01, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, - 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0xa2, 0x02, 0x0b, 0x46, 0x50, 0x42, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x0a, 0x06, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, + 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, 0x01, 0x18, 0x20, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x30, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x49, + 0x64, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x02, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x06, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x5b, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x45, 0xfa, 0x42, + 0x42, 0x72, 0x40, 0x32, 0x3e, 0x5e, 0x5b, 0x41, 0x2d, 0x5a, 0x61, 0x2d, 0x7a, 0x5d, 0x7b, 0x32, + 0x2c, 0x34, 0x7d, 0x28, 0x5b, 0x5f, 0x2d, 0x5d, 0x5b, 0x41, 0x2d, 0x5a, 0x61, 0x2d, 0x7a, 0x5d, + 0x7b, 0x34, 0x7d, 0x29, 0x3f, 0x28, 0x5b, 0x5f, 0x2d, 0x5d, 0x28, 0x5b, 0x41, 0x2d, 0x5a, 0x61, + 0x2d, 0x7a, 0x5d, 0x7b, 0x32, 0x7d, 0x7c, 0x5b, 0x30, 0x2d, 0x39, 0x5d, 0x7b, 0x33, 0x7d, 0x29, + 0x29, 0x3f, 0x24, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x09, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, 0x20, 0x18, + 0x20, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2b, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, 0x20, 0x18, 0x20, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x7a, 0x04, 0x10, 0x40, 0x18, 0x40, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0x30, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x71, 0x75, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x06, 0x71, + 0x75, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x50, 0x69, 0x6e, 0x67, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 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, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, 0x02, 0x08, 0x01, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x42, 0x0a, 0x0a, 0x70, 0x69, 0x6e, 0x67, + 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0xaa, 0x01, 0x02, 0x08, + 0x01, 0x52, 0x09, 0x70, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x22, 0x50, 0x0a, 0x0a, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6e, 0x67, 0x12, 0x42, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 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, 0x08, 0xfa, 0x42, 0x05, 0xb2, 0x01, + 0x02, 0x08, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x2f, + 0x0a, 0x0b, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0a, 0xfa, 0x42, + 0x07, 0x7a, 0x05, 0x10, 0x01, 0x18, 0x80, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0xc9, 0x01, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x42, 0x0a, + 0x0c, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x3c, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, + 0x1a, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x53, 0x43, 0x10, + 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, 0x2a, 0x2e, 0x0a, 0x08, 0x50, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x50, 0x50, 0x4c, 0x45, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x82, 0x01, 0x0a, 0x22, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, + 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x70, 0x62, 0xa2, 0x02, 0x0b, 0x46, 0x50, 0x42, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -940,36 +988,37 @@ func file_common_v1_common_proto_rawDescGZIP() []byte { } var file_common_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_common_v1_common_proto_goTypes = []any{ (Platform)(0), // 0: flipchat.common.v1.Platform (QueryOptions_Order)(0), // 1: flipchat.common.v1.QueryOptions.Order (*Auth)(nil), // 2: flipchat.common.v1.Auth (*UserId)(nil), // 3: flipchat.common.v1.UserId (*ChatId)(nil), // 4: flipchat.common.v1.ChatId - (*AppInstallId)(nil), // 5: flipchat.common.v1.AppInstallId - (*Locale)(nil), // 6: flipchat.common.v1.Locale - (*PublicKey)(nil), // 7: flipchat.common.v1.PublicKey - (*IntentId)(nil), // 8: flipchat.common.v1.IntentId - (*Signature)(nil), // 9: flipchat.common.v1.Signature - (*PaymentAmount)(nil), // 10: flipchat.common.v1.PaymentAmount - (*ServerPing)(nil), // 11: flipchat.common.v1.ServerPing - (*ClientPong)(nil), // 12: flipchat.common.v1.ClientPong - (*PagingToken)(nil), // 13: flipchat.common.v1.PagingToken - (*QueryOptions)(nil), // 14: flipchat.common.v1.QueryOptions - (*Auth_KeyPair)(nil), // 15: flipchat.common.v1.Auth.KeyPair - (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 17: google.protobuf.Duration + (*BlobId)(nil), // 5: flipchat.common.v1.BlobId + (*AppInstallId)(nil), // 6: flipchat.common.v1.AppInstallId + (*Locale)(nil), // 7: flipchat.common.v1.Locale + (*PublicKey)(nil), // 8: flipchat.common.v1.PublicKey + (*IntentId)(nil), // 9: flipchat.common.v1.IntentId + (*Signature)(nil), // 10: flipchat.common.v1.Signature + (*PaymentAmount)(nil), // 11: flipchat.common.v1.PaymentAmount + (*ServerPing)(nil), // 12: flipchat.common.v1.ServerPing + (*ClientPong)(nil), // 13: flipchat.common.v1.ClientPong + (*PagingToken)(nil), // 14: flipchat.common.v1.PagingToken + (*QueryOptions)(nil), // 15: flipchat.common.v1.QueryOptions + (*Auth_KeyPair)(nil), // 16: flipchat.common.v1.Auth.KeyPair + (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 18: google.protobuf.Duration } var file_common_v1_common_proto_depIdxs = []int32{ - 15, // 0: flipchat.common.v1.Auth.key_pair:type_name -> flipchat.common.v1.Auth.KeyPair - 16, // 1: flipchat.common.v1.ServerPing.timestamp:type_name -> google.protobuf.Timestamp - 17, // 2: flipchat.common.v1.ServerPing.ping_delay:type_name -> google.protobuf.Duration - 16, // 3: flipchat.common.v1.ClientPong.timestamp:type_name -> google.protobuf.Timestamp - 13, // 4: flipchat.common.v1.QueryOptions.paging_token:type_name -> flipchat.common.v1.PagingToken + 16, // 0: flipchat.common.v1.Auth.key_pair:type_name -> flipchat.common.v1.Auth.KeyPair + 17, // 1: flipchat.common.v1.ServerPing.timestamp:type_name -> google.protobuf.Timestamp + 18, // 2: flipchat.common.v1.ServerPing.ping_delay:type_name -> google.protobuf.Duration + 17, // 3: flipchat.common.v1.ClientPong.timestamp:type_name -> google.protobuf.Timestamp + 14, // 4: flipchat.common.v1.QueryOptions.paging_token:type_name -> flipchat.common.v1.PagingToken 1, // 5: flipchat.common.v1.QueryOptions.order:type_name -> flipchat.common.v1.QueryOptions.Order - 7, // 6: flipchat.common.v1.Auth.KeyPair.pub_key:type_name -> flipchat.common.v1.PublicKey - 9, // 7: flipchat.common.v1.Auth.KeyPair.signature:type_name -> flipchat.common.v1.Signature + 8, // 6: flipchat.common.v1.Auth.KeyPair.pub_key:type_name -> flipchat.common.v1.PublicKey + 10, // 7: flipchat.common.v1.Auth.KeyPair.signature:type_name -> flipchat.common.v1.Signature 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name @@ -991,7 +1040,7 @@ func file_common_v1_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_common_v1_common_proto_rawDesc, NumEnums: 2, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 0, }, diff --git a/generated/go/common/v1/common.pb.validate.go b/generated/go/common/v1/common.pb.validate.go index c431332..61b4345 100644 --- a/generated/go/common/v1/common.pb.validate.go +++ b/generated/go/common/v1/common.pb.validate.go @@ -409,6 +409,115 @@ var _ interface { ErrorName() string } = ChatIdValidationError{} +// Validate checks the field values on BlobId 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 *BlobId) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on BlobId 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 BlobIdMultiError, or nil if none found. +func (m *BlobId) ValidateAll() error { + return m.validate(true) +} + +func (m *BlobId) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if l := len(m.GetValue()); l < 1 || l > 32 { + err := BlobIdValidationError{ + field: "Value", + reason: "value length must be between 1 and 32 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return BlobIdMultiError(errors) + } + + return nil +} + +// BlobIdMultiError is an error wrapping multiple validation errors returned by +// BlobId.ValidateAll() if the designated constraints aren't met. +type BlobIdMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m BlobIdMultiError) 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 BlobIdMultiError) AllErrors() []error { return m } + +// BlobIdValidationError is the validation error returned by BlobId.Validate if +// the designated constraints aren't met. +type BlobIdValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e BlobIdValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e BlobIdValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e BlobIdValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e BlobIdValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e BlobIdValidationError) ErrorName() string { return "BlobIdValidationError" } + +// Error satisfies the builtin error interface +func (e BlobIdValidationError) 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 %sBlobId.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = BlobIdValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = BlobIdValidationError{} + // Validate checks the field values on AppInstallId 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. diff --git a/proto/blob/v1/blob_service.proto b/proto/blob/v1/blob_service.proto index de285fc..eeae333 100644 --- a/proto/blob/v1/blob_service.proto +++ b/proto/blob/v1/blob_service.proto @@ -6,6 +6,7 @@ option go_package = "github.com/code-payments/flipchat-protobuf-api/generated/go option java_package = "com.codeinc.flipchat.gen.blob.v1"; option objc_class_prefix = "FCPBBlobV1"; +import "common/v1/common.proto"; import "blob/v1/model.proto"; service BlobService { @@ -25,7 +26,7 @@ service BlobService { // Request for a smaller/single-shot upload message UploadRequest { - string owner_id = 1; + common.v1.UserId owner_id = 1; BlobType blob_type = 2; bytes raw_data = 3; } @@ -37,7 +38,7 @@ message UploadResponse { // Client-streaming chunk for large uploads message UploadChunk { - string owner_id = 1; + common.v1.UserId owner_id = 1; BlobType blob_type = 2; bytes data = 3; @@ -50,7 +51,7 @@ message UploadChunkedResponse { // Retrieve existing blob info message GetInfoRequest { - bytes blob_id = 1; + common.v1.BlobId blob_id = 1; } message GetInfoResponse { diff --git a/proto/blob/v1/model.proto b/proto/blob/v1/model.proto index 3bf1ec3..bec6d2e 100644 --- a/proto/blob/v1/model.proto +++ b/proto/blob/v1/model.proto @@ -6,6 +6,7 @@ option go_package = "github.com/code-payments/flipchat-protobuf-api/generated/go option java_package = "com.codeinc.flipchat.gen.blob.v1"; option objc_class_prefix = "FCPBBlobV1"; +import "common/v1/common.proto"; import "google/protobuf/timestamp.proto"; enum BlobType { @@ -19,10 +20,10 @@ enum BlobType { // Common blob info returned in responses message Blob { - bytes blob_id = 1; + common.v1.BlobId blob_id = 1; BlobType blob_type = 2; - string owner_id = 3; + common.v1.UserId owner_id = 3; string s3_url = 4; google.protobuf.Timestamp created_at = 5; diff --git a/proto/common/v1/common.proto b/proto/common/v1/common.proto index 0d4a8e6..1ddbda9 100644 --- a/proto/common/v1/common.proto +++ b/proto/common/v1/common.proto @@ -48,6 +48,12 @@ message ChatId { }]; } +message BlobId { + bytes value = 1 [(validate.rules).bytes = { + min_len: 1 + max_len: 32 + }]; +} // AppInstallId is a unque ID tied to a client app installation. It does not // identify a device. Value should remain private and not be shared across From 554ab998f0f2629b5f93fb390cddeb9a3dcea6da Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Wed, 22 Jan 2025 14:05:45 -0500 Subject: [PATCH 3/7] blob: cutting out the extra features for now, to revisit later --- generated/go/blob/v1/blob_service.pb.go | 258 +++------ .../go/blob/v1/blob_service.pb.validate.go | 263 --------- generated/go/blob/v1/blob_service_grpc.pb.go | 128 ++--- generated/go/blob/v1/model.pb.go | 483 ++-------------- generated/go/blob/v1/model.pb.validate.go | 527 ++---------------- proto/blob/v1/blob_service.proto | 26 +- proto/blob/v1/model.proto | 42 +- 7 files changed, 193 insertions(+), 1534 deletions(-) diff --git a/generated/go/blob/v1/blob_service.pb.go b/generated/go/blob/v1/blob_service.pb.go index daed273..d904ca3 100644 --- a/generated/go/blob/v1/blob_service.pb.go +++ b/generated/go/blob/v1/blob_service.pb.go @@ -89,7 +89,7 @@ type UploadResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` + Blob *BlobMetadata `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` } func (x *UploadResponse) Reset() { @@ -122,115 +122,7 @@ func (*UploadResponse) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{1} } -func (x *UploadResponse) GetBlob() *Blob { - if x != nil { - return x.Blob - } - return nil -} - -// Client-streaming chunk for large uploads -type UploadChunk struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OwnerId *v1.UserId `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` - BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *UploadChunk) Reset() { - *x = UploadChunk{} - mi := &file_blob_v1_blob_service_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadChunk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadChunk) ProtoMessage() {} - -func (x *UploadChunk) ProtoReflect() protoreflect.Message { - mi := &file_blob_v1_blob_service_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadChunk.ProtoReflect.Descriptor instead. -func (*UploadChunk) Descriptor() ([]byte, []int) { - return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{2} -} - -func (x *UploadChunk) GetOwnerId() *v1.UserId { - if x != nil { - return x.OwnerId - } - return nil -} - -func (x *UploadChunk) GetBlobType() BlobType { - if x != nil { - return x.BlobType - } - return BlobType_BLOB_TYPE_UNKNOWN -} - -func (x *UploadChunk) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -// Chunked upload final response -type UploadChunkedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` -} - -func (x *UploadChunkedResponse) Reset() { - *x = UploadChunkedResponse{} - mi := &file_blob_v1_blob_service_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadChunkedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadChunkedResponse) ProtoMessage() {} - -func (x *UploadChunkedResponse) ProtoReflect() protoreflect.Message { - mi := &file_blob_v1_blob_service_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadChunkedResponse.ProtoReflect.Descriptor instead. -func (*UploadChunkedResponse) Descriptor() ([]byte, []int) { - return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{3} -} - -func (x *UploadChunkedResponse) GetBlob() *Blob { +func (x *UploadResponse) GetBlob() *BlobMetadata { if x != nil { return x.Blob } @@ -248,7 +140,7 @@ type GetInfoRequest struct { func (x *GetInfoRequest) Reset() { *x = GetInfoRequest{} - mi := &file_blob_v1_blob_service_proto_msgTypes[4] + mi := &file_blob_v1_blob_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -260,7 +152,7 @@ func (x *GetInfoRequest) String() string { func (*GetInfoRequest) ProtoMessage() {} func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_blob_v1_blob_service_proto_msgTypes[4] + mi := &file_blob_v1_blob_service_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -273,7 +165,7 @@ func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInfoRequest.ProtoReflect.Descriptor instead. func (*GetInfoRequest) Descriptor() ([]byte, []int) { - return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{4} + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{2} } func (x *GetInfoRequest) GetBlobId() *v1.BlobId { @@ -288,12 +180,12 @@ type GetInfoResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` + Blob *BlobMetadata `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` } func (x *GetInfoResponse) Reset() { *x = GetInfoResponse{} - mi := &file_blob_v1_blob_service_proto_msgTypes[5] + mi := &file_blob_v1_blob_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -305,7 +197,7 @@ func (x *GetInfoResponse) String() string { func (*GetInfoResponse) ProtoMessage() {} func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_blob_v1_blob_service_proto_msgTypes[5] + mi := &file_blob_v1_blob_service_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -318,10 +210,10 @@ func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInfoResponse.ProtoReflect.Descriptor instead. func (*GetInfoResponse) Descriptor() ([]byte, []int) { - return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{5} + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{3} } -func (x *GetInfoResponse) GetBlob() *Blob { +func (x *GetInfoResponse) GetBlob() *BlobMetadata { if x != nil { return x.Blob } @@ -346,58 +238,39 @@ var file_blob_v1_blob_service_proto_rawDesc = []byte{ 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, - 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x22, 0x44, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x62, 0x6c, + 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, - 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x91, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, - 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, - 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, - 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x43, 0x0a, 0x15, 0x55, 0x70, - 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, - 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, - 0x45, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, - 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, - 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, - 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, - 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0x85, 0x02, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x45, + 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, 0x62, + 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0xa3, 0x01, 0x0a, + 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, - 0x6b, 0x65, 0x64, 0x12, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, - 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, - 0x6e, 0x6b, 0x1a, 0x27, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, - 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, - 0x6b, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x4e, 0x0a, - 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, - 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x7b, 0x0a, - 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, - 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, - 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, - 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, - 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, - 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x21, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, + 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, + 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, + 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -412,39 +285,32 @@ func file_blob_v1_blob_service_proto_rawDescGZIP() []byte { return file_blob_v1_blob_service_proto_rawDescData } -var file_blob_v1_blob_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_blob_v1_blob_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_blob_v1_blob_service_proto_goTypes = []any{ - (*UploadRequest)(nil), // 0: flipchat.blob.v1.UploadRequest - (*UploadResponse)(nil), // 1: flipchat.blob.v1.UploadResponse - (*UploadChunk)(nil), // 2: flipchat.blob.v1.UploadChunk - (*UploadChunkedResponse)(nil), // 3: flipchat.blob.v1.UploadChunkedResponse - (*GetInfoRequest)(nil), // 4: flipchat.blob.v1.GetInfoRequest - (*GetInfoResponse)(nil), // 5: flipchat.blob.v1.GetInfoResponse - (*v1.UserId)(nil), // 6: flipchat.common.v1.UserId - (BlobType)(0), // 7: flipchat.blob.v1.BlobType - (*Blob)(nil), // 8: flipchat.blob.v1.Blob - (*v1.BlobId)(nil), // 9: flipchat.common.v1.BlobId + (*UploadRequest)(nil), // 0: flipchat.blob.v1.UploadRequest + (*UploadResponse)(nil), // 1: flipchat.blob.v1.UploadResponse + (*GetInfoRequest)(nil), // 2: flipchat.blob.v1.GetInfoRequest + (*GetInfoResponse)(nil), // 3: flipchat.blob.v1.GetInfoResponse + (*v1.UserId)(nil), // 4: flipchat.common.v1.UserId + (BlobType)(0), // 5: flipchat.blob.v1.BlobType + (*BlobMetadata)(nil), // 6: flipchat.blob.v1.BlobMetadata + (*v1.BlobId)(nil), // 7: flipchat.common.v1.BlobId } var file_blob_v1_blob_service_proto_depIdxs = []int32{ - 6, // 0: flipchat.blob.v1.UploadRequest.owner_id:type_name -> flipchat.common.v1.UserId - 7, // 1: flipchat.blob.v1.UploadRequest.blob_type:type_name -> flipchat.blob.v1.BlobType - 8, // 2: flipchat.blob.v1.UploadResponse.blob:type_name -> flipchat.blob.v1.Blob - 6, // 3: flipchat.blob.v1.UploadChunk.owner_id:type_name -> flipchat.common.v1.UserId - 7, // 4: flipchat.blob.v1.UploadChunk.blob_type:type_name -> flipchat.blob.v1.BlobType - 8, // 5: flipchat.blob.v1.UploadChunkedResponse.blob:type_name -> flipchat.blob.v1.Blob - 9, // 6: flipchat.blob.v1.GetInfoRequest.blob_id:type_name -> flipchat.common.v1.BlobId - 8, // 7: flipchat.blob.v1.GetInfoResponse.blob:type_name -> flipchat.blob.v1.Blob - 0, // 8: flipchat.blob.v1.BlobService.Upload:input_type -> flipchat.blob.v1.UploadRequest - 2, // 9: flipchat.blob.v1.BlobService.UploadChunked:input_type -> flipchat.blob.v1.UploadChunk - 4, // 10: flipchat.blob.v1.BlobService.GetInfo:input_type -> flipchat.blob.v1.GetInfoRequest - 1, // 11: flipchat.blob.v1.BlobService.Upload:output_type -> flipchat.blob.v1.UploadResponse - 3, // 12: flipchat.blob.v1.BlobService.UploadChunked:output_type -> flipchat.blob.v1.UploadChunkedResponse - 5, // 13: flipchat.blob.v1.BlobService.GetInfo:output_type -> flipchat.blob.v1.GetInfoResponse - 11, // [11:14] is the sub-list for method output_type - 8, // [8:11] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 4, // 0: flipchat.blob.v1.UploadRequest.owner_id:type_name -> flipchat.common.v1.UserId + 5, // 1: flipchat.blob.v1.UploadRequest.blob_type:type_name -> flipchat.blob.v1.BlobType + 6, // 2: flipchat.blob.v1.UploadResponse.blob:type_name -> flipchat.blob.v1.BlobMetadata + 7, // 3: flipchat.blob.v1.GetInfoRequest.blob_id:type_name -> flipchat.common.v1.BlobId + 6, // 4: flipchat.blob.v1.GetInfoResponse.blob:type_name -> flipchat.blob.v1.BlobMetadata + 0, // 5: flipchat.blob.v1.Blob.Upload:input_type -> flipchat.blob.v1.UploadRequest + 2, // 6: flipchat.blob.v1.Blob.GetInfo:input_type -> flipchat.blob.v1.GetInfoRequest + 1, // 7: flipchat.blob.v1.Blob.Upload:output_type -> flipchat.blob.v1.UploadResponse + 3, // 8: flipchat.blob.v1.Blob.GetInfo:output_type -> flipchat.blob.v1.GetInfoResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_blob_v1_blob_service_proto_init() } @@ -459,7 +325,7 @@ func file_blob_v1_blob_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_blob_v1_blob_service_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/generated/go/blob/v1/blob_service.pb.validate.go b/generated/go/blob/v1/blob_service.pb.validate.go index e902651..5ef3b05 100644 --- a/generated/go/blob/v1/blob_service.pb.validate.go +++ b/generated/go/blob/v1/blob_service.pb.validate.go @@ -297,269 +297,6 @@ var _ interface { ErrorName() string } = UploadResponseValidationError{} -// Validate checks the field values on UploadChunk 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 *UploadChunk) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UploadChunk 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 UploadChunkMultiError, or -// nil if none found. -func (m *UploadChunk) ValidateAll() error { - return m.validate(true) -} - -func (m *UploadChunk) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetOwnerId()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UploadChunkValidationError{ - field: "OwnerId", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UploadChunkValidationError{ - field: "OwnerId", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetOwnerId()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UploadChunkValidationError{ - field: "OwnerId", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for BlobType - - // no validation rules for Data - - if len(errors) > 0 { - return UploadChunkMultiError(errors) - } - - return nil -} - -// UploadChunkMultiError is an error wrapping multiple validation errors -// returned by UploadChunk.ValidateAll() if the designated constraints aren't met. -type UploadChunkMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UploadChunkMultiError) 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 UploadChunkMultiError) AllErrors() []error { return m } - -// UploadChunkValidationError is the validation error returned by -// UploadChunk.Validate if the designated constraints aren't met. -type UploadChunkValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UploadChunkValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UploadChunkValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UploadChunkValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UploadChunkValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UploadChunkValidationError) ErrorName() string { return "UploadChunkValidationError" } - -// Error satisfies the builtin error interface -func (e UploadChunkValidationError) 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 %sUploadChunk.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UploadChunkValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UploadChunkValidationError{} - -// Validate checks the field values on UploadChunkedResponse 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 *UploadChunkedResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UploadChunkedResponse 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 -// UploadChunkedResponseMultiError, or nil if none found. -func (m *UploadChunkedResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UploadChunkedResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetBlob()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, UploadChunkedResponseValidationError{ - field: "Blob", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, UploadChunkedResponseValidationError{ - field: "Blob", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetBlob()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return UploadChunkedResponseValidationError{ - field: "Blob", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return UploadChunkedResponseMultiError(errors) - } - - return nil -} - -// UploadChunkedResponseMultiError is an error wrapping multiple validation -// errors returned by UploadChunkedResponse.ValidateAll() if the designated -// constraints aren't met. -type UploadChunkedResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UploadChunkedResponseMultiError) 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 UploadChunkedResponseMultiError) AllErrors() []error { return m } - -// UploadChunkedResponseValidationError is the validation error returned by -// UploadChunkedResponse.Validate if the designated constraints aren't met. -type UploadChunkedResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UploadChunkedResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UploadChunkedResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UploadChunkedResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UploadChunkedResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UploadChunkedResponseValidationError) ErrorName() string { - return "UploadChunkedResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UploadChunkedResponseValidationError) 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 %sUploadChunkedResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UploadChunkedResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UploadChunkedResponseValidationError{} - // Validate checks the field values on GetInfoRequest 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. diff --git a/generated/go/blob/v1/blob_service_grpc.pb.go b/generated/go/blob/v1/blob_service_grpc.pb.go index 4f4cef8..af5b38e 100644 --- a/generated/go/blob/v1/blob_service_grpc.pb.go +++ b/generated/go/blob/v1/blob_service_grpc.pb.go @@ -19,187 +19,145 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - BlobService_Upload_FullMethodName = "/flipchat.blob.v1.BlobService/Upload" - BlobService_UploadChunked_FullMethodName = "/flipchat.blob.v1.BlobService/UploadChunked" - BlobService_GetInfo_FullMethodName = "/flipchat.blob.v1.BlobService/GetInfo" + Blob_Upload_FullMethodName = "/flipchat.blob.v1.Blob/Upload" + Blob_GetInfo_FullMethodName = "/flipchat.blob.v1.Blob/GetInfo" ) -// BlobServiceClient is the client API for BlobService service. +// BlobClient is the client API for Blob service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BlobServiceClient interface { +type BlobClient interface { // Request for a smaller/single-shot upload Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) - // Placeholder for future work - // - helps with large files that exceed gRPC message limits - // - avoids high memory usage by streaming in chunks - // - can allow better upload progress tracking - // - can *maybe* support live audio/video - UploadChunked(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadChunk, UploadChunkedResponse], error) // Get the metadata for a previously uploaded blob GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) } -type blobServiceClient struct { +type blobClient struct { cc grpc.ClientConnInterface } -func NewBlobServiceClient(cc grpc.ClientConnInterface) BlobServiceClient { - return &blobServiceClient{cc} +func NewBlobClient(cc grpc.ClientConnInterface) BlobClient { + return &blobClient{cc} } -func (c *blobServiceClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) { +func (c *blobClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(UploadResponse) - err := c.cc.Invoke(ctx, BlobService_Upload_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Blob_Upload_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *blobServiceClient) UploadChunked(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadChunk, UploadChunkedResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &BlobService_ServiceDesc.Streams[0], BlobService_UploadChunked_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[UploadChunk, UploadChunkedResponse]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BlobService_UploadChunkedClient = grpc.ClientStreamingClient[UploadChunk, UploadChunkedResponse] - -func (c *blobServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { +func (c *blobClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, BlobService_GetInfo_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, Blob_GetInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -// BlobServiceServer is the server API for BlobService service. -// All implementations must embed UnimplementedBlobServiceServer +// BlobServer is the server API for Blob service. +// All implementations must embed UnimplementedBlobServer // for forward compatibility. -type BlobServiceServer interface { +type BlobServer interface { // Request for a smaller/single-shot upload Upload(context.Context, *UploadRequest) (*UploadResponse, error) - // Placeholder for future work - // - helps with large files that exceed gRPC message limits - // - avoids high memory usage by streaming in chunks - // - can allow better upload progress tracking - // - can *maybe* support live audio/video - UploadChunked(grpc.ClientStreamingServer[UploadChunk, UploadChunkedResponse]) error // Get the metadata for a previously uploaded blob GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) - mustEmbedUnimplementedBlobServiceServer() + mustEmbedUnimplementedBlobServer() } -// UnimplementedBlobServiceServer must be embedded to have +// UnimplementedBlobServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. -type UnimplementedBlobServiceServer struct{} +type UnimplementedBlobServer struct{} -func (UnimplementedBlobServiceServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error) { +func (UnimplementedBlobServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented") } -func (UnimplementedBlobServiceServer) UploadChunked(grpc.ClientStreamingServer[UploadChunk, UploadChunkedResponse]) error { - return status.Errorf(codes.Unimplemented, "method UploadChunked not implemented") -} -func (UnimplementedBlobServiceServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { +func (UnimplementedBlobServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") } -func (UnimplementedBlobServiceServer) mustEmbedUnimplementedBlobServiceServer() {} -func (UnimplementedBlobServiceServer) testEmbeddedByValue() {} +func (UnimplementedBlobServer) mustEmbedUnimplementedBlobServer() {} +func (UnimplementedBlobServer) testEmbeddedByValue() {} -// UnsafeBlobServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BlobServiceServer will +// UnsafeBlobServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BlobServer will // result in compilation errors. -type UnsafeBlobServiceServer interface { - mustEmbedUnimplementedBlobServiceServer() +type UnsafeBlobServer interface { + mustEmbedUnimplementedBlobServer() } -func RegisterBlobServiceServer(s grpc.ServiceRegistrar, srv BlobServiceServer) { - // If the following call pancis, it indicates UnimplementedBlobServiceServer was +func RegisterBlobServer(s grpc.ServiceRegistrar, srv BlobServer) { + // If the following call pancis, it indicates UnimplementedBlobServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } - s.RegisterService(&BlobService_ServiceDesc, srv) + s.RegisterService(&Blob_ServiceDesc, srv) } -func _BlobService_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Blob_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UploadRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BlobServiceServer).Upload(ctx, in) + return srv.(BlobServer).Upload(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BlobService_Upload_FullMethodName, + FullMethod: Blob_Upload_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BlobServiceServer).Upload(ctx, req.(*UploadRequest)) + return srv.(BlobServer).Upload(ctx, req.(*UploadRequest)) } return interceptor(ctx, in, info, handler) } -func _BlobService_UploadChunked_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(BlobServiceServer).UploadChunked(&grpc.GenericServerStream[UploadChunk, UploadChunkedResponse]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BlobService_UploadChunkedServer = grpc.ClientStreamingServer[UploadChunk, UploadChunkedResponse] - -func _BlobService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Blob_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BlobServiceServer).GetInfo(ctx, in) + return srv.(BlobServer).GetInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: BlobService_GetInfo_FullMethodName, + FullMethod: Blob_GetInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BlobServiceServer).GetInfo(ctx, req.(*GetInfoRequest)) + return srv.(BlobServer).GetInfo(ctx, req.(*GetInfoRequest)) } return interceptor(ctx, in, info, handler) } -// BlobService_ServiceDesc is the grpc.ServiceDesc for BlobService service. +// Blob_ServiceDesc is the grpc.ServiceDesc for Blob service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var BlobService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "flipchat.blob.v1.BlobService", - HandlerType: (*BlobServiceServer)(nil), +var Blob_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipchat.blob.v1.Blob", + HandlerType: (*BlobServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Upload", - Handler: _BlobService_Upload_Handler, + Handler: _Blob_Upload_Handler, }, { MethodName: "GetInfo", - Handler: _BlobService_GetInfo_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "UploadChunked", - Handler: _BlobService_UploadChunked_Handler, - ClientStreams: true, + Handler: _Blob_GetInfo_Handler, }, }, + Streams: []grpc.StreamDesc{}, Metadata: "blob/v1/blob_service.proto", } diff --git a/generated/go/blob/v1/model.pb.go b/generated/go/blob/v1/model.pb.go index 43fe3f2..835e9a0 100644 --- a/generated/go/blob/v1/model.pb.go +++ b/generated/go/blob/v1/model.pb.go @@ -74,63 +74,8 @@ func (BlobType) EnumDescriptor() ([]byte, []int) { return file_blob_v1_model_proto_rawDescGZIP(), []int{0} } -type ImageMetadata_Format int32 - -const ( - ImageMetadata_IMAGE_FORMAT_UNKNOWN ImageMetadata_Format = 0 - ImageMetadata_IMAGE_FORMAT_JPEG ImageMetadata_Format = 1 - ImageMetadata_IMAGE_FORMAT_PNG ImageMetadata_Format = 2 - ImageMetadata_IMAGE_FORMAT_GIF ImageMetadata_Format = 3 - ImageMetadata_IMAGE_FORMAT_WEBP ImageMetadata_Format = 4 -) - -// Enum value maps for ImageMetadata_Format. -var ( - ImageMetadata_Format_name = map[int32]string{ - 0: "IMAGE_FORMAT_UNKNOWN", - 1: "IMAGE_FORMAT_JPEG", - 2: "IMAGE_FORMAT_PNG", - 3: "IMAGE_FORMAT_GIF", - 4: "IMAGE_FORMAT_WEBP", - } - ImageMetadata_Format_value = map[string]int32{ - "IMAGE_FORMAT_UNKNOWN": 0, - "IMAGE_FORMAT_JPEG": 1, - "IMAGE_FORMAT_PNG": 2, - "IMAGE_FORMAT_GIF": 3, - "IMAGE_FORMAT_WEBP": 4, - } -) - -func (x ImageMetadata_Format) Enum() *ImageMetadata_Format { - p := new(ImageMetadata_Format) - *p = x - return p -} - -func (x ImageMetadata_Format) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ImageMetadata_Format) Descriptor() protoreflect.EnumDescriptor { - return file_blob_v1_model_proto_enumTypes[1].Descriptor() -} - -func (ImageMetadata_Format) Type() protoreflect.EnumType { - return &file_blob_v1_model_proto_enumTypes[1] -} - -func (x ImageMetadata_Format) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ImageMetadata_Format.Descriptor instead. -func (ImageMetadata_Format) EnumDescriptor() ([]byte, []int) { - return file_blob_v1_model_proto_rawDescGZIP(), []int{1, 0} -} - // Common blob info returned in responses -type Blob struct { +type BlobMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -140,28 +85,22 @@ type Blob struct { OwnerId *v1.UserId `protobuf:"bytes,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` S3Url string `protobuf:"bytes,4,opt,name=s3_url,json=s3Url,proto3" json:"s3_url,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // Types that are assignable to Metadata: - // - // *Blob_ImageMetadata - // *Blob_VideoMetadata - // *Blob_AudioMetadata - Metadata isBlob_Metadata `protobuf_oneof:"metadata"` } -func (x *Blob) Reset() { - *x = Blob{} +func (x *BlobMetadata) Reset() { + *x = BlobMetadata{} mi := &file_blob_v1_model_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Blob) String() string { +func (x *BlobMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Blob) ProtoMessage() {} +func (*BlobMetadata) ProtoMessage() {} -func (x *Blob) ProtoReflect() protoreflect.Message { +func (x *BlobMetadata) ProtoReflect() protoreflect.Message { mi := &file_blob_v1_model_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -173,311 +112,46 @@ func (x *Blob) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Blob.ProtoReflect.Descriptor instead. -func (*Blob) Descriptor() ([]byte, []int) { +// Deprecated: Use BlobMetadata.ProtoReflect.Descriptor instead. +func (*BlobMetadata) Descriptor() ([]byte, []int) { return file_blob_v1_model_proto_rawDescGZIP(), []int{0} } -func (x *Blob) GetBlobId() *v1.BlobId { +func (x *BlobMetadata) GetBlobId() *v1.BlobId { if x != nil { return x.BlobId } return nil } -func (x *Blob) GetBlobType() BlobType { +func (x *BlobMetadata) GetBlobType() BlobType { if x != nil { return x.BlobType } return BlobType_BLOB_TYPE_UNKNOWN } -func (x *Blob) GetOwnerId() *v1.UserId { +func (x *BlobMetadata) GetOwnerId() *v1.UserId { if x != nil { return x.OwnerId } return nil } -func (x *Blob) GetS3Url() string { +func (x *BlobMetadata) GetS3Url() string { if x != nil { return x.S3Url } return "" } -func (x *Blob) GetCreatedAt() *timestamppb.Timestamp { +func (x *BlobMetadata) GetCreatedAt() *timestamppb.Timestamp { if x != nil { return x.CreatedAt } return nil } -func (m *Blob) GetMetadata() isBlob_Metadata { - if m != nil { - return m.Metadata - } - return nil -} - -func (x *Blob) GetImageMetadata() *ImageMetadata { - if x, ok := x.GetMetadata().(*Blob_ImageMetadata); ok { - return x.ImageMetadata - } - return nil -} - -func (x *Blob) GetVideoMetadata() *VideoMetadata { - if x, ok := x.GetMetadata().(*Blob_VideoMetadata); ok { - return x.VideoMetadata - } - return nil -} - -func (x *Blob) GetAudioMetadata() *AudioMetadata { - if x, ok := x.GetMetadata().(*Blob_AudioMetadata); ok { - return x.AudioMetadata - } - return nil -} - -type isBlob_Metadata interface { - isBlob_Metadata() -} - -type Blob_ImageMetadata struct { - ImageMetadata *ImageMetadata `protobuf:"bytes,6,opt,name=image_metadata,json=imageMetadata,proto3,oneof"` -} - -type Blob_VideoMetadata struct { - VideoMetadata *VideoMetadata `protobuf:"bytes,7,opt,name=video_metadata,json=videoMetadata,proto3,oneof"` -} - -type Blob_AudioMetadata struct { - AudioMetadata *AudioMetadata `protobuf:"bytes,8,opt,name=audio_metadata,json=audioMetadata,proto3,oneof"` -} - -func (*Blob_ImageMetadata) isBlob_Metadata() {} - -func (*Blob_VideoMetadata) isBlob_Metadata() {} - -func (*Blob_AudioMetadata) isBlob_Metadata() {} - -type ImageMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` - Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Format ImageMetadata_Format `protobuf:"varint,4,opt,name=format,proto3,enum=flipchat.blob.v1.ImageMetadata_Format" json:"format,omitempty"` -} - -func (x *ImageMetadata) Reset() { - *x = ImageMetadata{} - mi := &file_blob_v1_model_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ImageMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageMetadata) ProtoMessage() {} - -func (x *ImageMetadata) ProtoReflect() protoreflect.Message { - mi := &file_blob_v1_model_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ImageMetadata.ProtoReflect.Descriptor instead. -func (*ImageMetadata) Descriptor() ([]byte, []int) { - return file_blob_v1_model_proto_rawDescGZIP(), []int{1} -} - -func (x *ImageMetadata) GetVersion() int32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *ImageMetadata) GetWidth() int32 { - if x != nil { - return x.Width - } - return 0 -} - -func (x *ImageMetadata) GetHeight() int32 { - if x != nil { - return x.Height - } - return 0 -} - -func (x *ImageMetadata) GetFormat() ImageMetadata_Format { - if x != nil { - return x.Format - } - return ImageMetadata_IMAGE_FORMAT_UNKNOWN -} - -type VideoMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` - Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - DurationSeconds int32 `protobuf:"varint,4,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration_seconds,omitempty"` - FrameRate float32 `protobuf:"fixed32,5,opt,name=frame_rate,json=frameRate,proto3" json:"frame_rate,omitempty"` - Codec string `protobuf:"bytes,6,opt,name=codec,proto3" json:"codec,omitempty"` -} - -func (x *VideoMetadata) Reset() { - *x = VideoMetadata{} - mi := &file_blob_v1_model_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *VideoMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VideoMetadata) ProtoMessage() {} - -func (x *VideoMetadata) ProtoReflect() protoreflect.Message { - mi := &file_blob_v1_model_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VideoMetadata.ProtoReflect.Descriptor instead. -func (*VideoMetadata) Descriptor() ([]byte, []int) { - return file_blob_v1_model_proto_rawDescGZIP(), []int{2} -} - -func (x *VideoMetadata) GetVersion() int32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *VideoMetadata) GetWidth() int32 { - if x != nil { - return x.Width - } - return 0 -} - -func (x *VideoMetadata) GetHeight() int32 { - if x != nil { - return x.Height - } - return 0 -} - -func (x *VideoMetadata) GetDurationSeconds() int32 { - if x != nil { - return x.DurationSeconds - } - return 0 -} - -func (x *VideoMetadata) GetFrameRate() float32 { - if x != nil { - return x.FrameRate - } - return 0 -} - -func (x *VideoMetadata) GetCodec() string { - if x != nil { - return x.Codec - } - return "" -} - -type AudioMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - DurationSeconds int32 `protobuf:"varint,2,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration_seconds,omitempty"` - Codec string `protobuf:"bytes,3,opt,name=codec,proto3" json:"codec,omitempty"` -} - -func (x *AudioMetadata) Reset() { - *x = AudioMetadata{} - mi := &file_blob_v1_model_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AudioMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AudioMetadata) ProtoMessage() {} - -func (x *AudioMetadata) ProtoReflect() protoreflect.Message { - mi := &file_blob_v1_model_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AudioMetadata.ProtoReflect.Descriptor instead. -func (*AudioMetadata) Descriptor() ([]byte, []int) { - return file_blob_v1_model_proto_rawDescGZIP(), []int{3} -} - -func (x *AudioMetadata) GetVersion() int32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *AudioMetadata) GetDurationSeconds() int32 { - if x != nil { - return x.DurationSeconds - } - return 0 -} - -func (x *AudioMetadata) GetCodec() string { - if x != nil { - return x.Codec - } - return "" -} - var File_blob_v1_model_proto protoreflect.FileDescriptor var file_blob_v1_model_proto_rawDesc = []byte{ @@ -487,73 +161,23 @@ var file_blob_v1_model_proto_rawDesc = []byte{ 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 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, 0xe7, 0x03, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, - 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, - 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, - 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, - 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, - 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, - 0x0a, 0x06, 0x73, 0x33, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x73, 0x33, 0x55, 0x72, 0x6c, 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, 0x48, 0x0a, 0x0e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, - 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x0e, 0x76, 0x69, - 0x64, 0x65, 0x6f, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, - 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0d, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x0e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, - 0x41, 0x75, 0x64, 0x69, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, - 0x0d, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x0a, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x95, 0x02, 0x0a, 0x0d, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x12, 0x3e, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x22, 0x7c, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x18, - 0x0a, 0x14, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4d, 0x41, 0x47, - 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4a, 0x50, 0x45, 0x47, 0x10, 0x01, 0x12, - 0x14, 0x0a, 0x10, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, - 0x50, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, - 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x47, 0x49, 0x46, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x49, - 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x57, 0x45, 0x42, 0x50, - 0x10, 0x04, 0x22, 0xb7, 0x01, 0x0a, 0x0d, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, - 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x29, 0x0a, 0x10, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x72, 0x61, 0x6d, 0x65, - 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x66, 0x72, 0x61, - 0x6d, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x22, 0x6a, 0x0a, 0x0d, - 0x41, 0x75, 0x64, 0x69, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x6f, 0x6e, - 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x2a, 0x60, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, + 0x22, 0x85, 0x02, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, + 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, + 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x33, 0x5f, 0x75, 0x72, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x33, 0x55, 0x72, 0x6c, 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, 0x2a, 0x60, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x01, @@ -582,33 +206,25 @@ func file_blob_v1_model_proto_rawDescGZIP() []byte { return file_blob_v1_model_proto_rawDescData } -var file_blob_v1_model_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_blob_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_blob_v1_model_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_blob_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_blob_v1_model_proto_goTypes = []any{ (BlobType)(0), // 0: flipchat.blob.v1.BlobType - (ImageMetadata_Format)(0), // 1: flipchat.blob.v1.ImageMetadata.Format - (*Blob)(nil), // 2: flipchat.blob.v1.Blob - (*ImageMetadata)(nil), // 3: flipchat.blob.v1.ImageMetadata - (*VideoMetadata)(nil), // 4: flipchat.blob.v1.VideoMetadata - (*AudioMetadata)(nil), // 5: flipchat.blob.v1.AudioMetadata - (*v1.BlobId)(nil), // 6: flipchat.common.v1.BlobId - (*v1.UserId)(nil), // 7: flipchat.common.v1.UserId - (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (*BlobMetadata)(nil), // 1: flipchat.blob.v1.BlobMetadata + (*v1.BlobId)(nil), // 2: flipchat.common.v1.BlobId + (*v1.UserId)(nil), // 3: flipchat.common.v1.UserId + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp } var file_blob_v1_model_proto_depIdxs = []int32{ - 6, // 0: flipchat.blob.v1.Blob.blob_id:type_name -> flipchat.common.v1.BlobId - 0, // 1: flipchat.blob.v1.Blob.blob_type:type_name -> flipchat.blob.v1.BlobType - 7, // 2: flipchat.blob.v1.Blob.owner_id:type_name -> flipchat.common.v1.UserId - 8, // 3: flipchat.blob.v1.Blob.created_at:type_name -> google.protobuf.Timestamp - 3, // 4: flipchat.blob.v1.Blob.image_metadata:type_name -> flipchat.blob.v1.ImageMetadata - 4, // 5: flipchat.blob.v1.Blob.video_metadata:type_name -> flipchat.blob.v1.VideoMetadata - 5, // 6: flipchat.blob.v1.Blob.audio_metadata:type_name -> flipchat.blob.v1.AudioMetadata - 1, // 7: flipchat.blob.v1.ImageMetadata.format:type_name -> flipchat.blob.v1.ImageMetadata.Format - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 2, // 0: flipchat.blob.v1.BlobMetadata.blob_id:type_name -> flipchat.common.v1.BlobId + 0, // 1: flipchat.blob.v1.BlobMetadata.blob_type:type_name -> flipchat.blob.v1.BlobType + 3, // 2: flipchat.blob.v1.BlobMetadata.owner_id:type_name -> flipchat.common.v1.UserId + 4, // 3: flipchat.blob.v1.BlobMetadata.created_at:type_name -> google.protobuf.Timestamp + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_blob_v1_model_proto_init() } @@ -616,18 +232,13 @@ func file_blob_v1_model_proto_init() { if File_blob_v1_model_proto != nil { return } - file_blob_v1_model_proto_msgTypes[0].OneofWrappers = []any{ - (*Blob_ImageMetadata)(nil), - (*Blob_VideoMetadata)(nil), - (*Blob_AudioMetadata)(nil), - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_blob_v1_model_proto_rawDesc, - NumEnums: 2, - NumMessages: 4, + NumEnums: 1, + NumMessages: 1, NumExtensions: 0, NumServices: 0, }, diff --git a/generated/go/blob/v1/model.pb.validate.go b/generated/go/blob/v1/model.pb.validate.go index b2acefa..7f06e83 100644 --- a/generated/go/blob/v1/model.pb.validate.go +++ b/generated/go/blob/v1/model.pb.validate.go @@ -35,21 +35,22 @@ var ( _ = sort.Sort ) -// Validate checks the field values on Blob 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 *Blob) Validate() error { +// Validate checks the field values on BlobMetadata 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 *BlobMetadata) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Blob 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 BlobMultiError, or nil if none found. -func (m *Blob) ValidateAll() error { +// ValidateAll checks the field values on BlobMetadata 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 BlobMetadataMultiError, or +// nil if none found. +func (m *BlobMetadata) ValidateAll() error { return m.validate(true) } -func (m *Blob) validate(all bool) error { +func (m *BlobMetadata) validate(all bool) error { if m == nil { return nil } @@ -60,7 +61,7 @@ func (m *Blob) validate(all bool) error { switch v := interface{}(m.GetBlobId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobValidationError{ + errors = append(errors, BlobMetadataValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -68,7 +69,7 @@ func (m *Blob) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, BlobValidationError{ + errors = append(errors, BlobMetadataValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -77,7 +78,7 @@ func (m *Blob) validate(all bool) error { } } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return BlobValidationError{ + return BlobMetadataValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -91,7 +92,7 @@ func (m *Blob) validate(all bool) error { switch v := interface{}(m.GetOwnerId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobValidationError{ + errors = append(errors, BlobMetadataValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -99,7 +100,7 @@ func (m *Blob) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, BlobValidationError{ + errors = append(errors, BlobMetadataValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -108,7 +109,7 @@ func (m *Blob) validate(all bool) error { } } else if v, ok := interface{}(m.GetOwnerId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return BlobValidationError{ + return BlobMetadataValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -122,7 +123,7 @@ func (m *Blob) validate(all bool) error { switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobValidationError{ + errors = append(errors, BlobMetadataValidationError{ field: "CreatedAt", reason: "embedded message failed validation", cause: err, @@ -130,7 +131,7 @@ func (m *Blob) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, BlobValidationError{ + errors = append(errors, BlobMetadataValidationError{ field: "CreatedAt", reason: "embedded message failed validation", cause: err, @@ -139,7 +140,7 @@ func (m *Blob) validate(all bool) error { } } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return BlobValidationError{ + return BlobMetadataValidationError{ field: "CreatedAt", reason: "embedded message failed validation", cause: err, @@ -147,473 +148,19 @@ func (m *Blob) validate(all bool) error { } } - switch v := m.Metadata.(type) { - case *Blob_ImageMetadata: - if v == nil { - err := BlobValidationError{ - field: "Metadata", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetImageMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobValidationError{ - field: "ImageMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, BlobValidationError{ - field: "ImageMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetImageMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return BlobValidationError{ - field: "ImageMetadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *Blob_VideoMetadata: - if v == nil { - err := BlobValidationError{ - field: "Metadata", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetVideoMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobValidationError{ - field: "VideoMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, BlobValidationError{ - field: "VideoMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetVideoMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return BlobValidationError{ - field: "VideoMetadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - case *Blob_AudioMetadata: - if v == nil { - err := BlobValidationError{ - field: "Metadata", - reason: "oneof value cannot be a typed-nil", - } - if !all { - return err - } - errors = append(errors, err) - } - - if all { - switch v := interface{}(m.GetAudioMetadata()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobValidationError{ - field: "AudioMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, BlobValidationError{ - field: "AudioMetadata", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetAudioMetadata()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return BlobValidationError{ - field: "AudioMetadata", - reason: "embedded message failed validation", - cause: err, - } - } - } - - default: - _ = v // ensures v is used - } - - if len(errors) > 0 { - return BlobMultiError(errors) - } - - return nil -} - -// BlobMultiError is an error wrapping multiple validation errors returned by -// Blob.ValidateAll() if the designated constraints aren't met. -type BlobMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m BlobMultiError) 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 BlobMultiError) AllErrors() []error { return m } - -// BlobValidationError is the validation error returned by Blob.Validate if the -// designated constraints aren't met. -type BlobValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e BlobValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e BlobValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e BlobValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e BlobValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e BlobValidationError) ErrorName() string { return "BlobValidationError" } - -// Error satisfies the builtin error interface -func (e BlobValidationError) 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 %sBlob.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = BlobValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = BlobValidationError{} - -// Validate checks the field values on ImageMetadata 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 *ImageMetadata) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ImageMetadata 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 ImageMetadataMultiError, or -// nil if none found. -func (m *ImageMetadata) ValidateAll() error { - return m.validate(true) -} - -func (m *ImageMetadata) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Version - - // no validation rules for Width - - // no validation rules for Height - - // no validation rules for Format - - if len(errors) > 0 { - return ImageMetadataMultiError(errors) - } - - return nil -} - -// ImageMetadataMultiError is an error wrapping multiple validation errors -// returned by ImageMetadata.ValidateAll() if the designated constraints -// aren't met. -type ImageMetadataMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ImageMetadataMultiError) 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 ImageMetadataMultiError) AllErrors() []error { return m } - -// ImageMetadataValidationError is the validation error returned by -// ImageMetadata.Validate if the designated constraints aren't met. -type ImageMetadataValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ImageMetadataValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ImageMetadataValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ImageMetadataValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ImageMetadataValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ImageMetadataValidationError) ErrorName() string { return "ImageMetadataValidationError" } - -// Error satisfies the builtin error interface -func (e ImageMetadataValidationError) 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 %sImageMetadata.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ImageMetadataValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ImageMetadataValidationError{} - -// Validate checks the field values on VideoMetadata 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 *VideoMetadata) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on VideoMetadata 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 VideoMetadataMultiError, or -// nil if none found. -func (m *VideoMetadata) ValidateAll() error { - return m.validate(true) -} - -func (m *VideoMetadata) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Version - - // no validation rules for Width - - // no validation rules for Height - - // no validation rules for DurationSeconds - - // no validation rules for FrameRate - - // no validation rules for Codec - - if len(errors) > 0 { - return VideoMetadataMultiError(errors) - } - - return nil -} - -// VideoMetadataMultiError is an error wrapping multiple validation errors -// returned by VideoMetadata.ValidateAll() if the designated constraints -// aren't met. -type VideoMetadataMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m VideoMetadataMultiError) 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 VideoMetadataMultiError) AllErrors() []error { return m } - -// VideoMetadataValidationError is the validation error returned by -// VideoMetadata.Validate if the designated constraints aren't met. -type VideoMetadataValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e VideoMetadataValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e VideoMetadataValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e VideoMetadataValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e VideoMetadataValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e VideoMetadataValidationError) ErrorName() string { return "VideoMetadataValidationError" } - -// Error satisfies the builtin error interface -func (e VideoMetadataValidationError) 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 %sVideoMetadata.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = VideoMetadataValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = VideoMetadataValidationError{} - -// Validate checks the field values on AudioMetadata 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 *AudioMetadata) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AudioMetadata 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 AudioMetadataMultiError, or -// nil if none found. -func (m *AudioMetadata) ValidateAll() error { - return m.validate(true) -} - -func (m *AudioMetadata) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Version - - // no validation rules for DurationSeconds - - // no validation rules for Codec - if len(errors) > 0 { - return AudioMetadataMultiError(errors) + return BlobMetadataMultiError(errors) } return nil } -// AudioMetadataMultiError is an error wrapping multiple validation errors -// returned by AudioMetadata.ValidateAll() if the designated constraints -// aren't met. -type AudioMetadataMultiError []error +// BlobMetadataMultiError is an error wrapping multiple validation errors +// returned by BlobMetadata.ValidateAll() if the designated constraints aren't met. +type BlobMetadataMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m AudioMetadataMultiError) Error() string { +func (m BlobMetadataMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -622,11 +169,11 @@ func (m AudioMetadataMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m AudioMetadataMultiError) AllErrors() []error { return m } +func (m BlobMetadataMultiError) AllErrors() []error { return m } -// AudioMetadataValidationError is the validation error returned by -// AudioMetadata.Validate if the designated constraints aren't met. -type AudioMetadataValidationError struct { +// BlobMetadataValidationError is the validation error returned by +// BlobMetadata.Validate if the designated constraints aren't met. +type BlobMetadataValidationError struct { field string reason string cause error @@ -634,22 +181,22 @@ type AudioMetadataValidationError struct { } // Field function returns field value. -func (e AudioMetadataValidationError) Field() string { return e.field } +func (e BlobMetadataValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e AudioMetadataValidationError) Reason() string { return e.reason } +func (e BlobMetadataValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e AudioMetadataValidationError) Cause() error { return e.cause } +func (e BlobMetadataValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e AudioMetadataValidationError) Key() bool { return e.key } +func (e BlobMetadataValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e AudioMetadataValidationError) ErrorName() string { return "AudioMetadataValidationError" } +func (e BlobMetadataValidationError) ErrorName() string { return "BlobMetadataValidationError" } // Error satisfies the builtin error interface -func (e AudioMetadataValidationError) Error() string { +func (e BlobMetadataValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -661,14 +208,14 @@ func (e AudioMetadataValidationError) Error() string { } return fmt.Sprintf( - "invalid %sAudioMetadata.%s: %s%s", + "invalid %sBlobMetadata.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = AudioMetadataValidationError{} +var _ error = BlobMetadataValidationError{} var _ interface { Field() string @@ -676,4 +223,4 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = AudioMetadataValidationError{} +} = BlobMetadataValidationError{} diff --git a/proto/blob/v1/blob_service.proto b/proto/blob/v1/blob_service.proto index eeae333..f8fb0a4 100644 --- a/proto/blob/v1/blob_service.proto +++ b/proto/blob/v1/blob_service.proto @@ -9,17 +9,10 @@ option objc_class_prefix = "FCPBBlobV1"; import "common/v1/common.proto"; import "blob/v1/model.proto"; -service BlobService { +service Blob { // Request for a smaller/single-shot upload rpc Upload (UploadRequest) returns (UploadResponse); - // Placeholder for future work - // - helps with large files that exceed gRPC message limits - // - avoids high memory usage by streaming in chunks - // - can allow better upload progress tracking - // - can *maybe* support live audio/video - rpc UploadChunked (stream UploadChunk) returns (UploadChunkedResponse); - // Get the metadata for a previously uploaded blob rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); } @@ -33,20 +26,7 @@ message UploadRequest { // Single-shot upload response message UploadResponse { - Blob blob = 1; -} - -// Client-streaming chunk for large uploads -message UploadChunk { - common.v1.UserId owner_id = 1; - BlobType blob_type = 2; - - bytes data = 3; -} - -// Chunked upload final response -message UploadChunkedResponse { - Blob blob = 1; + BlobMetadata blob = 1; } // Retrieve existing blob info @@ -55,5 +35,5 @@ message GetInfoRequest { } message GetInfoResponse { - Blob blob = 1; + BlobMetadata blob = 1; } diff --git a/proto/blob/v1/model.proto b/proto/blob/v1/model.proto index bec6d2e..3a1a5cc 100644 --- a/proto/blob/v1/model.proto +++ b/proto/blob/v1/model.proto @@ -19,7 +19,7 @@ enum BlobType { } // Common blob info returned in responses -message Blob { +message BlobMetadata { common.v1.BlobId blob_id = 1; BlobType blob_type = 2; @@ -27,45 +27,5 @@ message Blob { string s3_url = 4; google.protobuf.Timestamp created_at = 5; - - oneof metadata { - ImageMetadata image_metadata = 6; - VideoMetadata video_metadata = 7; - AudioMetadata audio_metadata = 8; - } -} - -message ImageMetadata { - int32 version = 1; - - int32 width = 2; - int32 height = 3; - - enum Format { - IMAGE_FORMAT_UNKNOWN = 0; - IMAGE_FORMAT_JPEG = 1; - IMAGE_FORMAT_PNG = 2; - IMAGE_FORMAT_GIF = 3; - IMAGE_FORMAT_WEBP = 4; - } - Format format = 4; -} - -message VideoMetadata { - int32 version = 1; - - int32 width = 2; - int32 height = 3; - - int32 duration_seconds = 4; - float frame_rate = 5; - string codec = 6; -} - -message AudioMetadata { - int32 version = 1; - - int32 duration_seconds = 2; - string codec = 3; } From d0f48ee3f685dd964e8b0f197f3402f81e1baeb5 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Thu, 23 Jan 2025 13:56:03 -0500 Subject: [PATCH 4/7] blob: updated protos --- generated/go/blob/v1/blob_service.pb.go | 201 +++++++------- .../go/blob/v1/blob_service.pb.validate.go | 254 +++++++++--------- generated/go/blob/v1/blob_service_grpc.pb.go | 100 +++---- generated/go/blob/v1/model.pb.go | 99 ++++--- generated/go/blob/v1/model.pb.validate.go | 73 +++-- proto/blob/v1/blob_service.proto | 18 +- proto/blob/v1/model.proto | 5 +- 7 files changed, 377 insertions(+), 373 deletions(-) diff --git a/generated/go/blob/v1/blob_service.pb.go b/generated/go/blob/v1/blob_service.pb.go index d904ca3..50fd82a 100644 --- a/generated/go/blob/v1/blob_service.pb.go +++ b/generated/go/blob/v1/blob_service.pb.go @@ -22,7 +22,7 @@ const ( ) // Request for a smaller/single-shot upload -type UploadRequest struct { +type UploadBlobRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -32,20 +32,20 @@ type UploadRequest struct { RawData []byte `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` } -func (x *UploadRequest) Reset() { - *x = UploadRequest{} +func (x *UploadBlobRequest) Reset() { + *x = UploadBlobRequest{} mi := &file_blob_v1_blob_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UploadRequest) String() string { +func (x *UploadBlobRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UploadRequest) ProtoMessage() {} +func (*UploadBlobRequest) ProtoMessage() {} -func (x *UploadRequest) ProtoReflect() protoreflect.Message { +func (x *UploadBlobRequest) ProtoReflect() protoreflect.Message { mi := &file_blob_v1_blob_service_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -57,26 +57,26 @@ func (x *UploadRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead. -func (*UploadRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use UploadBlobRequest.ProtoReflect.Descriptor instead. +func (*UploadBlobRequest) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{0} } -func (x *UploadRequest) GetOwnerId() *v1.UserId { +func (x *UploadBlobRequest) GetOwnerId() *v1.UserId { if x != nil { return x.OwnerId } return nil } -func (x *UploadRequest) GetBlobType() BlobType { +func (x *UploadBlobRequest) GetBlobType() BlobType { if x != nil { return x.BlobType } return BlobType_BLOB_TYPE_UNKNOWN } -func (x *UploadRequest) GetRawData() []byte { +func (x *UploadBlobRequest) GetRawData() []byte { if x != nil { return x.RawData } @@ -84,28 +84,28 @@ func (x *UploadRequest) GetRawData() []byte { } // Single-shot upload response -type UploadResponse struct { +type UploadBlobResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Blob *BlobMetadata `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` + Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` } -func (x *UploadResponse) Reset() { - *x = UploadResponse{} +func (x *UploadBlobResponse) Reset() { + *x = UploadBlobResponse{} mi := &file_blob_v1_blob_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UploadResponse) String() string { +func (x *UploadBlobResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UploadResponse) ProtoMessage() {} +func (*UploadBlobResponse) ProtoMessage() {} -func (x *UploadResponse) ProtoReflect() protoreflect.Message { +func (x *UploadBlobResponse) ProtoReflect() protoreflect.Message { mi := &file_blob_v1_blob_service_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -117,12 +117,12 @@ func (x *UploadResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead. -func (*UploadResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use UploadBlobResponse.ProtoReflect.Descriptor instead. +func (*UploadBlobResponse) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{1} } -func (x *UploadResponse) GetBlob() *BlobMetadata { +func (x *UploadBlobResponse) GetBlob() *Blob { if x != nil { return x.Blob } @@ -130,7 +130,7 @@ func (x *UploadResponse) GetBlob() *BlobMetadata { } // Retrieve existing blob info -type GetInfoRequest struct { +type GetBlobInfoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -138,20 +138,20 @@ type GetInfoRequest struct { BlobId *v1.BlobId `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` } -func (x *GetInfoRequest) Reset() { - *x = GetInfoRequest{} +func (x *GetBlobInfoRequest) Reset() { + *x = GetBlobInfoRequest{} mi := &file_blob_v1_blob_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetInfoRequest) String() string { +func (x *GetBlobInfoRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetInfoRequest) ProtoMessage() {} +func (*GetBlobInfoRequest) ProtoMessage() {} -func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { +func (x *GetBlobInfoRequest) ProtoReflect() protoreflect.Message { mi := &file_blob_v1_blob_service_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -163,40 +163,40 @@ func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetInfoRequest.ProtoReflect.Descriptor instead. -func (*GetInfoRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetBlobInfoRequest.ProtoReflect.Descriptor instead. +func (*GetBlobInfoRequest) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{2} } -func (x *GetInfoRequest) GetBlobId() *v1.BlobId { +func (x *GetBlobInfoRequest) GetBlobId() *v1.BlobId { if x != nil { return x.BlobId } return nil } -type GetInfoResponse struct { +type GetBlobInfoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Blob *BlobMetadata `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` + Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` } -func (x *GetInfoResponse) Reset() { - *x = GetInfoResponse{} +func (x *GetBlobInfoResponse) Reset() { + *x = GetBlobInfoResponse{} mi := &file_blob_v1_blob_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetInfoResponse) String() string { +func (x *GetBlobInfoResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetInfoResponse) ProtoMessage() {} +func (*GetBlobInfoResponse) ProtoMessage() {} -func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { +func (x *GetBlobInfoResponse) ProtoReflect() protoreflect.Message { mi := &file_blob_v1_blob_service_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -208,12 +208,12 @@ func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetInfoResponse.ProtoReflect.Descriptor instead. -func (*GetInfoResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetBlobInfoResponse.ProtoReflect.Descriptor instead. +func (*GetBlobInfoResponse) Descriptor() ([]byte, []int) { return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{3} } -func (x *GetInfoResponse) GetBlob() *BlobMetadata { +func (x *GetBlobInfoResponse) GetBlob() *Blob { if x != nil { return x.Blob } @@ -228,49 +228,50 @@ var file_blob_v1_blob_service_proto_rawDesc = []byte{ 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, 0x01, 0x0a, 0x0d, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, - 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, - 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, - 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x22, 0x44, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x62, 0x6c, - 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, - 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x45, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, 0x62, - 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0xa3, 0x01, 0x0a, - 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x4b, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, - 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, - 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, - 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, - 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, - 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a, 0x11, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, + 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x22, 0x40, 0x0a, 0x12, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x49, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, + 0x64, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x13, 0x47, 0x65, 0x74, + 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0xba, 0x01, 0x0a, + 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x06, + 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, + 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, + 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, + 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, + 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -287,25 +288,25 @@ func file_blob_v1_blob_service_proto_rawDescGZIP() []byte { var file_blob_v1_blob_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_blob_v1_blob_service_proto_goTypes = []any{ - (*UploadRequest)(nil), // 0: flipchat.blob.v1.UploadRequest - (*UploadResponse)(nil), // 1: flipchat.blob.v1.UploadResponse - (*GetInfoRequest)(nil), // 2: flipchat.blob.v1.GetInfoRequest - (*GetInfoResponse)(nil), // 3: flipchat.blob.v1.GetInfoResponse - (*v1.UserId)(nil), // 4: flipchat.common.v1.UserId - (BlobType)(0), // 5: flipchat.blob.v1.BlobType - (*BlobMetadata)(nil), // 6: flipchat.blob.v1.BlobMetadata - (*v1.BlobId)(nil), // 7: flipchat.common.v1.BlobId + (*UploadBlobRequest)(nil), // 0: flipchat.blob.v1.UploadBlobRequest + (*UploadBlobResponse)(nil), // 1: flipchat.blob.v1.UploadBlobResponse + (*GetBlobInfoRequest)(nil), // 2: flipchat.blob.v1.GetBlobInfoRequest + (*GetBlobInfoResponse)(nil), // 3: flipchat.blob.v1.GetBlobInfoResponse + (*v1.UserId)(nil), // 4: flipchat.common.v1.UserId + (BlobType)(0), // 5: flipchat.blob.v1.BlobType + (*Blob)(nil), // 6: flipchat.blob.v1.Blob + (*v1.BlobId)(nil), // 7: flipchat.common.v1.BlobId } var file_blob_v1_blob_service_proto_depIdxs = []int32{ - 4, // 0: flipchat.blob.v1.UploadRequest.owner_id:type_name -> flipchat.common.v1.UserId - 5, // 1: flipchat.blob.v1.UploadRequest.blob_type:type_name -> flipchat.blob.v1.BlobType - 6, // 2: flipchat.blob.v1.UploadResponse.blob:type_name -> flipchat.blob.v1.BlobMetadata - 7, // 3: flipchat.blob.v1.GetInfoRequest.blob_id:type_name -> flipchat.common.v1.BlobId - 6, // 4: flipchat.blob.v1.GetInfoResponse.blob:type_name -> flipchat.blob.v1.BlobMetadata - 0, // 5: flipchat.blob.v1.Blob.Upload:input_type -> flipchat.blob.v1.UploadRequest - 2, // 6: flipchat.blob.v1.Blob.GetInfo:input_type -> flipchat.blob.v1.GetInfoRequest - 1, // 7: flipchat.blob.v1.Blob.Upload:output_type -> flipchat.blob.v1.UploadResponse - 3, // 8: flipchat.blob.v1.Blob.GetInfo:output_type -> flipchat.blob.v1.GetInfoResponse + 4, // 0: flipchat.blob.v1.UploadBlobRequest.owner_id:type_name -> flipchat.common.v1.UserId + 5, // 1: flipchat.blob.v1.UploadBlobRequest.blob_type:type_name -> flipchat.blob.v1.BlobType + 6, // 2: flipchat.blob.v1.UploadBlobResponse.blob:type_name -> flipchat.blob.v1.Blob + 7, // 3: flipchat.blob.v1.GetBlobInfoRequest.blob_id:type_name -> flipchat.common.v1.BlobId + 6, // 4: flipchat.blob.v1.GetBlobInfoResponse.blob:type_name -> flipchat.blob.v1.Blob + 0, // 5: flipchat.blob.v1.BlobService.Upload:input_type -> flipchat.blob.v1.UploadBlobRequest + 2, // 6: flipchat.blob.v1.BlobService.GetInfo:input_type -> flipchat.blob.v1.GetBlobInfoRequest + 1, // 7: flipchat.blob.v1.BlobService.Upload:output_type -> flipchat.blob.v1.UploadBlobResponse + 3, // 8: flipchat.blob.v1.BlobService.GetInfo:output_type -> flipchat.blob.v1.GetBlobInfoResponse 7, // [7:9] is the sub-list for method output_type 5, // [5:7] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name diff --git a/generated/go/blob/v1/blob_service.pb.validate.go b/generated/go/blob/v1/blob_service.pb.validate.go index 5ef3b05..73afae4 100644 --- a/generated/go/blob/v1/blob_service.pb.validate.go +++ b/generated/go/blob/v1/blob_service.pb.validate.go @@ -35,22 +35,22 @@ var ( _ = sort.Sort ) -// Validate checks the field values on UploadRequest 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 *UploadRequest) Validate() error { +// Validate checks the field values on UploadBlobRequest 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 *UploadBlobRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on UploadRequest 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 UploadRequestMultiError, or -// nil if none found. -func (m *UploadRequest) ValidateAll() error { +// ValidateAll checks the field values on UploadBlobRequest 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 +// UploadBlobRequestMultiError, or nil if none found. +func (m *UploadBlobRequest) ValidateAll() error { return m.validate(true) } -func (m *UploadRequest) validate(all bool) error { +func (m *UploadBlobRequest) validate(all bool) error { if m == nil { return nil } @@ -61,7 +61,7 @@ func (m *UploadRequest) validate(all bool) error { switch v := interface{}(m.GetOwnerId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, UploadRequestValidationError{ + errors = append(errors, UploadBlobRequestValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -69,7 +69,7 @@ func (m *UploadRequest) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, UploadRequestValidationError{ + errors = append(errors, UploadBlobRequestValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -78,7 +78,7 @@ func (m *UploadRequest) validate(all bool) error { } } else if v, ok := interface{}(m.GetOwnerId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return UploadRequestValidationError{ + return UploadBlobRequestValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -91,19 +91,19 @@ func (m *UploadRequest) validate(all bool) error { // no validation rules for RawData if len(errors) > 0 { - return UploadRequestMultiError(errors) + return UploadBlobRequestMultiError(errors) } return nil } -// UploadRequestMultiError is an error wrapping multiple validation errors -// returned by UploadRequest.ValidateAll() if the designated constraints +// UploadBlobRequestMultiError is an error wrapping multiple validation errors +// returned by UploadBlobRequest.ValidateAll() if the designated constraints // aren't met. -type UploadRequestMultiError []error +type UploadBlobRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m UploadRequestMultiError) Error() string { +func (m UploadBlobRequestMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -112,11 +112,11 @@ func (m UploadRequestMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m UploadRequestMultiError) AllErrors() []error { return m } +func (m UploadBlobRequestMultiError) AllErrors() []error { return m } -// UploadRequestValidationError is the validation error returned by -// UploadRequest.Validate if the designated constraints aren't met. -type UploadRequestValidationError struct { +// UploadBlobRequestValidationError is the validation error returned by +// UploadBlobRequest.Validate if the designated constraints aren't met. +type UploadBlobRequestValidationError struct { field string reason string cause error @@ -124,22 +124,24 @@ type UploadRequestValidationError struct { } // Field function returns field value. -func (e UploadRequestValidationError) Field() string { return e.field } +func (e UploadBlobRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e UploadRequestValidationError) Reason() string { return e.reason } +func (e UploadBlobRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e UploadRequestValidationError) Cause() error { return e.cause } +func (e UploadBlobRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e UploadRequestValidationError) Key() bool { return e.key } +func (e UploadBlobRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e UploadRequestValidationError) ErrorName() string { return "UploadRequestValidationError" } +func (e UploadBlobRequestValidationError) ErrorName() string { + return "UploadBlobRequestValidationError" +} // Error satisfies the builtin error interface -func (e UploadRequestValidationError) Error() string { +func (e UploadBlobRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -151,14 +153,14 @@ func (e UploadRequestValidationError) Error() string { } return fmt.Sprintf( - "invalid %sUploadRequest.%s: %s%s", + "invalid %sUploadBlobRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = UploadRequestValidationError{} +var _ error = UploadBlobRequestValidationError{} var _ interface { Field() string @@ -166,24 +168,24 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = UploadRequestValidationError{} +} = UploadBlobRequestValidationError{} -// Validate checks the field values on UploadResponse 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 *UploadResponse) Validate() error { +// Validate checks the field values on UploadBlobResponse 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 *UploadBlobResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on UploadResponse 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 UploadResponseMultiError, -// or nil if none found. -func (m *UploadResponse) ValidateAll() error { +// ValidateAll checks the field values on UploadBlobResponse 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 +// UploadBlobResponseMultiError, or nil if none found. +func (m *UploadBlobResponse) ValidateAll() error { return m.validate(true) } -func (m *UploadResponse) validate(all bool) error { +func (m *UploadBlobResponse) validate(all bool) error { if m == nil { return nil } @@ -194,7 +196,7 @@ func (m *UploadResponse) validate(all bool) error { switch v := interface{}(m.GetBlob()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, UploadResponseValidationError{ + errors = append(errors, UploadBlobResponseValidationError{ field: "Blob", reason: "embedded message failed validation", cause: err, @@ -202,7 +204,7 @@ func (m *UploadResponse) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, UploadResponseValidationError{ + errors = append(errors, UploadBlobResponseValidationError{ field: "Blob", reason: "embedded message failed validation", cause: err, @@ -211,7 +213,7 @@ func (m *UploadResponse) validate(all bool) error { } } else if v, ok := interface{}(m.GetBlob()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return UploadResponseValidationError{ + return UploadBlobResponseValidationError{ field: "Blob", reason: "embedded message failed validation", cause: err, @@ -220,19 +222,19 @@ func (m *UploadResponse) validate(all bool) error { } if len(errors) > 0 { - return UploadResponseMultiError(errors) + return UploadBlobResponseMultiError(errors) } return nil } -// UploadResponseMultiError is an error wrapping multiple validation errors -// returned by UploadResponse.ValidateAll() if the designated constraints +// UploadBlobResponseMultiError is an error wrapping multiple validation errors +// returned by UploadBlobResponse.ValidateAll() if the designated constraints // aren't met. -type UploadResponseMultiError []error +type UploadBlobResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m UploadResponseMultiError) Error() string { +func (m UploadBlobResponseMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -241,11 +243,11 @@ func (m UploadResponseMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m UploadResponseMultiError) AllErrors() []error { return m } +func (m UploadBlobResponseMultiError) AllErrors() []error { return m } -// UploadResponseValidationError is the validation error returned by -// UploadResponse.Validate if the designated constraints aren't met. -type UploadResponseValidationError struct { +// UploadBlobResponseValidationError is the validation error returned by +// UploadBlobResponse.Validate if the designated constraints aren't met. +type UploadBlobResponseValidationError struct { field string reason string cause error @@ -253,22 +255,24 @@ type UploadResponseValidationError struct { } // Field function returns field value. -func (e UploadResponseValidationError) Field() string { return e.field } +func (e UploadBlobResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e UploadResponseValidationError) Reason() string { return e.reason } +func (e UploadBlobResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e UploadResponseValidationError) Cause() error { return e.cause } +func (e UploadBlobResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e UploadResponseValidationError) Key() bool { return e.key } +func (e UploadBlobResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e UploadResponseValidationError) ErrorName() string { return "UploadResponseValidationError" } +func (e UploadBlobResponseValidationError) ErrorName() string { + return "UploadBlobResponseValidationError" +} // Error satisfies the builtin error interface -func (e UploadResponseValidationError) Error() string { +func (e UploadBlobResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -280,14 +284,14 @@ func (e UploadResponseValidationError) Error() string { } return fmt.Sprintf( - "invalid %sUploadResponse.%s: %s%s", + "invalid %sUploadBlobResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = UploadResponseValidationError{} +var _ error = UploadBlobResponseValidationError{} var _ interface { Field() string @@ -295,24 +299,24 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = UploadResponseValidationError{} +} = UploadBlobResponseValidationError{} -// Validate checks the field values on GetInfoRequest 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 *GetInfoRequest) Validate() error { +// Validate checks the field values on GetBlobInfoRequest 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 *GetBlobInfoRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on GetInfoRequest 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 GetInfoRequestMultiError, -// or nil if none found. -func (m *GetInfoRequest) ValidateAll() error { +// ValidateAll checks the field values on GetBlobInfoRequest 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 +// GetBlobInfoRequestMultiError, or nil if none found. +func (m *GetBlobInfoRequest) ValidateAll() error { return m.validate(true) } -func (m *GetInfoRequest) validate(all bool) error { +func (m *GetBlobInfoRequest) validate(all bool) error { if m == nil { return nil } @@ -323,7 +327,7 @@ func (m *GetInfoRequest) validate(all bool) error { switch v := interface{}(m.GetBlobId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, GetInfoRequestValidationError{ + errors = append(errors, GetBlobInfoRequestValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -331,7 +335,7 @@ func (m *GetInfoRequest) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, GetInfoRequestValidationError{ + errors = append(errors, GetBlobInfoRequestValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -340,7 +344,7 @@ func (m *GetInfoRequest) validate(all bool) error { } } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return GetInfoRequestValidationError{ + return GetBlobInfoRequestValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -349,19 +353,19 @@ func (m *GetInfoRequest) validate(all bool) error { } if len(errors) > 0 { - return GetInfoRequestMultiError(errors) + return GetBlobInfoRequestMultiError(errors) } return nil } -// GetInfoRequestMultiError is an error wrapping multiple validation errors -// returned by GetInfoRequest.ValidateAll() if the designated constraints +// GetBlobInfoRequestMultiError is an error wrapping multiple validation errors +// returned by GetBlobInfoRequest.ValidateAll() if the designated constraints // aren't met. -type GetInfoRequestMultiError []error +type GetBlobInfoRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m GetInfoRequestMultiError) Error() string { +func (m GetBlobInfoRequestMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -370,11 +374,11 @@ func (m GetInfoRequestMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m GetInfoRequestMultiError) AllErrors() []error { return m } +func (m GetBlobInfoRequestMultiError) AllErrors() []error { return m } -// GetInfoRequestValidationError is the validation error returned by -// GetInfoRequest.Validate if the designated constraints aren't met. -type GetInfoRequestValidationError struct { +// GetBlobInfoRequestValidationError is the validation error returned by +// GetBlobInfoRequest.Validate if the designated constraints aren't met. +type GetBlobInfoRequestValidationError struct { field string reason string cause error @@ -382,22 +386,24 @@ type GetInfoRequestValidationError struct { } // Field function returns field value. -func (e GetInfoRequestValidationError) Field() string { return e.field } +func (e GetBlobInfoRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e GetInfoRequestValidationError) Reason() string { return e.reason } +func (e GetBlobInfoRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e GetInfoRequestValidationError) Cause() error { return e.cause } +func (e GetBlobInfoRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e GetInfoRequestValidationError) Key() bool { return e.key } +func (e GetBlobInfoRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e GetInfoRequestValidationError) ErrorName() string { return "GetInfoRequestValidationError" } +func (e GetBlobInfoRequestValidationError) ErrorName() string { + return "GetBlobInfoRequestValidationError" +} // Error satisfies the builtin error interface -func (e GetInfoRequestValidationError) Error() string { +func (e GetBlobInfoRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -409,14 +415,14 @@ func (e GetInfoRequestValidationError) Error() string { } return fmt.Sprintf( - "invalid %sGetInfoRequest.%s: %s%s", + "invalid %sGetBlobInfoRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = GetInfoRequestValidationError{} +var _ error = GetBlobInfoRequestValidationError{} var _ interface { Field() string @@ -424,24 +430,24 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = GetInfoRequestValidationError{} +} = GetBlobInfoRequestValidationError{} -// Validate checks the field values on GetInfoResponse 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 *GetInfoResponse) Validate() error { +// Validate checks the field values on GetBlobInfoResponse 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 *GetBlobInfoResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on GetInfoResponse with the rules +// ValidateAll checks the field values on GetBlobInfoResponse 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 -// GetInfoResponseMultiError, or nil if none found. -func (m *GetInfoResponse) ValidateAll() error { +// GetBlobInfoResponseMultiError, or nil if none found. +func (m *GetBlobInfoResponse) ValidateAll() error { return m.validate(true) } -func (m *GetInfoResponse) validate(all bool) error { +func (m *GetBlobInfoResponse) validate(all bool) error { if m == nil { return nil } @@ -452,7 +458,7 @@ func (m *GetInfoResponse) validate(all bool) error { switch v := interface{}(m.GetBlob()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, GetInfoResponseValidationError{ + errors = append(errors, GetBlobInfoResponseValidationError{ field: "Blob", reason: "embedded message failed validation", cause: err, @@ -460,7 +466,7 @@ func (m *GetInfoResponse) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, GetInfoResponseValidationError{ + errors = append(errors, GetBlobInfoResponseValidationError{ field: "Blob", reason: "embedded message failed validation", cause: err, @@ -469,7 +475,7 @@ func (m *GetInfoResponse) validate(all bool) error { } } else if v, ok := interface{}(m.GetBlob()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return GetInfoResponseValidationError{ + return GetBlobInfoResponseValidationError{ field: "Blob", reason: "embedded message failed validation", cause: err, @@ -478,19 +484,19 @@ func (m *GetInfoResponse) validate(all bool) error { } if len(errors) > 0 { - return GetInfoResponseMultiError(errors) + return GetBlobInfoResponseMultiError(errors) } return nil } -// GetInfoResponseMultiError is an error wrapping multiple validation errors -// returned by GetInfoResponse.ValidateAll() if the designated constraints -// aren't met. -type GetInfoResponseMultiError []error +// GetBlobInfoResponseMultiError is an error wrapping multiple validation +// errors returned by GetBlobInfoResponse.ValidateAll() if the designated +// constraints aren't met. +type GetBlobInfoResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m GetInfoResponseMultiError) Error() string { +func (m GetBlobInfoResponseMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -499,11 +505,11 @@ func (m GetInfoResponseMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m GetInfoResponseMultiError) AllErrors() []error { return m } +func (m GetBlobInfoResponseMultiError) AllErrors() []error { return m } -// GetInfoResponseValidationError is the validation error returned by -// GetInfoResponse.Validate if the designated constraints aren't met. -type GetInfoResponseValidationError struct { +// GetBlobInfoResponseValidationError is the validation error returned by +// GetBlobInfoResponse.Validate if the designated constraints aren't met. +type GetBlobInfoResponseValidationError struct { field string reason string cause error @@ -511,22 +517,24 @@ type GetInfoResponseValidationError struct { } // Field function returns field value. -func (e GetInfoResponseValidationError) Field() string { return e.field } +func (e GetBlobInfoResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e GetInfoResponseValidationError) Reason() string { return e.reason } +func (e GetBlobInfoResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e GetInfoResponseValidationError) Cause() error { return e.cause } +func (e GetBlobInfoResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e GetInfoResponseValidationError) Key() bool { return e.key } +func (e GetBlobInfoResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e GetInfoResponseValidationError) ErrorName() string { return "GetInfoResponseValidationError" } +func (e GetBlobInfoResponseValidationError) ErrorName() string { + return "GetBlobInfoResponseValidationError" +} // Error satisfies the builtin error interface -func (e GetInfoResponseValidationError) Error() string { +func (e GetBlobInfoResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -538,14 +546,14 @@ func (e GetInfoResponseValidationError) Error() string { } return fmt.Sprintf( - "invalid %sGetInfoResponse.%s: %s%s", + "invalid %sGetBlobInfoResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = GetInfoResponseValidationError{} +var _ error = GetBlobInfoResponseValidationError{} var _ interface { Field() string @@ -553,4 +561,4 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = GetInfoResponseValidationError{} +} = GetBlobInfoResponseValidationError{} diff --git a/generated/go/blob/v1/blob_service_grpc.pb.go b/generated/go/blob/v1/blob_service_grpc.pb.go index af5b38e..7b2ff46 100644 --- a/generated/go/blob/v1/blob_service_grpc.pb.go +++ b/generated/go/blob/v1/blob_service_grpc.pb.go @@ -19,143 +19,143 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - Blob_Upload_FullMethodName = "/flipchat.blob.v1.Blob/Upload" - Blob_GetInfo_FullMethodName = "/flipchat.blob.v1.Blob/GetInfo" + BlobService_Upload_FullMethodName = "/flipchat.blob.v1.BlobService/Upload" + BlobService_GetInfo_FullMethodName = "/flipchat.blob.v1.BlobService/GetInfo" ) -// BlobClient is the client API for Blob service. +// BlobServiceClient is the client API for BlobService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BlobClient interface { +type BlobServiceClient interface { // Request for a smaller/single-shot upload - Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) + Upload(ctx context.Context, in *UploadBlobRequest, opts ...grpc.CallOption) (*UploadBlobResponse, error) // Get the metadata for a previously uploaded blob - GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) + GetInfo(ctx context.Context, in *GetBlobInfoRequest, opts ...grpc.CallOption) (*GetBlobInfoResponse, error) } -type blobClient struct { +type blobServiceClient struct { cc grpc.ClientConnInterface } -func NewBlobClient(cc grpc.ClientConnInterface) BlobClient { - return &blobClient{cc} +func NewBlobServiceClient(cc grpc.ClientConnInterface) BlobServiceClient { + return &blobServiceClient{cc} } -func (c *blobClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) { +func (c *blobServiceClient) Upload(ctx context.Context, in *UploadBlobRequest, opts ...grpc.CallOption) (*UploadBlobResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UploadResponse) - err := c.cc.Invoke(ctx, Blob_Upload_FullMethodName, in, out, cOpts...) + out := new(UploadBlobResponse) + err := c.cc.Invoke(ctx, BlobService_Upload_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *blobClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { +func (c *blobServiceClient) GetInfo(ctx context.Context, in *GetBlobInfoRequest, opts ...grpc.CallOption) (*GetBlobInfoResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, Blob_GetInfo_FullMethodName, in, out, cOpts...) + out := new(GetBlobInfoResponse) + err := c.cc.Invoke(ctx, BlobService_GetInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -// BlobServer is the server API for Blob service. -// All implementations must embed UnimplementedBlobServer +// BlobServiceServer is the server API for BlobService service. +// All implementations must embed UnimplementedBlobServiceServer // for forward compatibility. -type BlobServer interface { +type BlobServiceServer interface { // Request for a smaller/single-shot upload - Upload(context.Context, *UploadRequest) (*UploadResponse, error) + Upload(context.Context, *UploadBlobRequest) (*UploadBlobResponse, error) // Get the metadata for a previously uploaded blob - GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) - mustEmbedUnimplementedBlobServer() + GetInfo(context.Context, *GetBlobInfoRequest) (*GetBlobInfoResponse, error) + mustEmbedUnimplementedBlobServiceServer() } -// UnimplementedBlobServer must be embedded to have +// UnimplementedBlobServiceServer must be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil // pointer dereference when methods are called. -type UnimplementedBlobServer struct{} +type UnimplementedBlobServiceServer struct{} -func (UnimplementedBlobServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error) { +func (UnimplementedBlobServiceServer) Upload(context.Context, *UploadBlobRequest) (*UploadBlobResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented") } -func (UnimplementedBlobServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { +func (UnimplementedBlobServiceServer) GetInfo(context.Context, *GetBlobInfoRequest) (*GetBlobInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") } -func (UnimplementedBlobServer) mustEmbedUnimplementedBlobServer() {} -func (UnimplementedBlobServer) testEmbeddedByValue() {} +func (UnimplementedBlobServiceServer) mustEmbedUnimplementedBlobServiceServer() {} +func (UnimplementedBlobServiceServer) testEmbeddedByValue() {} -// UnsafeBlobServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BlobServer will +// UnsafeBlobServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BlobServiceServer will // result in compilation errors. -type UnsafeBlobServer interface { - mustEmbedUnimplementedBlobServer() +type UnsafeBlobServiceServer interface { + mustEmbedUnimplementedBlobServiceServer() } -func RegisterBlobServer(s grpc.ServiceRegistrar, srv BlobServer) { - // If the following call pancis, it indicates UnimplementedBlobServer was +func RegisterBlobServiceServer(s grpc.ServiceRegistrar, srv BlobServiceServer) { + // If the following call pancis, it indicates UnimplementedBlobServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { t.testEmbeddedByValue() } - s.RegisterService(&Blob_ServiceDesc, srv) + s.RegisterService(&BlobService_ServiceDesc, srv) } -func _Blob_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadRequest) +func _BlobService_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadBlobRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BlobServer).Upload(ctx, in) + return srv.(BlobServiceServer).Upload(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Blob_Upload_FullMethodName, + FullMethod: BlobService_Upload_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BlobServer).Upload(ctx, req.(*UploadRequest)) + return srv.(BlobServiceServer).Upload(ctx, req.(*UploadBlobRequest)) } return interceptor(ctx, in, info, handler) } -func _Blob_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInfoRequest) +func _BlobService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlobInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BlobServer).GetInfo(ctx, in) + return srv.(BlobServiceServer).GetInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Blob_GetInfo_FullMethodName, + FullMethod: BlobService_GetInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BlobServer).GetInfo(ctx, req.(*GetInfoRequest)) + return srv.(BlobServiceServer).GetInfo(ctx, req.(*GetBlobInfoRequest)) } return interceptor(ctx, in, info, handler) } -// Blob_ServiceDesc is the grpc.ServiceDesc for Blob service. +// BlobService_ServiceDesc is the grpc.ServiceDesc for BlobService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var Blob_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "flipchat.blob.v1.Blob", - HandlerType: (*BlobServer)(nil), +var BlobService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "flipchat.blob.v1.BlobService", + HandlerType: (*BlobServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Upload", - Handler: _Blob_Upload_Handler, + Handler: _BlobService_Upload_Handler, }, { MethodName: "GetInfo", - Handler: _Blob_GetInfo_Handler, + Handler: _BlobService_GetInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, diff --git a/generated/go/blob/v1/model.pb.go b/generated/go/blob/v1/model.pb.go index 835e9a0..0ddb361 100644 --- a/generated/go/blob/v1/model.pb.go +++ b/generated/go/blob/v1/model.pb.go @@ -74,8 +74,7 @@ func (BlobType) EnumDescriptor() ([]byte, []int) { return file_blob_v1_model_proto_rawDescGZIP(), []int{0} } -// Common blob info returned in responses -type BlobMetadata struct { +type Blob struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -87,20 +86,20 @@ type BlobMetadata struct { CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` } -func (x *BlobMetadata) Reset() { - *x = BlobMetadata{} +func (x *Blob) Reset() { + *x = Blob{} mi := &file_blob_v1_model_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *BlobMetadata) String() string { +func (x *Blob) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BlobMetadata) ProtoMessage() {} +func (*Blob) ProtoMessage() {} -func (x *BlobMetadata) ProtoReflect() protoreflect.Message { +func (x *Blob) ProtoReflect() protoreflect.Message { mi := &file_blob_v1_model_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -112,40 +111,40 @@ func (x *BlobMetadata) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BlobMetadata.ProtoReflect.Descriptor instead. -func (*BlobMetadata) Descriptor() ([]byte, []int) { +// Deprecated: Use Blob.ProtoReflect.Descriptor instead. +func (*Blob) Descriptor() ([]byte, []int) { return file_blob_v1_model_proto_rawDescGZIP(), []int{0} } -func (x *BlobMetadata) GetBlobId() *v1.BlobId { +func (x *Blob) GetBlobId() *v1.BlobId { if x != nil { return x.BlobId } return nil } -func (x *BlobMetadata) GetBlobType() BlobType { +func (x *Blob) GetBlobType() BlobType { if x != nil { return x.BlobType } return BlobType_BLOB_TYPE_UNKNOWN } -func (x *BlobMetadata) GetOwnerId() *v1.UserId { +func (x *Blob) GetOwnerId() *v1.UserId { if x != nil { return x.OwnerId } return nil } -func (x *BlobMetadata) GetS3Url() string { +func (x *Blob) GetS3Url() string { if x != nil { return x.S3Url } return "" } -func (x *BlobMetadata) GetCreatedAt() *timestamppb.Timestamp { +func (x *Blob) GetCreatedAt() *timestamppb.Timestamp { if x != nil { return x.CreatedAt } @@ -161,37 +160,37 @@ var file_blob_v1_model_proto_rawDesc = []byte{ 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 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, 0x85, 0x02, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x62, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, - 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, - 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x33, 0x5f, 0x75, 0x72, 0x6c, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x33, 0x55, 0x72, 0x6c, 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, 0x2a, 0x60, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x42, - 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x01, - 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x49, - 0x44, 0x45, 0x4f, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x03, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, - 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, - 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, - 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, - 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, - 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, - 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0xfd, 0x01, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, + 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, + 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, + 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, + 0x0a, 0x06, 0x73, 0x33, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x73, 0x33, 0x55, 0x72, 0x6c, 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, + 0x2a, 0x60, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, + 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x02, 0x12, 0x13, 0x0a, + 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x4f, + 0x10, 0x03, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, + 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, + 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, + 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -210,16 +209,16 @@ var file_blob_v1_model_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_blob_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_blob_v1_model_proto_goTypes = []any{ (BlobType)(0), // 0: flipchat.blob.v1.BlobType - (*BlobMetadata)(nil), // 1: flipchat.blob.v1.BlobMetadata + (*Blob)(nil), // 1: flipchat.blob.v1.Blob (*v1.BlobId)(nil), // 2: flipchat.common.v1.BlobId (*v1.UserId)(nil), // 3: flipchat.common.v1.UserId (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp } var file_blob_v1_model_proto_depIdxs = []int32{ - 2, // 0: flipchat.blob.v1.BlobMetadata.blob_id:type_name -> flipchat.common.v1.BlobId - 0, // 1: flipchat.blob.v1.BlobMetadata.blob_type:type_name -> flipchat.blob.v1.BlobType - 3, // 2: flipchat.blob.v1.BlobMetadata.owner_id:type_name -> flipchat.common.v1.UserId - 4, // 3: flipchat.blob.v1.BlobMetadata.created_at:type_name -> google.protobuf.Timestamp + 2, // 0: flipchat.blob.v1.Blob.blob_id:type_name -> flipchat.common.v1.BlobId + 0, // 1: flipchat.blob.v1.Blob.blob_type:type_name -> flipchat.blob.v1.BlobType + 3, // 2: flipchat.blob.v1.Blob.owner_id:type_name -> flipchat.common.v1.UserId + 4, // 3: flipchat.blob.v1.Blob.created_at:type_name -> google.protobuf.Timestamp 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name diff --git a/generated/go/blob/v1/model.pb.validate.go b/generated/go/blob/v1/model.pb.validate.go index 7f06e83..26b84fb 100644 --- a/generated/go/blob/v1/model.pb.validate.go +++ b/generated/go/blob/v1/model.pb.validate.go @@ -35,22 +35,21 @@ var ( _ = sort.Sort ) -// Validate checks the field values on BlobMetadata 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 *BlobMetadata) Validate() error { +// Validate checks the field values on Blob 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 *Blob) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on BlobMetadata 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 BlobMetadataMultiError, or -// nil if none found. -func (m *BlobMetadata) ValidateAll() error { +// ValidateAll checks the field values on Blob 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 BlobMultiError, or nil if none found. +func (m *Blob) ValidateAll() error { return m.validate(true) } -func (m *BlobMetadata) validate(all bool) error { +func (m *Blob) validate(all bool) error { if m == nil { return nil } @@ -61,7 +60,7 @@ func (m *BlobMetadata) validate(all bool) error { switch v := interface{}(m.GetBlobId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobMetadataValidationError{ + errors = append(errors, BlobValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -69,7 +68,7 @@ func (m *BlobMetadata) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, BlobMetadataValidationError{ + errors = append(errors, BlobValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -78,7 +77,7 @@ func (m *BlobMetadata) validate(all bool) error { } } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return BlobMetadataValidationError{ + return BlobValidationError{ field: "BlobId", reason: "embedded message failed validation", cause: err, @@ -92,7 +91,7 @@ func (m *BlobMetadata) validate(all bool) error { switch v := interface{}(m.GetOwnerId()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobMetadataValidationError{ + errors = append(errors, BlobValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -100,7 +99,7 @@ func (m *BlobMetadata) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, BlobMetadataValidationError{ + errors = append(errors, BlobValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -109,7 +108,7 @@ func (m *BlobMetadata) validate(all bool) error { } } else if v, ok := interface{}(m.GetOwnerId()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return BlobMetadataValidationError{ + return BlobValidationError{ field: "OwnerId", reason: "embedded message failed validation", cause: err, @@ -123,7 +122,7 @@ func (m *BlobMetadata) validate(all bool) error { switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, BlobMetadataValidationError{ + errors = append(errors, BlobValidationError{ field: "CreatedAt", reason: "embedded message failed validation", cause: err, @@ -131,7 +130,7 @@ func (m *BlobMetadata) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, BlobMetadataValidationError{ + errors = append(errors, BlobValidationError{ field: "CreatedAt", reason: "embedded message failed validation", cause: err, @@ -140,7 +139,7 @@ func (m *BlobMetadata) validate(all bool) error { } } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return BlobMetadataValidationError{ + return BlobValidationError{ field: "CreatedAt", reason: "embedded message failed validation", cause: err, @@ -149,18 +148,18 @@ func (m *BlobMetadata) validate(all bool) error { } if len(errors) > 0 { - return BlobMetadataMultiError(errors) + return BlobMultiError(errors) } return nil } -// BlobMetadataMultiError is an error wrapping multiple validation errors -// returned by BlobMetadata.ValidateAll() if the designated constraints aren't met. -type BlobMetadataMultiError []error +// BlobMultiError is an error wrapping multiple validation errors returned by +// Blob.ValidateAll() if the designated constraints aren't met. +type BlobMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m BlobMetadataMultiError) Error() string { +func (m BlobMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -169,11 +168,11 @@ func (m BlobMetadataMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m BlobMetadataMultiError) AllErrors() []error { return m } +func (m BlobMultiError) AllErrors() []error { return m } -// BlobMetadataValidationError is the validation error returned by -// BlobMetadata.Validate if the designated constraints aren't met. -type BlobMetadataValidationError struct { +// BlobValidationError is the validation error returned by Blob.Validate if the +// designated constraints aren't met. +type BlobValidationError struct { field string reason string cause error @@ -181,22 +180,22 @@ type BlobMetadataValidationError struct { } // Field function returns field value. -func (e BlobMetadataValidationError) Field() string { return e.field } +func (e BlobValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e BlobMetadataValidationError) Reason() string { return e.reason } +func (e BlobValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e BlobMetadataValidationError) Cause() error { return e.cause } +func (e BlobValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e BlobMetadataValidationError) Key() bool { return e.key } +func (e BlobValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e BlobMetadataValidationError) ErrorName() string { return "BlobMetadataValidationError" } +func (e BlobValidationError) ErrorName() string { return "BlobValidationError" } // Error satisfies the builtin error interface -func (e BlobMetadataValidationError) Error() string { +func (e BlobValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -208,14 +207,14 @@ func (e BlobMetadataValidationError) Error() string { } return fmt.Sprintf( - "invalid %sBlobMetadata.%s: %s%s", + "invalid %sBlob.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = BlobMetadataValidationError{} +var _ error = BlobValidationError{} var _ interface { Field() string @@ -223,4 +222,4 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = BlobMetadataValidationError{} +} = BlobValidationError{} diff --git a/proto/blob/v1/blob_service.proto b/proto/blob/v1/blob_service.proto index f8fb0a4..f1a2734 100644 --- a/proto/blob/v1/blob_service.proto +++ b/proto/blob/v1/blob_service.proto @@ -9,31 +9,31 @@ option objc_class_prefix = "FCPBBlobV1"; import "common/v1/common.proto"; import "blob/v1/model.proto"; -service Blob { +service BlobService { // Request for a smaller/single-shot upload - rpc Upload (UploadRequest) returns (UploadResponse); + rpc Upload (UploadBlobRequest) returns (UploadBlobResponse); // Get the metadata for a previously uploaded blob - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); + rpc GetInfo (GetBlobInfoRequest) returns (GetBlobInfoResponse); } // Request for a smaller/single-shot upload -message UploadRequest { +message UploadBlobRequest { common.v1.UserId owner_id = 1; BlobType blob_type = 2; bytes raw_data = 3; } // Single-shot upload response -message UploadResponse { - BlobMetadata blob = 1; +message UploadBlobResponse { + Blob blob = 1; } // Retrieve existing blob info -message GetInfoRequest { +message GetBlobInfoRequest { common.v1.BlobId blob_id = 1; } -message GetInfoResponse { - BlobMetadata blob = 1; +message GetBlobInfoResponse { + Blob blob = 1; } diff --git a/proto/blob/v1/model.proto b/proto/blob/v1/model.proto index 3a1a5cc..a93496b 100644 --- a/proto/blob/v1/model.proto +++ b/proto/blob/v1/model.proto @@ -14,12 +14,9 @@ enum BlobType { BLOB_TYPE_IMAGE = 1; BLOB_TYPE_VIDEO = 2; BLOB_TYPE_AUDIO = 3; - - // Additional types like can be added as needed } -// Common blob info returned in responses -message BlobMetadata { +message Blob { common.v1.BlobId blob_id = 1; BlobType blob_type = 2; From e5f6faa93aeff6e367aa997567fa6dccf5c29b0a Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Fri, 24 Jan 2025 11:31:06 -0500 Subject: [PATCH 5/7] blob:added validation and auth --- generated/go/blob/v1/blob_service.pb.go | 136 ++++++++++-------- .../go/blob/v1/blob_service.pb.validate.go | 73 +++++++++- proto/blob/v1/blob_service.proto | 14 +- 3 files changed, 161 insertions(+), 62 deletions(-) diff --git a/generated/go/blob/v1/blob_service.pb.go b/generated/go/blob/v1/blob_service.pb.go index 50fd82a..c43999b 100644 --- a/generated/go/blob/v1/blob_service.pb.go +++ b/generated/go/blob/v1/blob_service.pb.go @@ -8,6 +8,7 @@ package blobpb import ( v1 "github.com/code-payments/flipchat-protobuf-api/generated/go/common/v1" + _ "github.com/envoyproxy/protoc-gen-validate/validate" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -29,7 +30,9 @@ type UploadBlobRequest struct { OwnerId *v1.UserId `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` - RawData []byte `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` + // 4Mb max (keep in mind that grpc messages are limited to 4Mb total) + RawData []byte `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"` + Auth *v1.Auth `protobuf:"bytes,4,opt,name=auth,proto3" json:"auth,omitempty"` } func (x *UploadBlobRequest) Reset() { @@ -83,6 +86,13 @@ func (x *UploadBlobRequest) GetRawData() []byte { return nil } +func (x *UploadBlobRequest) GetAuth() *v1.Auth { + if x != nil { + return x.Auth + } + return nil +} + // Single-shot upload response type UploadBlobResponse struct { state protoimpl.MessageState @@ -228,50 +238,58 @@ var file_blob_v1_blob_service_proto_rawDesc = []byte{ 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x2f, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a, 0x11, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, - 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x62, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x22, 0x40, 0x0a, 0x12, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x49, - 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, - 0x64, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x13, 0x47, 0x65, 0x74, - 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, + 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, + 0x10, 0x01, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x62, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x27, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x7a, 0x07, 0x10, 0x01, 0x18, + 0x80, 0x80, 0x80, 0x02, 0x52, 0x07, 0x72, 0x61, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, 0x0a, + 0x04, 0x61, 0x75, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, + 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x41, 0x75, 0x74, 0x68, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, + 0x04, 0x61, 0x75, 0x74, 0x68, 0x22, 0x40, 0x0a, 0x12, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, + 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, + 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, + 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x53, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6c, + 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, + 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x13, + 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, + 0xba, 0x01, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x53, 0x0a, 0x06, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, - 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x32, 0xba, 0x01, 0x0a, - 0x0b, 0x42, 0x6c, 0x6f, 0x62, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x06, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x6c, - 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, - 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, - 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, - 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, - 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, - 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, - 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x24, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x7b, 0x0a, 0x20, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, + 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, + 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, + 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, + 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, + 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -294,24 +312,26 @@ var file_blob_v1_blob_service_proto_goTypes = []any{ (*GetBlobInfoResponse)(nil), // 3: flipchat.blob.v1.GetBlobInfoResponse (*v1.UserId)(nil), // 4: flipchat.common.v1.UserId (BlobType)(0), // 5: flipchat.blob.v1.BlobType - (*Blob)(nil), // 6: flipchat.blob.v1.Blob - (*v1.BlobId)(nil), // 7: flipchat.common.v1.BlobId + (*v1.Auth)(nil), // 6: flipchat.common.v1.Auth + (*Blob)(nil), // 7: flipchat.blob.v1.Blob + (*v1.BlobId)(nil), // 8: flipchat.common.v1.BlobId } var file_blob_v1_blob_service_proto_depIdxs = []int32{ 4, // 0: flipchat.blob.v1.UploadBlobRequest.owner_id:type_name -> flipchat.common.v1.UserId 5, // 1: flipchat.blob.v1.UploadBlobRequest.blob_type:type_name -> flipchat.blob.v1.BlobType - 6, // 2: flipchat.blob.v1.UploadBlobResponse.blob:type_name -> flipchat.blob.v1.Blob - 7, // 3: flipchat.blob.v1.GetBlobInfoRequest.blob_id:type_name -> flipchat.common.v1.BlobId - 6, // 4: flipchat.blob.v1.GetBlobInfoResponse.blob:type_name -> flipchat.blob.v1.Blob - 0, // 5: flipchat.blob.v1.BlobService.Upload:input_type -> flipchat.blob.v1.UploadBlobRequest - 2, // 6: flipchat.blob.v1.BlobService.GetInfo:input_type -> flipchat.blob.v1.GetBlobInfoRequest - 1, // 7: flipchat.blob.v1.BlobService.Upload:output_type -> flipchat.blob.v1.UploadBlobResponse - 3, // 8: flipchat.blob.v1.BlobService.GetInfo:output_type -> flipchat.blob.v1.GetBlobInfoResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 6, // 2: flipchat.blob.v1.UploadBlobRequest.auth:type_name -> flipchat.common.v1.Auth + 7, // 3: flipchat.blob.v1.UploadBlobResponse.blob:type_name -> flipchat.blob.v1.Blob + 8, // 4: flipchat.blob.v1.GetBlobInfoRequest.blob_id:type_name -> flipchat.common.v1.BlobId + 7, // 5: flipchat.blob.v1.GetBlobInfoResponse.blob:type_name -> flipchat.blob.v1.Blob + 0, // 6: flipchat.blob.v1.BlobService.Upload:input_type -> flipchat.blob.v1.UploadBlobRequest + 2, // 7: flipchat.blob.v1.BlobService.GetInfo:input_type -> flipchat.blob.v1.GetBlobInfoRequest + 1, // 8: flipchat.blob.v1.BlobService.Upload:output_type -> flipchat.blob.v1.UploadBlobResponse + 3, // 9: flipchat.blob.v1.BlobService.GetInfo:output_type -> flipchat.blob.v1.GetBlobInfoResponse + 8, // [8:10] is the sub-list for method output_type + 6, // [6:8] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_blob_v1_blob_service_proto_init() } diff --git a/generated/go/blob/v1/blob_service.pb.validate.go b/generated/go/blob/v1/blob_service.pb.validate.go index 73afae4..7a71c9d 100644 --- a/generated/go/blob/v1/blob_service.pb.validate.go +++ b/generated/go/blob/v1/blob_service.pb.validate.go @@ -57,6 +57,17 @@ func (m *UploadBlobRequest) validate(all bool) error { var errors []error + if m.GetOwnerId() == nil { + err := UploadBlobRequestValidationError{ + field: "OwnerId", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + if all { switch v := interface{}(m.GetOwnerId()).(type) { case interface{ ValidateAll() error }: @@ -88,7 +99,56 @@ func (m *UploadBlobRequest) validate(all bool) error { // no validation rules for BlobType - // no validation rules for RawData + if l := len(m.GetRawData()); l < 1 || l > 4194304 { + err := UploadBlobRequestValidationError{ + field: "RawData", + reason: "value length must be between 1 and 4194304 bytes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetAuth() == nil { + err := UploadBlobRequestValidationError{ + field: "Auth", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAuth()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UploadBlobRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadBlobRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAuth()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UploadBlobRequestValidationError{ + field: "Auth", + reason: "embedded message failed validation", + cause: err, + } + } + } if len(errors) > 0 { return UploadBlobRequestMultiError(errors) @@ -323,6 +383,17 @@ func (m *GetBlobInfoRequest) validate(all bool) error { var errors []error + if m.GetBlobId() == nil { + err := GetBlobInfoRequestValidationError{ + field: "BlobId", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + if all { switch v := interface{}(m.GetBlobId()).(type) { case interface{ ValidateAll() error }: diff --git a/proto/blob/v1/blob_service.proto b/proto/blob/v1/blob_service.proto index f1a2734..2b1207c 100644 --- a/proto/blob/v1/blob_service.proto +++ b/proto/blob/v1/blob_service.proto @@ -8,6 +8,7 @@ option objc_class_prefix = "FCPBBlobV1"; import "common/v1/common.proto"; import "blob/v1/model.proto"; +import "validate/validate.proto"; service BlobService { // Request for a smaller/single-shot upload @@ -19,9 +20,16 @@ service BlobService { // Request for a smaller/single-shot upload message UploadBlobRequest { - common.v1.UserId owner_id = 1; + common.v1.UserId owner_id = 1 [(validate.rules).message.required = true]; BlobType blob_type = 2; - bytes raw_data = 3; + + // 4Mb max (keep in mind that grpc messages are limited to 4Mb total) + bytes raw_data = 3 [(validate.rules).bytes = { + min_len: 1 + max_len: 4194304 + }]; + + common.v1.Auth auth = 4 [(validate.rules).message.required = true]; } // Single-shot upload response @@ -31,7 +39,7 @@ message UploadBlobResponse { // Retrieve existing blob info message GetBlobInfoRequest { - common.v1.BlobId blob_id = 1; + common.v1.BlobId blob_id = 1 [(validate.rules).message.required = true]; } message GetBlobInfoResponse { From 14320bee820670016df5b3b903112d39759342ae Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Fri, 24 Jan 2025 14:35:44 -0500 Subject: [PATCH 6/7] blob: added blob metadata --- generated/go/blob/v1/model.pb.go | 207 ++++++++++-- generated/go/blob/v1/model.pb.validate.go | 259 +++++++++++++++ generated/go/common/v1/common.pb.go | 231 ++++++++++++-- generated/go/common/v1/common.pb.validate.go | 311 +++++++++++++++++++ proto/blob/v1/model.proto | 13 +- proto/common/v1/common.proto | 16 + 6 files changed, 978 insertions(+), 59 deletions(-) diff --git a/generated/go/blob/v1/model.pb.go b/generated/go/blob/v1/model.pb.go index 0ddb361..73be8fb 100644 --- a/generated/go/blob/v1/model.pb.go +++ b/generated/go/blob/v1/model.pb.go @@ -83,7 +83,8 @@ type Blob struct { BlobType BlobType `protobuf:"varint,2,opt,name=blob_type,json=blobType,proto3,enum=flipchat.blob.v1.BlobType" json:"blob_type,omitempty"` OwnerId *v1.UserId `protobuf:"bytes,3,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` S3Url string `protobuf:"bytes,4,opt,name=s3_url,json=s3Url,proto3" json:"s3_url,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Metadata *Blob_Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` } func (x *Blob) Reset() { @@ -144,6 +145,13 @@ func (x *Blob) GetS3Url() string { return "" } +func (x *Blob) GetMetadata() *Blob_Metadata { + if x != nil { + return x.Metadata + } + return nil +} + func (x *Blob) GetCreatedAt() *timestamppb.Timestamp { if x != nil { return x.CreatedAt @@ -151,6 +159,107 @@ func (x *Blob) GetCreatedAt() *timestamppb.Timestamp { return nil } +type Blob_Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // Types that are assignable to Info: + // + // *Blob_Metadata_Image + // *Blob_Metadata_Video + // *Blob_Metadata_Audio + Info isBlob_Metadata_Info `protobuf_oneof:"info"` +} + +func (x *Blob_Metadata) Reset() { + *x = Blob_Metadata{} + mi := &file_blob_v1_model_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Blob_Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Blob_Metadata) ProtoMessage() {} + +func (x *Blob_Metadata) ProtoReflect() protoreflect.Message { + mi := &file_blob_v1_model_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Blob_Metadata.ProtoReflect.Descriptor instead. +func (*Blob_Metadata) Descriptor() ([]byte, []int) { + return file_blob_v1_model_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Blob_Metadata) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (m *Blob_Metadata) GetInfo() isBlob_Metadata_Info { + if m != nil { + return m.Info + } + return nil +} + +func (x *Blob_Metadata) GetImage() *v1.ImageInfo { + if x, ok := x.GetInfo().(*Blob_Metadata_Image); ok { + return x.Image + } + return nil +} + +func (x *Blob_Metadata) GetVideo() *v1.VideoInfo { + if x, ok := x.GetInfo().(*Blob_Metadata_Video); ok { + return x.Video + } + return nil +} + +func (x *Blob_Metadata) GetAudio() *v1.AudioInfo { + if x, ok := x.GetInfo().(*Blob_Metadata_Audio); ok { + return x.Audio + } + return nil +} + +type isBlob_Metadata_Info interface { + isBlob_Metadata_Info() +} + +type Blob_Metadata_Image struct { + Image *v1.ImageInfo `protobuf:"bytes,2,opt,name=image,proto3,oneof"` +} + +type Blob_Metadata_Video struct { + Video *v1.VideoInfo `protobuf:"bytes,3,opt,name=video,proto3,oneof"` +} + +type Blob_Metadata_Audio struct { + Audio *v1.AudioInfo `protobuf:"bytes,4,opt,name=audio,proto3,oneof"` +} + +func (*Blob_Metadata_Image) isBlob_Metadata_Info() {} + +func (*Blob_Metadata_Video) isBlob_Metadata_Info() {} + +func (*Blob_Metadata_Audio) isBlob_Metadata_Info() {} + var File_blob_v1_model_proto protoreflect.FileDescriptor var file_blob_v1_model_proto_rawDesc = []byte{ @@ -160,7 +269,7 @@ var file_blob_v1_model_proto_rawDesc = []byte{ 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 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, 0xfd, 0x01, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, + 0x22, 0x8e, 0x04, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x37, @@ -172,25 +281,42 @@ var file_blob_v1_model_proto_rawDesc = []byte{ 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x52, 0x07, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x33, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x73, 0x33, 0x55, 0x72, 0x6c, 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, - 0x2a, 0x60, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, - 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x02, 0x12, 0x13, 0x0a, - 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x4f, - 0x10, 0x03, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, - 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x62, - 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x62, - 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x33, 0x55, 0x72, 0x6c, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x06, 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, 0x1a, 0xd1, 0x01, + 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, + 0x69, 0x64, 0x65, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x69, 0x64, 0x65, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x05, 0x76, 0x69, 0x64, + 0x65, 0x6f, 0x12, 0x35, 0x0a, 0x05, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1d, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x49, 0x6e, 0x66, 0x6f, + 0x48, 0x00, 0x52, 0x05, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x69, 0x6e, 0x66, + 0x6f, 0x2a, 0x60, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, + 0x11, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x4c, 0x4f, + 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x02, 0x12, 0x13, + 0x0a, 0x0f, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x55, 0x44, 0x49, + 0x4f, 0x10, 0x03, 0x42, 0x7b, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, + 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, + 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x76, 0x31, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, + 0x62, 0x70, 0x62, 0xa2, 0x02, 0x0a, 0x46, 0x43, 0x50, 0x42, 0x42, 0x6c, 0x6f, 0x62, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -206,24 +332,32 @@ func file_blob_v1_model_proto_rawDescGZIP() []byte { } var file_blob_v1_model_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_blob_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_blob_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_blob_v1_model_proto_goTypes = []any{ (BlobType)(0), // 0: flipchat.blob.v1.BlobType (*Blob)(nil), // 1: flipchat.blob.v1.Blob - (*v1.BlobId)(nil), // 2: flipchat.common.v1.BlobId - (*v1.UserId)(nil), // 3: flipchat.common.v1.UserId - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*Blob_Metadata)(nil), // 2: flipchat.blob.v1.Blob.Metadata + (*v1.BlobId)(nil), // 3: flipchat.common.v1.BlobId + (*v1.UserId)(nil), // 4: flipchat.common.v1.UserId + (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp + (*v1.ImageInfo)(nil), // 6: flipchat.common.v1.ImageInfo + (*v1.VideoInfo)(nil), // 7: flipchat.common.v1.VideoInfo + (*v1.AudioInfo)(nil), // 8: flipchat.common.v1.AudioInfo } var file_blob_v1_model_proto_depIdxs = []int32{ - 2, // 0: flipchat.blob.v1.Blob.blob_id:type_name -> flipchat.common.v1.BlobId + 3, // 0: flipchat.blob.v1.Blob.blob_id:type_name -> flipchat.common.v1.BlobId 0, // 1: flipchat.blob.v1.Blob.blob_type:type_name -> flipchat.blob.v1.BlobType - 3, // 2: flipchat.blob.v1.Blob.owner_id:type_name -> flipchat.common.v1.UserId - 4, // 3: flipchat.blob.v1.Blob.created_at:type_name -> google.protobuf.Timestamp - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 4, // 2: flipchat.blob.v1.Blob.owner_id:type_name -> flipchat.common.v1.UserId + 2, // 3: flipchat.blob.v1.Blob.metadata:type_name -> flipchat.blob.v1.Blob.Metadata + 5, // 4: flipchat.blob.v1.Blob.created_at:type_name -> google.protobuf.Timestamp + 6, // 5: flipchat.blob.v1.Blob.Metadata.image:type_name -> flipchat.common.v1.ImageInfo + 7, // 6: flipchat.blob.v1.Blob.Metadata.video:type_name -> flipchat.common.v1.VideoInfo + 8, // 7: flipchat.blob.v1.Blob.Metadata.audio:type_name -> flipchat.common.v1.AudioInfo + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_blob_v1_model_proto_init() } @@ -231,13 +365,18 @@ func file_blob_v1_model_proto_init() { if File_blob_v1_model_proto != nil { return } + file_blob_v1_model_proto_msgTypes[1].OneofWrappers = []any{ + (*Blob_Metadata_Image)(nil), + (*Blob_Metadata_Video)(nil), + (*Blob_Metadata_Audio)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_blob_v1_model_proto_rawDesc, NumEnums: 1, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, diff --git a/generated/go/blob/v1/model.pb.validate.go b/generated/go/blob/v1/model.pb.validate.go index 26b84fb..a86a650 100644 --- a/generated/go/blob/v1/model.pb.validate.go +++ b/generated/go/blob/v1/model.pb.validate.go @@ -118,6 +118,35 @@ func (m *Blob) validate(all bool) error { // no validation rules for S3Url + if all { + switch v := interface{}(m.GetMetadata()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, BlobValidationError{ + field: "Metadata", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, BlobValidationError{ + field: "Metadata", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return BlobValidationError{ + field: "Metadata", + reason: "embedded message failed validation", + cause: err, + } + } + } + if all { switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: @@ -223,3 +252,233 @@ var _ interface { Cause() error ErrorName() string } = BlobValidationError{} + +// Validate checks the field values on Blob_Metadata 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 *Blob_Metadata) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Blob_Metadata 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 Blob_MetadataMultiError, or +// nil if none found. +func (m *Blob_Metadata) ValidateAll() error { + return m.validate(true) +} + +func (m *Blob_Metadata) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Version + + switch v := m.Info.(type) { + case *Blob_Metadata_Image: + if v == nil { + err := Blob_MetadataValidationError{ + field: "Info", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetImage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Blob_MetadataValidationError{ + field: "Image", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Blob_MetadataValidationError{ + field: "Image", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetImage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Blob_MetadataValidationError{ + field: "Image", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Blob_Metadata_Video: + if v == nil { + err := Blob_MetadataValidationError{ + field: "Info", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetVideo()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Blob_MetadataValidationError{ + field: "Video", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Blob_MetadataValidationError{ + field: "Video", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetVideo()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Blob_MetadataValidationError{ + field: "Video", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Blob_Metadata_Audio: + if v == nil { + err := Blob_MetadataValidationError{ + field: "Info", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetAudio()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, Blob_MetadataValidationError{ + field: "Audio", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, Blob_MetadataValidationError{ + field: "Audio", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAudio()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return Blob_MetadataValidationError{ + field: "Audio", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return Blob_MetadataMultiError(errors) + } + + return nil +} + +// Blob_MetadataMultiError is an error wrapping multiple validation errors +// returned by Blob_Metadata.ValidateAll() if the designated constraints +// aren't met. +type Blob_MetadataMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m Blob_MetadataMultiError) 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 Blob_MetadataMultiError) AllErrors() []error { return m } + +// Blob_MetadataValidationError is the validation error returned by +// Blob_Metadata.Validate if the designated constraints aren't met. +type Blob_MetadataValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e Blob_MetadataValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e Blob_MetadataValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e Blob_MetadataValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e Blob_MetadataValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e Blob_MetadataValidationError) ErrorName() string { return "Blob_MetadataValidationError" } + +// Error satisfies the builtin error interface +func (e Blob_MetadataValidationError) 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 %sBlob_Metadata.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = Blob_MetadataValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = Blob_MetadataValidationError{} diff --git a/generated/go/common/v1/common.pb.go b/generated/go/common/v1/common.pb.go index 8c0d292..baab5e5 100644 --- a/generated/go/common/v1/common.pb.go +++ b/generated/go/common/v1/common.pb.go @@ -818,6 +818,173 @@ func (x *QueryOptions) GetOrder() QueryOptions_Order { return QueryOptions_ASC } +type ImageInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Width int32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + BlurHash string `protobuf:"bytes,3,opt,name=blur_hash,json=blurHash,proto3" json:"blur_hash,omitempty"` +} + +func (x *ImageInfo) Reset() { + *x = ImageInfo{} + mi := &file_common_v1_common_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImageInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageInfo) ProtoMessage() {} + +func (x *ImageInfo) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_common_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageInfo.ProtoReflect.Descriptor instead. +func (*ImageInfo) Descriptor() ([]byte, []int) { + return file_common_v1_common_proto_rawDescGZIP(), []int{14} +} + +func (x *ImageInfo) GetWidth() int32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *ImageInfo) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *ImageInfo) GetBlurHash() string { + if x != nil { + return x.BlurHash + } + return "" +} + +type VideoInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Width int32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Duration int32 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` +} + +func (x *VideoInfo) Reset() { + *x = VideoInfo{} + mi := &file_common_v1_common_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoInfo) ProtoMessage() {} + +func (x *VideoInfo) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_common_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoInfo.ProtoReflect.Descriptor instead. +func (*VideoInfo) Descriptor() ([]byte, []int) { + return file_common_v1_common_proto_rawDescGZIP(), []int{15} +} + +func (x *VideoInfo) GetWidth() int32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *VideoInfo) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *VideoInfo) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + +type AudioInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Duration int32 `protobuf:"varint,1,opt,name=duration,proto3" json:"duration,omitempty"` +} + +func (x *AudioInfo) Reset() { + *x = AudioInfo{} + mi := &file_common_v1_common_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AudioInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AudioInfo) ProtoMessage() {} + +func (x *AudioInfo) ProtoReflect() protoreflect.Message { + mi := &file_common_v1_common_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AudioInfo.ProtoReflect.Descriptor instead. +func (*AudioInfo) Descriptor() ([]byte, []int) { + return file_common_v1_common_proto_rawDescGZIP(), []int{16} +} + +func (x *AudioInfo) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + // KeyPair uses a keypair to verify a message. // // The signature should be of the encapsulating proto message, @@ -833,7 +1000,7 @@ type Auth_KeyPair struct { func (x *Auth_KeyPair) Reset() { *x = Auth_KeyPair{} - mi := &file_common_v1_common_proto_msgTypes[14] + mi := &file_common_v1_common_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -845,7 +1012,7 @@ func (x *Auth_KeyPair) String() string { func (*Auth_KeyPair) ProtoMessage() {} func (x *Auth_KeyPair) ProtoReflect() protoreflect.Message { - mi := &file_common_v1_common_proto_msgTypes[14] + mi := &file_common_v1_common_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -960,19 +1127,32 @@ var file_common_v1_common_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x53, 0x43, 0x10, - 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, 0x2a, 0x2e, 0x0a, 0x08, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x50, 0x50, 0x4c, 0x45, 0x10, 0x01, 0x12, - 0x0a, 0x0a, 0x06, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x82, 0x01, 0x0a, 0x22, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, - 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, - 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x70, 0x62, 0xa2, 0x02, 0x0b, 0x46, 0x50, 0x42, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, 0x22, 0x56, 0x0a, 0x09, 0x49, + 0x6d, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x75, 0x72, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x75, 0x72, 0x48, + 0x61, 0x73, 0x68, 0x22, 0x55, 0x0a, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x27, 0x0a, 0x09, 0x41, 0x75, + 0x64, 0x69, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2a, 0x2e, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, + 0x41, 0x50, 0x50, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x4f, 0x4f, 0x47, 0x4c, + 0x45, 0x10, 0x02, 0x42, 0x82, 0x01, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, + 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, + 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x70, 0x62, 0xa2, 0x02, 0x0b, 0x46, 0x50, 0x42, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -988,7 +1168,7 @@ func file_common_v1_common_proto_rawDescGZIP() []byte { } var file_common_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_common_v1_common_proto_goTypes = []any{ (Platform)(0), // 0: flipchat.common.v1.Platform (QueryOptions_Order)(0), // 1: flipchat.common.v1.QueryOptions.Order @@ -1006,15 +1186,18 @@ var file_common_v1_common_proto_goTypes = []any{ (*ClientPong)(nil), // 13: flipchat.common.v1.ClientPong (*PagingToken)(nil), // 14: flipchat.common.v1.PagingToken (*QueryOptions)(nil), // 15: flipchat.common.v1.QueryOptions - (*Auth_KeyPair)(nil), // 16: flipchat.common.v1.Auth.KeyPair - (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 18: google.protobuf.Duration + (*ImageInfo)(nil), // 16: flipchat.common.v1.ImageInfo + (*VideoInfo)(nil), // 17: flipchat.common.v1.VideoInfo + (*AudioInfo)(nil), // 18: flipchat.common.v1.AudioInfo + (*Auth_KeyPair)(nil), // 19: flipchat.common.v1.Auth.KeyPair + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 21: google.protobuf.Duration } var file_common_v1_common_proto_depIdxs = []int32{ - 16, // 0: flipchat.common.v1.Auth.key_pair:type_name -> flipchat.common.v1.Auth.KeyPair - 17, // 1: flipchat.common.v1.ServerPing.timestamp:type_name -> google.protobuf.Timestamp - 18, // 2: flipchat.common.v1.ServerPing.ping_delay:type_name -> google.protobuf.Duration - 17, // 3: flipchat.common.v1.ClientPong.timestamp:type_name -> google.protobuf.Timestamp + 19, // 0: flipchat.common.v1.Auth.key_pair:type_name -> flipchat.common.v1.Auth.KeyPair + 20, // 1: flipchat.common.v1.ServerPing.timestamp:type_name -> google.protobuf.Timestamp + 21, // 2: flipchat.common.v1.ServerPing.ping_delay:type_name -> google.protobuf.Duration + 20, // 3: flipchat.common.v1.ClientPong.timestamp:type_name -> google.protobuf.Timestamp 14, // 4: flipchat.common.v1.QueryOptions.paging_token:type_name -> flipchat.common.v1.PagingToken 1, // 5: flipchat.common.v1.QueryOptions.order:type_name -> flipchat.common.v1.QueryOptions.Order 8, // 6: flipchat.common.v1.Auth.KeyPair.pub_key:type_name -> flipchat.common.v1.PublicKey @@ -1040,7 +1223,7 @@ func file_common_v1_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_common_v1_common_proto_rawDesc, NumEnums: 2, - NumMessages: 15, + NumMessages: 18, NumExtensions: 0, NumServices: 0, }, diff --git a/generated/go/common/v1/common.pb.validate.go b/generated/go/common/v1/common.pb.validate.go index 61b4345..3081864 100644 --- a/generated/go/common/v1/common.pb.validate.go +++ b/generated/go/common/v1/common.pb.validate.go @@ -1653,6 +1653,317 @@ var _ interface { ErrorName() string } = QueryOptionsValidationError{} +// Validate checks the field values on ImageInfo 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 *ImageInfo) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ImageInfo 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 ImageInfoMultiError, or nil +// if none found. +func (m *ImageInfo) ValidateAll() error { + return m.validate(true) +} + +func (m *ImageInfo) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Width + + // no validation rules for Height + + // no validation rules for BlurHash + + if len(errors) > 0 { + return ImageInfoMultiError(errors) + } + + return nil +} + +// ImageInfoMultiError is an error wrapping multiple validation errors returned +// by ImageInfo.ValidateAll() if the designated constraints aren't met. +type ImageInfoMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ImageInfoMultiError) 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 ImageInfoMultiError) AllErrors() []error { return m } + +// ImageInfoValidationError is the validation error returned by +// ImageInfo.Validate if the designated constraints aren't met. +type ImageInfoValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ImageInfoValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ImageInfoValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ImageInfoValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ImageInfoValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ImageInfoValidationError) ErrorName() string { return "ImageInfoValidationError" } + +// Error satisfies the builtin error interface +func (e ImageInfoValidationError) 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 %sImageInfo.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ImageInfoValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ImageInfoValidationError{} + +// Validate checks the field values on VideoInfo 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 *VideoInfo) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on VideoInfo 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 VideoInfoMultiError, or nil +// if none found. +func (m *VideoInfo) ValidateAll() error { + return m.validate(true) +} + +func (m *VideoInfo) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Width + + // no validation rules for Height + + // no validation rules for Duration + + if len(errors) > 0 { + return VideoInfoMultiError(errors) + } + + return nil +} + +// VideoInfoMultiError is an error wrapping multiple validation errors returned +// by VideoInfo.ValidateAll() if the designated constraints aren't met. +type VideoInfoMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m VideoInfoMultiError) 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 VideoInfoMultiError) AllErrors() []error { return m } + +// VideoInfoValidationError is the validation error returned by +// VideoInfo.Validate if the designated constraints aren't met. +type VideoInfoValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e VideoInfoValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e VideoInfoValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e VideoInfoValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e VideoInfoValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e VideoInfoValidationError) ErrorName() string { return "VideoInfoValidationError" } + +// Error satisfies the builtin error interface +func (e VideoInfoValidationError) 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 %sVideoInfo.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = VideoInfoValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = VideoInfoValidationError{} + +// Validate checks the field values on AudioInfo 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 *AudioInfo) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AudioInfo 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 AudioInfoMultiError, or nil +// if none found. +func (m *AudioInfo) ValidateAll() error { + return m.validate(true) +} + +func (m *AudioInfo) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Duration + + if len(errors) > 0 { + return AudioInfoMultiError(errors) + } + + return nil +} + +// AudioInfoMultiError is an error wrapping multiple validation errors returned +// by AudioInfo.ValidateAll() if the designated constraints aren't met. +type AudioInfoMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AudioInfoMultiError) 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 AudioInfoMultiError) AllErrors() []error { return m } + +// AudioInfoValidationError is the validation error returned by +// AudioInfo.Validate if the designated constraints aren't met. +type AudioInfoValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AudioInfoValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AudioInfoValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AudioInfoValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AudioInfoValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AudioInfoValidationError) ErrorName() string { return "AudioInfoValidationError" } + +// Error satisfies the builtin error interface +func (e AudioInfoValidationError) 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 %sAudioInfo.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AudioInfoValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AudioInfoValidationError{} + // Validate checks the field values on Auth_KeyPair 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. diff --git a/proto/blob/v1/model.proto b/proto/blob/v1/model.proto index a93496b..b13ed38 100644 --- a/proto/blob/v1/model.proto +++ b/proto/blob/v1/model.proto @@ -22,7 +22,18 @@ message Blob { common.v1.UserId owner_id = 3; string s3_url = 4; + Metadata metadata = 5; - google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp created_at = 6; + + message Metadata { + int32 version = 1; + + oneof info { + common.v1.ImageInfo image = 2; + common.v1.VideoInfo video = 3; + common.v1.AudioInfo audio = 4; + } + } } diff --git a/proto/common/v1/common.proto b/proto/common/v1/common.proto index 1ddbda9..64bfd55 100644 --- a/proto/common/v1/common.proto +++ b/proto/common/v1/common.proto @@ -144,3 +144,19 @@ enum Platform { APPLE = 1; GOOGLE = 2; } + +message ImageInfo { + int32 width = 1; + int32 height = 2; + string blur_hash = 3; +} + +message VideoInfo { + int32 width = 1; + int32 height = 2; + int32 duration = 3; +} + +message AudioInfo { + int32 duration = 1; +} From fab4e43f096ba05b39a0190fab03146b3133db93 Mon Sep 17 00:00:00 2001 From: Zelimir Fedoran Date: Fri, 24 Jan 2025 14:53:58 -0500 Subject: [PATCH 7/7] added support for pointing to a blob from a message --- generated/go/messaging/v1/model.pb.go | 384 +++++++++--- .../go/messaging/v1/model.pb.validate.go | 554 ++++++++++++++++++ proto/messaging/v1/model.proto | 38 ++ 3 files changed, 901 insertions(+), 75 deletions(-) diff --git a/generated/go/messaging/v1/model.pb.go b/generated/go/messaging/v1/model.pb.go index 9525129..4dc92bf 100644 --- a/generated/go/messaging/v1/model.pb.go +++ b/generated/go/messaging/v1/model.pb.go @@ -417,6 +417,9 @@ type Content struct { // *Content_Reply // *Content_Tip // *Content_Deleted + // *Content_Image + // *Content_Video + // *Content_Audio Type isContent_Type `protobuf_oneof:"type"` } @@ -499,6 +502,27 @@ func (x *Content) GetDeleted() *DeleteMessageContent { return nil } +func (x *Content) GetImage() *ImageContent { + if x, ok := x.GetType().(*Content_Image); ok { + return x.Image + } + return nil +} + +func (x *Content) GetVideo() *VideoContent { + if x, ok := x.GetType().(*Content_Video); ok { + return x.Video + } + return nil +} + +func (x *Content) GetAudio() *AudioContent { + if x, ok := x.GetType().(*Content_Audio); ok { + return x.Audio + } + return nil +} + type isContent_Type interface { isContent_Type() } @@ -527,6 +551,18 @@ type Content_Deleted struct { Deleted *DeleteMessageContent `protobuf:"bytes,8,opt,name=deleted,proto3,oneof"` } +type Content_Image struct { + Image *ImageContent `protobuf:"bytes,20,opt,name=image,proto3,oneof"` // Image with optional caption +} + +type Content_Video struct { + Video *VideoContent `protobuf:"bytes,30,opt,name=video,proto3,oneof"` // Not implemented (placeholder) +} + +type Content_Audio struct { + Audio *AudioContent `protobuf:"bytes,40,opt,name=audio,proto3,oneof"` // Not implemented (placeholder) +} + func (*Content_Text) isContent_Type() {} func (*Content_LocalizedAnnouncement) isContent_Type() {} @@ -539,6 +575,12 @@ func (*Content_Tip) isContent_Type() {} func (*Content_Deleted) isContent_Type() {} +func (*Content_Image) isContent_Type() {} + +func (*Content_Video) isContent_Type() {} + +func (*Content_Audio) isContent_Type() {} + // Raw text content type TextContent struct { state protoimpl.MessageState @@ -846,6 +888,156 @@ func (x *DeleteMessageContent) GetOriginalMessageId() *MessageId { return nil } +// Image content +type ImageContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The blob_id of the previously uploaded image + BlobId *v1.BlobId `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` + // The caption text for the image (optional) + CaptionText string `protobuf:"bytes,2,opt,name=caption_text,json=captionText,proto3" json:"caption_text,omitempty"` +} + +func (x *ImageContent) Reset() { + *x = ImageContent{} + mi := &file_messaging_v1_model_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ImageContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImageContent) ProtoMessage() {} + +func (x *ImageContent) ProtoReflect() protoreflect.Message { + mi := &file_messaging_v1_model_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImageContent.ProtoReflect.Descriptor instead. +func (*ImageContent) Descriptor() ([]byte, []int) { + return file_messaging_v1_model_proto_rawDescGZIP(), []int{13} +} + +func (x *ImageContent) GetBlobId() *v1.BlobId { + if x != nil { + return x.BlobId + } + return nil +} + +func (x *ImageContent) GetCaptionText() string { + if x != nil { + return x.CaptionText + } + return "" +} + +// Video content +type VideoContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The blob_id of the previously uploaded video + BlobId *v1.BlobId `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` +} + +func (x *VideoContent) Reset() { + *x = VideoContent{} + mi := &file_messaging_v1_model_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *VideoContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VideoContent) ProtoMessage() {} + +func (x *VideoContent) ProtoReflect() protoreflect.Message { + mi := &file_messaging_v1_model_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VideoContent.ProtoReflect.Descriptor instead. +func (*VideoContent) Descriptor() ([]byte, []int) { + return file_messaging_v1_model_proto_rawDescGZIP(), []int{14} +} + +func (x *VideoContent) GetBlobId() *v1.BlobId { + if x != nil { + return x.BlobId + } + return nil +} + +// Audio content +type AudioContent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The blob_id of the previously uploaded audio + BlobId *v1.BlobId `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` +} + +func (x *AudioContent) Reset() { + *x = AudioContent{} + mi := &file_messaging_v1_model_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AudioContent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AudioContent) ProtoMessage() {} + +func (x *AudioContent) ProtoReflect() protoreflect.Message { + mi := &file_messaging_v1_model_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AudioContent.ProtoReflect.Descriptor instead. +func (*AudioContent) Descriptor() ([]byte, []int) { + return file_messaging_v1_model_proto_rawDescGZIP(), []int{15} +} + +func (x *AudioContent) GetBlobId() *v1.BlobId { + if x != nil { + return x.BlobId + } + return nil +} + var File_messaging_v1_model_proto protoreflect.FileDescriptor var file_messaging_v1_model_proto_rawDesc = []byte{ @@ -907,7 +1099,7 @@ var file_messaging_v1_model_proto_rawDesc = []byte{ 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x69, 0x73, 0x54, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x22, 0xcd, 0x03, 0x0a, 0x07, 0x43, 0x6f, + 0x08, 0x69, 0x73, 0x54, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x84, 0x05, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x78, 0x74, @@ -935,63 +1127,92 @@ var file_messaging_v1_model_proto_rawDesc = []byte{ 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, - 0x42, 0x0b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x4a, 0x04, 0x08, - 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0x2d, 0x0a, 0x0b, 0x54, 0x65, 0x78, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, - 0x80, 0x08, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x4a, 0x0a, 0x1c, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, - 0x6f, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, - 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x08, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x4f, 0x72, - 0x54, 0x65, 0x78, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, - 0x01, 0x52, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x10, 0x52, 0x05, - 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x22, 0x95, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, - 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x49, 0x64, 0x12, 0x29, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x74, 0x65, 0x78, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, - 0x80, 0x08, 0x52, 0x09, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x54, 0x65, 0x78, 0x74, 0x22, 0xb4, 0x01, - 0x0a, 0x0a, 0x54, 0x69, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, 0x13, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x12, 0x3b, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, + 0x05, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x48, 0x00, 0x52, 0x05, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x12, 0x3b, 0x0a, 0x05, 0x61, 0x75, + 0x64, 0x69, 0x6f, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, - 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x0a, 0x74, 0x69, 0x70, 0x5f, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x66, - 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, - 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x74, 0x69, 0x70, 0x41, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x72, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, 0x13, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, - 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x8f, 0x01, 0x0a, 0x25, 0x63, 0x6f, 0x6d, - 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, - 0x76, 0x31, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x66, 0x6c, 0x69, - 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x61, - 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x67, 0x6f, 0x2f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xa2, 0x02, 0x0f, 0x46, 0x43, 0x50, 0x42, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x00, + 0x52, 0x05, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x42, 0x0b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x03, 0xf8, 0x42, 0x01, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, + 0x22, 0x2d, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x1e, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x08, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, + 0x4a, 0x0a, 0x1c, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x41, 0x6e, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x2a, 0x0a, 0x0b, 0x6b, 0x65, 0x79, 0x5f, 0x6f, 0x72, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x08, + 0x52, 0x09, 0x6b, 0x65, 0x79, 0x4f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x0f, + 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x5a, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, + 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x08, + 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x05, 0x65, + 0x6d, 0x6f, 0x6a, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, + 0x04, 0x10, 0x01, 0x18, 0x10, 0x52, 0x05, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x22, 0x95, 0x01, 0x0a, + 0x0c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, + 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, + 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x0a, 0x72, 0x65, 0x70, + 0x6c, 0x79, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, + 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x08, 0x52, 0x09, 0x72, 0x65, 0x70, 0x6c, 0x79, + 0x54, 0x65, 0x78, 0x74, 0x22, 0xb4, 0x01, 0x0a, 0x0a, 0x54, 0x69, 0x70, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, + 0x4a, 0x0a, 0x0a, 0x74, 0x69, 0x70, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x09, 0x74, 0x69, 0x70, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x72, 0x0a, 0x14, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x12, 0x5a, 0x0a, 0x13, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x11, 0x6f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, + 0x7c, 0x0a, 0x0c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x3d, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x12, 0x2d, + 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x00, 0x18, 0x80, 0x08, + 0x52, 0x0b, 0x63, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x78, 0x74, 0x22, 0x4d, 0x0a, + 0x0c, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, + 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, + 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x0c, + 0x41, 0x75, 0x64, 0x69, 0x6f, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x07, + 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, + 0x02, 0x10, 0x01, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x64, 0x42, 0x8f, 0x01, 0x0a, 0x25, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x63, 0x2e, 0x66, 0x6c, 0x69, 0x70, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x67, 0x65, 0x6e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, + 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x5a, 0x54, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x64, 0x65, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, + 0x66, 0x6c, 0x69, 0x70, 0x63, 0x68, 0x61, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2f, + 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x70, 0x62, 0xa2, 0x02, 0x0f, 0x46, 0x43, + 0x50, 0x42, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1007,7 +1228,7 @@ func file_messaging_v1_model_proto_rawDescGZIP() []byte { } var file_messaging_v1_model_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_messaging_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_messaging_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_messaging_v1_model_proto_goTypes = []any{ (Pointer_Type)(0), // 0: flipchat.messaging.v1.Pointer.Type (*MessageId)(nil), // 1: flipchat.messaging.v1.MessageId @@ -1023,36 +1244,46 @@ var file_messaging_v1_model_proto_goTypes = []any{ (*ReplyContent)(nil), // 11: flipchat.messaging.v1.ReplyContent (*TipContent)(nil), // 12: flipchat.messaging.v1.TipContent (*DeleteMessageContent)(nil), // 13: flipchat.messaging.v1.DeleteMessageContent - (*v1.UserId)(nil), // 14: flipchat.common.v1.UserId - (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp - (*v1.PaymentAmount)(nil), // 16: flipchat.common.v1.PaymentAmount + (*ImageContent)(nil), // 14: flipchat.messaging.v1.ImageContent + (*VideoContent)(nil), // 15: flipchat.messaging.v1.VideoContent + (*AudioContent)(nil), // 16: flipchat.messaging.v1.AudioContent + (*v1.UserId)(nil), // 17: flipchat.common.v1.UserId + (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp + (*v1.PaymentAmount)(nil), // 19: flipchat.common.v1.PaymentAmount + (*v1.BlobId)(nil), // 20: flipchat.common.v1.BlobId } var file_messaging_v1_model_proto_depIdxs = []int32{ 1, // 0: flipchat.messaging.v1.MessageIdBatch.message_ids:type_name -> flipchat.messaging.v1.MessageId 1, // 1: flipchat.messaging.v1.Message.message_id:type_name -> flipchat.messaging.v1.MessageId - 14, // 2: flipchat.messaging.v1.Message.sender_id:type_name -> flipchat.common.v1.UserId + 17, // 2: flipchat.messaging.v1.Message.sender_id:type_name -> flipchat.common.v1.UserId 7, // 3: flipchat.messaging.v1.Message.content:type_name -> flipchat.messaging.v1.Content - 15, // 4: flipchat.messaging.v1.Message.ts:type_name -> google.protobuf.Timestamp + 18, // 4: flipchat.messaging.v1.Message.ts:type_name -> google.protobuf.Timestamp 3, // 5: flipchat.messaging.v1.MessageBatch.messages:type_name -> flipchat.messaging.v1.Message 0, // 6: flipchat.messaging.v1.Pointer.type:type_name -> flipchat.messaging.v1.Pointer.Type 1, // 7: flipchat.messaging.v1.Pointer.value:type_name -> flipchat.messaging.v1.MessageId - 14, // 8: flipchat.messaging.v1.IsTyping.user_id:type_name -> flipchat.common.v1.UserId + 17, // 8: flipchat.messaging.v1.IsTyping.user_id:type_name -> flipchat.common.v1.UserId 8, // 9: flipchat.messaging.v1.Content.text:type_name -> flipchat.messaging.v1.TextContent 9, // 10: flipchat.messaging.v1.Content.localized_announcement:type_name -> flipchat.messaging.v1.LocalizedAnnouncementContent 10, // 11: flipchat.messaging.v1.Content.reaction:type_name -> flipchat.messaging.v1.ReactionContent 11, // 12: flipchat.messaging.v1.Content.reply:type_name -> flipchat.messaging.v1.ReplyContent 12, // 13: flipchat.messaging.v1.Content.tip:type_name -> flipchat.messaging.v1.TipContent 13, // 14: flipchat.messaging.v1.Content.deleted:type_name -> flipchat.messaging.v1.DeleteMessageContent - 1, // 15: flipchat.messaging.v1.ReactionContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId - 1, // 16: flipchat.messaging.v1.ReplyContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId - 1, // 17: flipchat.messaging.v1.TipContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId - 16, // 18: flipchat.messaging.v1.TipContent.tip_amount:type_name -> flipchat.common.v1.PaymentAmount - 1, // 19: flipchat.messaging.v1.DeleteMessageContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId - 20, // [20:20] is the sub-list for method output_type - 20, // [20:20] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 14, // 15: flipchat.messaging.v1.Content.image:type_name -> flipchat.messaging.v1.ImageContent + 15, // 16: flipchat.messaging.v1.Content.video:type_name -> flipchat.messaging.v1.VideoContent + 16, // 17: flipchat.messaging.v1.Content.audio:type_name -> flipchat.messaging.v1.AudioContent + 1, // 18: flipchat.messaging.v1.ReactionContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId + 1, // 19: flipchat.messaging.v1.ReplyContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId + 1, // 20: flipchat.messaging.v1.TipContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId + 19, // 21: flipchat.messaging.v1.TipContent.tip_amount:type_name -> flipchat.common.v1.PaymentAmount + 1, // 22: flipchat.messaging.v1.DeleteMessageContent.original_message_id:type_name -> flipchat.messaging.v1.MessageId + 20, // 23: flipchat.messaging.v1.ImageContent.blob_id:type_name -> flipchat.common.v1.BlobId + 20, // 24: flipchat.messaging.v1.VideoContent.blob_id:type_name -> flipchat.common.v1.BlobId + 20, // 25: flipchat.messaging.v1.AudioContent.blob_id:type_name -> flipchat.common.v1.BlobId + 26, // [26:26] is the sub-list for method output_type + 26, // [26:26] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_messaging_v1_model_proto_init() } @@ -1067,6 +1298,9 @@ func file_messaging_v1_model_proto_init() { (*Content_Reply)(nil), (*Content_Tip)(nil), (*Content_Deleted)(nil), + (*Content_Image)(nil), + (*Content_Video)(nil), + (*Content_Audio)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -1074,7 +1308,7 @@ func file_messaging_v1_model_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_messaging_v1_model_proto_rawDesc, NumEnums: 1, - NumMessages: 13, + NumMessages: 16, NumExtensions: 0, NumServices: 0, }, diff --git a/generated/go/messaging/v1/model.pb.validate.go b/generated/go/messaging/v1/model.pb.validate.go index ba673ce..3ff7b3c 100644 --- a/generated/go/messaging/v1/model.pb.validate.go +++ b/generated/go/messaging/v1/model.pb.validate.go @@ -1226,6 +1226,132 @@ func (m *Content) validate(all bool) error { } } + case *Content_Image: + if v == nil { + err := ContentValidationError{ + field: "Type", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofTypePresent = true + + if all { + switch v := interface{}(m.GetImage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ContentValidationError{ + field: "Image", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ContentValidationError{ + field: "Image", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetImage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ContentValidationError{ + field: "Image", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Content_Video: + if v == nil { + err := ContentValidationError{ + field: "Type", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofTypePresent = true + + if all { + switch v := interface{}(m.GetVideo()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ContentValidationError{ + field: "Video", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ContentValidationError{ + field: "Video", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetVideo()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ContentValidationError{ + field: "Video", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *Content_Audio: + if v == nil { + err := ContentValidationError{ + field: "Type", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofTypePresent = true + + if all { + switch v := interface{}(m.GetAudio()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ContentValidationError{ + field: "Audio", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ContentValidationError{ + field: "Audio", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetAudio()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ContentValidationError{ + field: "Audio", + reason: "embedded message failed validation", + cause: err, + } + } + } + default: _ = v // ensures v is used } @@ -2162,3 +2288,431 @@ var _ interface { Cause() error ErrorName() string } = DeleteMessageContentValidationError{} + +// Validate checks the field values on ImageContent 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 *ImageContent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ImageContent 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 ImageContentMultiError, or +// nil if none found. +func (m *ImageContent) ValidateAll() error { + return m.validate(true) +} + +func (m *ImageContent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetBlobId() == nil { + err := ImageContentValidationError{ + field: "BlobId", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetBlobId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ImageContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ImageContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ImageContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if l := utf8.RuneCountInString(m.GetCaptionText()); l < 0 || l > 1024 { + err := ImageContentValidationError{ + field: "CaptionText", + reason: "value length must be between 0 and 1024 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ImageContentMultiError(errors) + } + + return nil +} + +// ImageContentMultiError is an error wrapping multiple validation errors +// returned by ImageContent.ValidateAll() if the designated constraints aren't met. +type ImageContentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ImageContentMultiError) 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 ImageContentMultiError) AllErrors() []error { return m } + +// ImageContentValidationError is the validation error returned by +// ImageContent.Validate if the designated constraints aren't met. +type ImageContentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ImageContentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ImageContentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ImageContentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ImageContentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ImageContentValidationError) ErrorName() string { return "ImageContentValidationError" } + +// Error satisfies the builtin error interface +func (e ImageContentValidationError) 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 %sImageContent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ImageContentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ImageContentValidationError{} + +// Validate checks the field values on VideoContent 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 *VideoContent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on VideoContent 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 VideoContentMultiError, or +// nil if none found. +func (m *VideoContent) ValidateAll() error { + return m.validate(true) +} + +func (m *VideoContent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetBlobId() == nil { + err := VideoContentValidationError{ + field: "BlobId", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetBlobId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, VideoContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, VideoContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return VideoContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return VideoContentMultiError(errors) + } + + return nil +} + +// VideoContentMultiError is an error wrapping multiple validation errors +// returned by VideoContent.ValidateAll() if the designated constraints aren't met. +type VideoContentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m VideoContentMultiError) 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 VideoContentMultiError) AllErrors() []error { return m } + +// VideoContentValidationError is the validation error returned by +// VideoContent.Validate if the designated constraints aren't met. +type VideoContentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e VideoContentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e VideoContentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e VideoContentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e VideoContentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e VideoContentValidationError) ErrorName() string { return "VideoContentValidationError" } + +// Error satisfies the builtin error interface +func (e VideoContentValidationError) 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 %sVideoContent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = VideoContentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = VideoContentValidationError{} + +// Validate checks the field values on AudioContent 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 *AudioContent) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AudioContent 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 AudioContentMultiError, or +// nil if none found. +func (m *AudioContent) ValidateAll() error { + return m.validate(true) +} + +func (m *AudioContent) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetBlobId() == nil { + err := AudioContentValidationError{ + field: "BlobId", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetBlobId()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AudioContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AudioContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetBlobId()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AudioContentValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return AudioContentMultiError(errors) + } + + return nil +} + +// AudioContentMultiError is an error wrapping multiple validation errors +// returned by AudioContent.ValidateAll() if the designated constraints aren't met. +type AudioContentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AudioContentMultiError) 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 AudioContentMultiError) AllErrors() []error { return m } + +// AudioContentValidationError is the validation error returned by +// AudioContent.Validate if the designated constraints aren't met. +type AudioContentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AudioContentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AudioContentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AudioContentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AudioContentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AudioContentValidationError) ErrorName() string { return "AudioContentValidationError" } + +// Error satisfies the builtin error interface +func (e AudioContentValidationError) 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 %sAudioContent.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AudioContentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AudioContentValidationError{} diff --git a/proto/messaging/v1/model.proto b/proto/messaging/v1/model.proto index ecc8826..4a1d0b1 100644 --- a/proto/messaging/v1/model.proto +++ b/proto/messaging/v1/model.proto @@ -93,6 +93,20 @@ message Content { ReplyContent reply = 6; TipContent tip = 7; DeleteMessageContent deleted = 8; + + // (9 - 19 Reserved for future use) + + ImageContent image = 20; // Image with optional caption + + // (21 - 29 Reserved for future use) + + VideoContent video = 30; // Not implemented (placeholder) + + // (31 - 39 Reserved for future use) + + AudioContent audio = 40; // Not implemented (placeholder) + + // (41 - 49 Reserved for future use) } reserved 3; // ExchangeDataContent @@ -155,3 +169,27 @@ message DeleteMessageContent { // The message ID of the message that was deleted MessageId original_message_id = 1 [(validate.rules).message.required = true]; } + +// Image content +message ImageContent { + // The blob_id of the previously uploaded image + common.v1.BlobId blob_id = 1 [(validate.rules).message.required = true]; + + // The caption text for the image (optional) + string caption_text = 2 [(validate.rules).string = { + min_len: 0 + max_len: 1024 + }]; +} + +// Video content +message VideoContent { + // The blob_id of the previously uploaded video + common.v1.BlobId blob_id = 1 [(validate.rules).message.required = true]; +} + +// Audio content +message AudioContent { + // The blob_id of the previously uploaded audio + common.v1.BlobId blob_id = 1 [(validate.rules).message.required = true]; +}