syntax = "proto3";

package retrom;

import 'retrom/models/game-files.proto';
import 'retrom/models/games.proto';
import 'retrom/models/metadata.proto';

service GameService {
  rpc GetGames(GetGamesRequest) returns (GetGamesResponse);
  rpc DeleteGames(DeleteGamesRequest) returns (DeleteGamesResponse);
  rpc UpdateGames(UpdateGamesRequest) returns (UpdateGamesResponse);

  rpc DeleteGameFiles(DeleteGameFilesRequest) returns (DeleteGameFilesResponse);
  rpc UpdateGameFiles(UpdateGameFilesRequest) returns (UpdateGameFilesResponse);
}

message GetGamesRequest {
  repeated int32 platform_ids = 1;
  repeated int32 ids = 2;
  optional bool with_metadata = 3;
  optional bool with_files = 4;
  optional bool include_deleted = 5;
}

message GetGamesResponse {
  repeated Game games = 1;
  repeated GameMetadata metadata = 2;
  repeated GameFile game_files = 3;
}

message DeleteGamesRequest {
  repeated int32 ids = 1;
  bool delete_from_disk = 2;
  bool blacklist_entries = 3;
}

message DeleteGamesResponse {
  repeated Game games_deleted = 1;
}

message UpdateGamesRequest {
  repeated UpdatedGame games = 1;
}

message UpdateGamesResponse {
  repeated Game games_updated = 1;
}

message DeleteGameFilesRequest {
  repeated int32 ids = 1;
  bool delete_from_disk = 2;
  bool blacklist_entries = 3;
}

message DeleteGameFilesResponse {
  repeated GameFile game_files_deleted = 1;
}

message UpdateGameFilesRequest {
  repeated UpdatedGameFile game_files = 1;
}

message UpdateGameFilesResponse {
  repeated GameFile game_files_updated = 1;
}
