Add support for deserializing non-public members

But only ones with ParameterAttribute applied.
This commit is contained in:
Haacked
2014-12-30 10:10:32 -08:00
parent fdd9073e43
commit 543d1bb863
6 changed files with 93 additions and 37 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Octokit.Internal;
namespace Octokit
{
@@ -16,7 +17,13 @@ namespace Octokit
/// <summary>
/// The encoded content if this is a file. Otherwise it's null.
/// </summary>
public string Content { get; set; }
[Parameter(Key = "content")]
protected string EncodedContent { get; set; }
public string Content
{
get { return EncodedContent.FromBase64String(); }
}
/// <summary>
/// Path to the target file in the repository if this is a symlink. Otherwise it's null.