using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using IW4MAdmin.Application.Misc;
using Newtonsoft.Json;
using RestEase;
using SharedLibraryCore.Helpers;
namespace IW4MAdmin.Application.API.Master
{
public class AuthenticationId
{
[JsonProperty("id")]
public string Id { get; set; }
}
public class TokenId
{
[JsonProperty("access_token")]
public string AccessToken { get; set; }
}
public class VersionInfo
{
[JsonProperty("current-version-stable")]
[JsonConverter(typeof(BuildNumberJsonConverter))]
public BuildNumber CurrentVersionStable { get; set; }
[JsonProperty("current-version-prerelease")]
[JsonConverter(typeof(BuildNumberJsonConverter))]
public BuildNumber CurrentVersionPrerelease { get; set; }
}
public class ResultMessage
{
[JsonProperty("message")]
public string Message { get; set; }
}
public class PluginSubscriptionContent
{
public string Content { get; set; }
public PluginType Type { get; set; }
}
///
/// Defines the capabilities of the master API
///
[Header("User-Agent", "IW4MAdmin-RestEase")]
public interface IMasterApi
{
[Header("Authorization")]
string AuthorizationToken { get; set; }
[Post("authenticate")]
Task Authenticate([Body] AuthenticationId Id);
[Post("instance/")]
[AllowAnyStatusCode]
Task> AddInstance([Body] ApiInstance instance);
[Put("instance/{id}")]
[AllowAnyStatusCode]
Task> UpdateInstance([Path] string id, [Body] ApiInstance instance);
[Get("version/{apiVersion}")]
Task GetVersion([Path] int apiVersion);
[Get("localization")]
Task> GetLocalization();
[Get("localization/{languageTag}")]
Task GetLocalization([Path("languageTag")] string languageTag);
[Get("plugin_subscriptions")]
Task> GetPluginSubscription([Query("instance_id")] Guid instanceId, [Query("subscription_id")] string subscription_id);
}
}