!wip work in progress for the theme presets

This commit is contained in:
Jamie 2017-11-06 16:30:44 +00:00
parent fa774784c0
commit c8f00c4e8a
11 changed files with 131 additions and 2 deletions

View file

@ -0,0 +1,25 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Ombi.Api.Github.Models;
namespace Ombi.Api.Github
{
public class GithubApi : IGithubApi
{
public GithubApi(IApi api)
{
_api = api;
}
private readonly IApi _api;
private const string BaseUrl = "https://api.github.com/";
public async Task<CakeThemesContainer> GetCakeThemes()
{
var request = new Request("repos/leram84/layer.Cake/contents/Themes", BaseUrl, HttpMethod.Get);
return await _api.Request<CakeThemesContainer>(request);
}
}
}

View file

@ -0,0 +1,10 @@
using System.Threading.Tasks;
using Ombi.Api.Github.Models;
namespace Ombi.Api.Github
{
public interface IGithubApi
{
Task<CakeThemesContainer> GetCakeThemes();
}
}

View file

@ -0,0 +1,29 @@
namespace Ombi.Api.Github.Models
{
public class CakeThemesContainer
{
public CakeThemes[] Themes { get; set; }
}
public class CakeThemes
{
public string name { get; set; }
public string path { get; set; }
public string sha { get; set; }
public int size { get; set; }
public string url { get; set; }
public string html_url { get; set; }
public string git_url { get; set; }
public string download_url { get; set; }
public string type { get; set; }
public _Links _links { get; set; }
}
public class _Links
{
public string self { get; set; }
public string git { get; set; }
public string html { get; set; }
}
}

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
</ItemGroup>
</Project>