// Copyright Epic Games, Inc. All Rights Reserved. using HordeServer.Api; using HordeServer.Models; using HordeServer.Services; using HordeServer.Utilities; using Microsoft.Extensions.Options; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using ProjectId = HordeServer.Utilities.StringId; namespace HordeServer.Collections { /// /// Interface for a collection of project documents /// public interface IProjectCollection { /// /// Updates the project configuration /// /// The project id /// Path to the config file used to configure this project /// The config file revision /// Order of the project /// The configuration /// New project instance Task AddOrUpdateAsync(ProjectId Id, string ConfigPath, string Revision, int Order, ProjectConfig Config); /// /// Gets all the available projects /// /// List of project documents Task> FindAllAsync(); /// /// Gets a project by ID /// /// Unique id of the project /// The project document Task GetAsync(ProjectId ProjectId); /// /// Gets the logo for a project /// /// The project id /// The project logo document Task GetLogoAsync(ProjectId ProjectId); /// /// Sets the logo for a project /// /// The project id /// Path to the source file /// Revision of the file /// /// /// Task SetLogoAsync(ProjectId ProjectId, string Path, string Revision, string MimeType, byte[] Data); /// /// Gets a project's permissions info by ID /// /// Unique id of the project /// The project document Task GetPermissionsAsync(ProjectId ProjectId); /// /// Deletes a project by id /// /// Unique id of the project /// True if the project was deleted Task DeleteAsync(ProjectId ProjectId); } }