// Copyright Epic Games, Inc. All Rights Reserved.
using EpicGames.Core;
using HordeCommon;
using HordeServer.Models;
using HordeServer.Services;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
namespace HordeServer.Collections
{
///
/// Interface for a collection of template documents
///
public interface ISoftwareCollection
{
///
/// Adds a new software revision
///
/// Zip file containing the new software
/// User that uploaded the software
/// Whether to make the software the default
/// New software instance
Task AddAsync(byte[] Data, string? User, bool Default);
///
/// Upload a software archive to the backend
///
/// Unique id of the software to update
/// Name of the current user
/// Whether the software should be the default
/// Async task
Task UpdateAsync(ObjectId Id, string? User, bool Default);
///
/// Finds all software archives matching a set of criteria
///
/// The user that uploaded the software
/// The user that made the software the default
/// Whether the software was made default
/// Index of the first result to return
/// Number of results to return
Task> FindAsync(string? UploadedByUser, string? MadeDefaultByUser, bool? MadeDefault, int Offset, int Count);
///
/// Gets a single software archive
///
/// Unique id of the file to retrieve
/// Whether to include the data
Task GetAsync(ObjectId Id, bool bIncludeData);
///
/// Finds the current default software
///
/// Whether to include the data
/// The current default software
Task GetDefaultAsync(bool bIncludeData);
///
/// Removes a software archive
///
/// Unique id of the software to delete
Task DeleteAsync(ObjectId Id);
}
}