Skip to content

Commit

Permalink
Almost finished #659
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie.Rees authored and Jamie.Rees committed Nov 7, 2016
1 parent 367ca39 commit 0950f20
Show file tree
Hide file tree
Showing 14 changed files with 543 additions and 119 deletions.
11 changes: 11 additions & 0 deletions PlexRequests.Core/IStatusChecker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Threading.Tasks;
using Octokit;
using PlexRequests.Core.Models;

namespace PlexRequests.Core
{
public interface IStatusChecker
{
Task<StatusModel> GetStatus();
}
}
10 changes: 9 additions & 1 deletion PlexRequests.Core/PlexRequests.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<HintPath>..\packages\Quartz.2.3.3\lib\net40\Quartz.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.105.2.3\lib\net45\RestSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
Expand Down Expand Up @@ -82,6 +86,7 @@
<ItemGroup>
<Compile Include="CacheKeys.cs" />
<Compile Include="IPlexReadOnlyDatabase.cs" />
<Compile Include="IStatusChecker.cs" />
<Compile Include="Notification\NotificationMessage.cs" />
<Compile Include="Notification\NotificationMessageContent.cs" />
<Compile Include="Notification\NotificationMessageCurlys.cs" />
Expand Down Expand Up @@ -120,9 +125,12 @@
<Compile Include="SettingModels\CouchPotatoSettings.cs" />
<Compile Include="SettingModels\PlexRequestSettings.cs" />
<Compile Include="SettingModels\Settings.cs" />
<Compile Include="SettingModels\SystemSettings.cs" />
<Compile Include="SettingsServiceV2.cs" />
<Compile Include="Setup.cs" />
<Compile Include="StatusChecker.cs" />
<Compile Include="StatusChecker\AppveyorArtifactResult.cs" />
<Compile Include="StatusChecker\StatusChecker.cs" />
<Compile Include="StatusChecker\AppveyorBranchResult.cs" />
<Compile Include="UserIdentity.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserMapper.cs" />
Expand Down
38 changes: 38 additions & 0 deletions PlexRequests.Core/SettingModels/SystemSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: SystemSettings.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion

using PlexRequests.Core.Models;

namespace PlexRequests.Core.SettingModels
{
public class SystemSettings : Settings
{
public bool UseEarlyAccessPreviewBuilds { get; set; }

public StatusModel Status { get; set; }
}
}
83 changes: 0 additions & 83 deletions PlexRequests.Core/StatusChecker.cs

This file was deleted.

35 changes: 35 additions & 0 deletions PlexRequests.Core/StatusChecker/AppveyorArtifactResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: AppveyorArtifactResult.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Core.StatusChecker
{
public class AppveyorArtifactResult
{
public string fileName { get; set; }
public string type { get; set; }
public int size { get; set; }
}
}
138 changes: 138 additions & 0 deletions PlexRequests.Core/StatusChecker/AppveyorBranchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: AppveyorBranchResult.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion

using System.Collections.Generic;

namespace PlexRequests.Core.StatusChecker
{
public class NuGetFeed
{
public string id { get; set; }
public string name { get; set; }
public bool publishingEnabled { get; set; }
public string created { get; set; }
}

public class AccessRightDefinition
{
public string name { get; set; }
public string description { get; set; }
}

public class AccessRight
{
public string name { get; set; }
public bool allowed { get; set; }
}

public class RoleAce
{
public int roleId { get; set; }
public string name { get; set; }
public bool isAdmin { get; set; }
public List<AccessRight> accessRights { get; set; }
}

public class SecurityDescriptor
{
public List<AccessRightDefinition> accessRightDefinitions { get; set; }
public List<RoleAce> roleAces { get; set; }
}

public class Project
{
public int projectId { get; set; }
public int accountId { get; set; }
public string accountName { get; set; }
public List<object> builds { get; set; }
public string name { get; set; }
public string slug { get; set; }
public string repositoryType { get; set; }
public string repositoryScm { get; set; }
public string repositoryName { get; set; }
public string repositoryBranch { get; set; }
public bool isPrivate { get; set; }
public bool skipBranchesWithoutAppveyorYml { get; set; }
public bool enableSecureVariablesInPullRequests { get; set; }
public bool enableSecureVariablesInPullRequestsFromSameRepo { get; set; }
public bool enableDeploymentInPullRequests { get; set; }
public bool rollingBuilds { get; set; }
public bool alwaysBuildClosedPullRequests { get; set; }
public string tags { get; set; }
public NuGetFeed nuGetFeed { get; set; }
public SecurityDescriptor securityDescriptor { get; set; }
public string created { get; set; }
public string updated { get; set; }
}

public class Job
{
public string jobId { get; set; }
public string name { get; set; }
public bool allowFailure { get; set; }
public int messagesCount { get; set; }
public int compilationMessagesCount { get; set; }
public int compilationErrorsCount { get; set; }
public int compilationWarningsCount { get; set; }
public int testsCount { get; set; }
public int passedTestsCount { get; set; }
public int failedTestsCount { get; set; }
public int artifactsCount { get; set; }
public string status { get; set; }
public string started { get; set; }
public string finished { get; set; }
public string created { get; set; }
public string updated { get; set; }
}

public class Build
{
public int buildId { get; set; }
public List<Job> jobs { get; set; }
public int buildNumber { get; set; }
public string version { get; set; }
public string message { get; set; }
public string branch { get; set; }
public bool isTag { get; set; }
public string commitId { get; set; }
public string authorName { get; set; }
public string committerName { get; set; }
public string committed { get; set; }
public List<object> messages { get; set; }
public string status { get; set; }
public string started { get; set; }
public string finished { get; set; }
public string created { get; set; }
public string updated { get; set; }
}

public class AppveyorBranchResult
{
public Project project { get; set; }
public Build build { get; set; }
}
}
Loading

0 comments on commit 0950f20

Please sign in to comment.