From cc779283ea9a482941c445fba919de1b17bfb220 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 14 Nov 2013 17:58:34 +1100 Subject: [PATCH] fix user mapping and add doco --- Octokit/Clients/IGistsClient.cs | 2 +- Octokit/Models/Response/Gist.cs | 98 ++++++++++++++------- Octokit/Models/Response/GistChangeStatus.cs | 23 +++++ Octokit/Models/Response/GistFile.cs | 40 +++++++++ Octokit/Models/Response/GistFork.cs | 23 +++++ Octokit/Models/Response/GistHistory.cs | 35 ++++++++ Octokit/Octokit-Mono.csproj | 4 + Octokit/Octokit-netcore45.csproj | 4 + Octokit/Octokit.csproj | 4 + 9 files changed, 198 insertions(+), 35 deletions(-) create mode 100644 Octokit/Models/Response/GistChangeStatus.cs create mode 100644 Octokit/Models/Response/GistFile.cs create mode 100644 Octokit/Models/Response/GistFork.cs create mode 100644 Octokit/Models/Response/GistHistory.cs diff --git a/Octokit/Clients/IGistsClient.cs b/Octokit/Clients/IGistsClient.cs index 5137d71b..40b68b60 100644 --- a/Octokit/Clients/IGistsClient.cs +++ b/Octokit/Clients/IGistsClient.cs @@ -11,7 +11,7 @@ namespace Octokit /// /// http://developer.github.com/v3/gists/#get-a-single-gist /// - /// The id of the gidt + /// The id of the gist [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] Task Get(int id); diff --git a/Octokit/Models/Response/Gist.cs b/Octokit/Models/Response/Gist.cs index e2735977..9224b6c7 100644 --- a/Octokit/Models/Response/Gist.cs +++ b/Octokit/Models/Response/Gist.cs @@ -4,57 +4,87 @@ using System.Diagnostics.CodeAnalysis; namespace Octokit { - public class Gist + public class Gist { + /// + /// The API URL for this . + /// public string Url { get; set; } + + /// + /// The Id of this . + /// + /// + /// Given a gist url of https://gist.github.com/UserName/1234 the Id would be '1234'. + /// public string Id { get; set; } + + /// + /// A description of the . + /// public string Description { get; set; } + + /// + /// Indicates if the is private or public. + /// public bool Public { get; set; } - public User User { get; set; } + + /// + /// The who owns this . + /// + /// + /// Given a gist url of https://gist.github.com/UserName/1234 the Owner would be 'UserName'. + /// + public User Owner { get; set; } + + /// + /// A containing all s in this . + /// [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IDictionary Files { get; set; } + + /// + /// The number of comments on this . + /// public int Comments { get; set; } + + /// + /// A url to retrieve the comments for this . + /// public string CommentsUrl { get; set; } + public string HtmlUrl { get; set; } + + /// + /// The git url to pull from to retrieve the contents for this . + /// public string GitPullUrl { get; set; } + + /// + /// The git url to push to when changing this . + /// public string GitPushUrl { get; set; } + + /// + /// The for when this was created. + /// public DateTimeOffset CreatedAt { get; set; } + + /// + /// The for when this was last updated. + /// public DateTimeOffset UpdatedAt { get; set; } + + /// + /// A of all that exist for this . + /// [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IList Forks { get; set; } + + /// + /// A of all containing the full history for this . + /// [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public IList History { get; set; } } - - public class GistFork - { - public User User { get; set; } - public string Url { get; set; } - public string CreatedAt { get; set; } - } - public class GistFile - { - public int Size { get; set; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")] - public string Filename { get; set; } - [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] - public string Type { get; set; } - public string Language { get; set; } - public string Content { get; set; } - public string RawUrl { get; set; } - } - public class GistHistory - { - public string Url { get; set; } - public string Version { get; set; } - public User User { get; set; } - public GistChangeStatus ChangeStatus { get; set; } - public string CommittedAt { get; set; } - } - public class GistChangeStatus - { - public int Deletions { get; set; } - public int Additions { get; set; } - public int Total { get; set; } - } } \ No newline at end of file diff --git a/Octokit/Models/Response/GistChangeStatus.cs b/Octokit/Models/Response/GistChangeStatus.cs new file mode 100644 index 00000000..4b790347 --- /dev/null +++ b/Octokit/Models/Response/GistChangeStatus.cs @@ -0,0 +1,23 @@ +namespace Octokit +{ + /// + /// User by to indicate the level of change. + /// + public class GistChangeStatus + { + /// + /// The number of deletions that occurred as part of this change. + /// + public int Deletions { get; set; } + + /// + /// The number of additions that occurred as part of this change. + /// + public int Additions { get; set; } + + /// + /// The total number of changes. + /// + public int Total { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Models/Response/GistFile.cs b/Octokit/Models/Response/GistFile.cs new file mode 100644 index 00000000..24379516 --- /dev/null +++ b/Octokit/Models/Response/GistFile.cs @@ -0,0 +1,40 @@ +using System.Diagnostics.CodeAnalysis; + +namespace Octokit +{ + public class GistFile + { + + /// + /// The size in bytes of the file. + /// + public int Size { get; set; } + + /// + /// The name of the file + /// + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly")] + public string Filename { get; set; } + + /// + /// The mime type of the file + /// + [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] + public string Type { get; set; } + + /// + /// The programming language of the file, if any. + /// + public string Language { get; set; } + + /// + /// The text content of the file. + /// + public string Content { get; set; } + + /// + /// The url to download the file. + /// + public string RawUrl { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Models/Response/GistFork.cs b/Octokit/Models/Response/GistFork.cs new file mode 100644 index 00000000..869b10bb --- /dev/null +++ b/Octokit/Models/Response/GistFork.cs @@ -0,0 +1,23 @@ +using System; + +namespace Octokit +{ + public class GistFork + { + + /// + /// The that created this + /// + public User User { get; set; } + + /// + /// The API URL for this . + /// + public string Url { get; set; } + + /// + /// The for when this was created. + /// + public DateTimeOffset CreatedAt { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Models/Response/GistHistory.cs b/Octokit/Models/Response/GistHistory.cs new file mode 100644 index 00000000..0ea5fe32 --- /dev/null +++ b/Octokit/Models/Response/GistHistory.cs @@ -0,0 +1,35 @@ +using System; + +namespace Octokit +{ + /// + /// A historical version of a + /// + public class GistHistory + { + /// + /// The url that can be used by the API to retrieve this version of the . + /// + public string Url { get; set; } + + /// + /// A git sha representing the version. + /// + public string Version { get; set; } + + /// + /// The who create this version. + /// + public User User { get; set; } + + /// + /// A that represents the level of change for this . + /// + public GistChangeStatus ChangeStatus { get; set; } + + /// + /// The the version was created. + /// + public DateTimeOffset CommittedAt { get; set; } + } +} \ No newline at end of file diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index 17d727c7..b7403388 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -88,6 +88,10 @@ + + + + diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index 41cbabc1..5bc5567a 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -177,6 +177,10 @@ + + + + diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index 8d51b968..f49c12a0 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -98,6 +98,10 @@ + + + +