Anki/proto/anki/image_occlusion.proto
Damien Elmes b37063e20a More service generation refactoring
- Dropped the protobuf extensions in favor of explicitly listing out
methods in both services if we want to implement both, as it's clearer.
- Move Service/Method wrappers into a separate crate that the various
clients can import, to easily get at the list of backend services and
their correct indices and comments.
2023-06-22 09:46:09 +10:00

73 lines
1.8 KiB
Protocol Buffer

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
syntax = "proto3";
option java_multiple_files = true;
package anki.image_occlusion;
import "anki/collection.proto";
import "anki/generic.proto";
service ImageOcclusionService {
rpc GetImageForOcclusion(GetImageForOcclusionRequest)
returns (GetImageForOcclusionResponse);
rpc AddImageOcclusionNote(AddImageOcclusionNoteRequest)
returns (collection.OpChanges);
rpc GetImageOcclusionNote(GetImageOcclusionNoteRequest)
returns (GetImageOcclusionNoteResponse);
rpc UpdateImageOcclusionNote(UpdateImageOcclusionNoteRequest)
returns (collection.OpChanges);
// Adds an I/O notetype if none exists in the collection.
rpc AddImageOcclusionNotetype(generic.Empty) returns (collection.OpChanges);
}
// Implicitly includes any of the above methods that are not listed in the
// backend service.
service BackendImageOcclusionService {}
message GetImageForOcclusionRequest {
string path = 1;
}
message GetImageForOcclusionResponse {
bytes data = 1;
string name = 2;
}
message AddImageOcclusionNoteRequest {
string image_path = 1;
string occlusions = 2;
string header = 3;
string back_extra = 4;
repeated string tags = 5;
int64 notetype_id = 6;
}
message GetImageOcclusionNoteRequest {
int64 note_id = 1;
}
message GetImageOcclusionNoteResponse {
message ImageClozeNote {
bytes image_data = 1;
string occlusions = 2;
string header = 3;
string back_extra = 4;
repeated string tags = 5;
}
oneof value {
ImageClozeNote note = 1;
string error = 2;
}
}
message UpdateImageOcclusionNoteRequest {
int64 note_id = 1;
string occlusions = 2;
string header = 3;
string back_extra = 4;
repeated string tags = 5;
}