syntax = "proto3"; option go_package = ".;proto"; package proto; service AttachmentService { rpc GetAttachment(GetAttachmentRequest) returns (GetAttachmentResponse) {} rpc ListAttachment(ListAttachmentRequest) returns (ListAttachmentResponse) {} rpc UpdateVisibility(UpdateVisibilityRequest) returns (UpdateVisibilityResponse) {} rpc UpdateUsage(UpdateUsageRequest) returns (UpdateUsageResponse) {} rpc DeleteAttachment(DeleteAttachmentRequest) returns (DeleteAttachmentResponse) {} } message GetAttachmentRequest { optional uint64 id = 1; optional string rid = 2; optional uint64 user_id = 3; } message GetAttachmentResponse { optional bytes attachment = 1; } message ListAttachmentRequest { repeated uint64 id = 1; repeated string rid = 2; optional uint64 user_id = 3; } message ListAttachmentResponse { repeated bytes attachments = 1; } message UpdateVisibilityRequest { repeated uint64 id = 1; repeated string rid = 2; bool is_indexable = 3; optional uint64 user_id = 4; } message UpdateVisibilityResponse { int32 count = 1; } message UpdateUsageRequest { repeated uint64 id = 1; repeated string rid = 2; int64 delta = 3; } message UpdateUsageResponse { int32 count = 1; } message DeleteAttachmentRequest { repeated uint64 id = 1; repeated string rid = 2; optional uint64 user_id = 3; } message DeleteAttachmentResponse { int32 count = 1; }