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..c43999b --- /dev/null +++ b/generated/go/blob/v1/blob_service.pb.go @@ -0,0 +1,361 @@ +// 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 ( + 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" + 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 UploadBlobRequest 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"` + // 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() { + *x = UploadBlobRequest{} + mi := &file_blob_v1_blob_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadBlobRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBlobRequest) ProtoMessage() {} + +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)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBlobRequest.ProtoReflect.Descriptor instead. +func (*UploadBlobRequest) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{0} +} + +func (x *UploadBlobRequest) GetOwnerId() *v1.UserId { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *UploadBlobRequest) GetBlobType() BlobType { + if x != nil { + return x.BlobType + } + return BlobType_BLOB_TYPE_UNKNOWN +} + +func (x *UploadBlobRequest) GetRawData() []byte { + if x != nil { + return x.RawData + } + 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 + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` +} + +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 *UploadBlobResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBlobResponse) ProtoMessage() {} + +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)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBlobResponse.ProtoReflect.Descriptor instead. +func (*UploadBlobResponse) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{1} +} + +func (x *UploadBlobResponse) GetBlob() *Blob { + if x != nil { + return x.Blob + } + return nil +} + +// Retrieve existing blob info +type GetBlobInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlobId *v1.BlobId `protobuf:"bytes,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` +} + +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 *GetBlobInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlobInfoRequest) ProtoMessage() {} + +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)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlobInfoRequest.ProtoReflect.Descriptor instead. +func (*GetBlobInfoRequest) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{2} +} + +func (x *GetBlobInfoRequest) GetBlobId() *v1.BlobId { + if x != nil { + return x.BlobId + } + return nil +} + +type GetBlobInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blob *Blob `protobuf:"bytes,1,opt,name=blob,proto3" json:"blob,omitempty"` +} + +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 *GetBlobInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetBlobInfoResponse) ProtoMessage() {} + +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)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetBlobInfoResponse.ProtoReflect.Descriptor instead. +func (*GetBlobInfoResponse) Descriptor() ([]byte, []int) { + return file_blob_v1_blob_service_proto_rawDescGZIP(), []int{3} +} + +func (x *GetBlobInfoResponse) 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, 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, 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, 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 ( + 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, 4) +var file_blob_v1_blob_service_proto_goTypes = []any{ + (*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 + (*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.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() } +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: 4, + 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..7a71c9d --- /dev/null +++ b/generated/go/blob/v1/blob_service.pb.validate.go @@ -0,0 +1,635 @@ +// 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 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 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 *UploadBlobRequest) validate(all bool) error { + if m == nil { + return nil + } + + 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 }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UploadBlobRequestValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadBlobRequestValidationError{ + 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 UploadBlobRequestValidationError{ + field: "OwnerId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for BlobType + + 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) + } + + return nil +} + +// UploadBlobRequestMultiError is an error wrapping multiple validation errors +// returned by UploadBlobRequest.ValidateAll() if the designated constraints +// aren't met. +type UploadBlobRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UploadBlobRequestMultiError) 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 UploadBlobRequestMultiError) AllErrors() []error { return m } + +// 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 + key bool +} + +// Field function returns field value. +func (e UploadBlobRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UploadBlobRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UploadBlobRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UploadBlobRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UploadBlobRequestValidationError) ErrorName() string { + return "UploadBlobRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UploadBlobRequestValidationError) 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 %sUploadBlobRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UploadBlobRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UploadBlobRequestValidationError{} + +// 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 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 *UploadBlobResponse) 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, UploadBlobResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UploadBlobResponseValidationError{ + 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 UploadBlobResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UploadBlobResponseMultiError(errors) + } + + return nil +} + +// UploadBlobResponseMultiError is an error wrapping multiple validation errors +// returned by UploadBlobResponse.ValidateAll() if the designated constraints +// aren't met. +type UploadBlobResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UploadBlobResponseMultiError) 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 UploadBlobResponseMultiError) AllErrors() []error { return m } + +// 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 + key bool +} + +// Field function returns field value. +func (e UploadBlobResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UploadBlobResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UploadBlobResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UploadBlobResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UploadBlobResponseValidationError) ErrorName() string { + return "UploadBlobResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UploadBlobResponseValidationError) 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 %sUploadBlobResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UploadBlobResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UploadBlobResponseValidationError{} + +// 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 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 *GetBlobInfoRequest) validate(all bool) error { + if m == nil { + return nil + } + + 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 }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetBlobInfoRequestValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetBlobInfoRequestValidationError{ + 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 GetBlobInfoRequestValidationError{ + field: "BlobId", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GetBlobInfoRequestMultiError(errors) + } + + return nil +} + +// GetBlobInfoRequestMultiError is an error wrapping multiple validation errors +// returned by GetBlobInfoRequest.ValidateAll() if the designated constraints +// aren't met. +type GetBlobInfoRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetBlobInfoRequestMultiError) 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 GetBlobInfoRequestMultiError) AllErrors() []error { return m } + +// 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 + key bool +} + +// Field function returns field value. +func (e GetBlobInfoRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetBlobInfoRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetBlobInfoRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetBlobInfoRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetBlobInfoRequestValidationError) ErrorName() string { + return "GetBlobInfoRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e GetBlobInfoRequestValidationError) 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 %sGetBlobInfoRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetBlobInfoRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetBlobInfoRequestValidationError{} + +// 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 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 +// GetBlobInfoResponseMultiError, or nil if none found. +func (m *GetBlobInfoResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetBlobInfoResponse) 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, GetBlobInfoResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetBlobInfoResponseValidationError{ + 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 GetBlobInfoResponseValidationError{ + field: "Blob", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GetBlobInfoResponseMultiError(errors) + } + + return nil +} + +// 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 GetBlobInfoResponseMultiError) 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 GetBlobInfoResponseMultiError) AllErrors() []error { return m } + +// 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 + key bool +} + +// Field function returns field value. +func (e GetBlobInfoResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetBlobInfoResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetBlobInfoResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetBlobInfoResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetBlobInfoResponseValidationError) ErrorName() string { + return "GetBlobInfoResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e GetBlobInfoResponseValidationError) 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 %sGetBlobInfoResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetBlobInfoResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetBlobInfoResponseValidationError{} 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..7b2ff46 --- /dev/null +++ b/generated/go/blob/v1/blob_service_grpc.pb.go @@ -0,0 +1,163 @@ +// 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_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 *UploadBlobRequest, opts ...grpc.CallOption) (*UploadBlobResponse, error) + // Get the metadata for a previously uploaded blob + GetInfo(ctx context.Context, in *GetBlobInfoRequest, opts ...grpc.CallOption) (*GetBlobInfoResponse, error) +} + +type blobServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewBlobServiceClient(cc grpc.ClientConnInterface) BlobServiceClient { + return &blobServiceClient{cc} +} + +func (c *blobServiceClient) Upload(ctx context.Context, in *UploadBlobRequest, opts ...grpc.CallOption) (*UploadBlobResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + 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 *blobServiceClient) GetInfo(ctx context.Context, in *GetBlobInfoRequest, opts ...grpc.CallOption) (*GetBlobInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetBlobInfoResponse) + 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, *UploadBlobRequest) (*UploadBlobResponse, error) + // Get the metadata for a previously uploaded blob + GetInfo(context.Context, *GetBlobInfoRequest) (*GetBlobInfoResponse, 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, *UploadBlobRequest) (*UploadBlobResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented") +} +func (UnimplementedBlobServiceServer) GetInfo(context.Context, *GetBlobInfoRequest) (*GetBlobInfoResponse, 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(UploadBlobRequest) + 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.(*UploadBlobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +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.(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.(*GetBlobInfoRequest)) + } + 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{}, + 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..73be8fb --- /dev/null +++ b/generated/go/blob/v1/model.pb.go @@ -0,0 +1,392 @@ +// 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 ( + 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" + 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 Blob struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 *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"` + 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() { + *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() *v1.BlobId { + 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() *v1.UserId { + if x != nil { + return x.OwnerId + } + return nil +} + +func (x *Blob) GetS3Url() string { + if x != nil { + return x.S3Url + } + 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 + } + 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{ + 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, 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, 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, + 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, 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 ( + 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, 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 + (*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{ + 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 + 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() } +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: 2, + 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..a86a650 --- /dev/null +++ b/generated/go/blob/v1/model.pb.validate.go @@ -0,0 +1,484 @@ +// 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 + + 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 + + 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 + + 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 }: + 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, + } + } + } + + 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 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 42ad16f..baab5e5 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 { @@ -773,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, @@ -788,7 +1000,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[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -800,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[13] + mi := &file_common_v1_common_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -861,70 +1073,86 @@ 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, 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 ( @@ -940,36 +1168,40 @@ 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, 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 (*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 + (*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{ - 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 + 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 - 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 +1223,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: 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 c431332..3081864 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. @@ -1544,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/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/blob/v1/blob_service.proto b/proto/blob/v1/blob_service.proto new file mode 100644 index 0000000..2b1207c --- /dev/null +++ b/proto/blob/v1/blob_service.proto @@ -0,0 +1,47 @@ +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 "common/v1/common.proto"; +import "blob/v1/model.proto"; +import "validate/validate.proto"; + +service BlobService { + // Request for a smaller/single-shot upload + rpc Upload (UploadBlobRequest) returns (UploadBlobResponse); + + // Get the metadata for a previously uploaded blob + rpc GetInfo (GetBlobInfoRequest) returns (GetBlobInfoResponse); +} + +// Request for a smaller/single-shot upload +message UploadBlobRequest { + common.v1.UserId owner_id = 1 [(validate.rules).message.required = true]; + BlobType blob_type = 2; + + // 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 +message UploadBlobResponse { + Blob blob = 1; +} + +// Retrieve existing blob info +message GetBlobInfoRequest { + common.v1.BlobId blob_id = 1 [(validate.rules).message.required = true]; +} + +message GetBlobInfoResponse { + Blob blob = 1; +} diff --git a/proto/blob/v1/model.proto b/proto/blob/v1/model.proto new file mode 100644 index 0000000..b13ed38 --- /dev/null +++ b/proto/blob/v1/model.proto @@ -0,0 +1,39 @@ +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 "common/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +enum BlobType { + BLOB_TYPE_UNKNOWN = 0; + BLOB_TYPE_IMAGE = 1; + BLOB_TYPE_VIDEO = 2; + BLOB_TYPE_AUDIO = 3; +} + +message Blob { + common.v1.BlobId blob_id = 1; + BlobType blob_type = 2; + + common.v1.UserId owner_id = 3; + string s3_url = 4; + Metadata metadata = 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 0d4a8e6..64bfd55 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 @@ -138,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; +} 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]; +}