diff --git a/Octokit.Tests.Integration/Clients/TeamsClientTests.cs b/Octokit.Tests.Integration/Clients/TeamsClientTests.cs index 6414d398..1e653c79 100644 --- a/Octokit.Tests.Integration/Clients/TeamsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/TeamsClientTests.cs @@ -72,7 +72,8 @@ public class TeamsClientTests { var github = Helper.GetBadCredentialsClient(); - var e = await Assert.ThrowsAsync(() => github.Organization.Team.IsMember(team.Id, Helper.UserName)); + var e = await Assert.ThrowsAsync( + () => github.Organization.Team.GetMembership(team.Id, Helper.UserName)); Assert.Equal(HttpStatusCode.Unauthorized, e.StatusCode); } diff --git a/Octokit/Clients/MergingClient.cs b/Octokit/Clients/MergingClient.cs index bf8374a3..3b08548d 100644 --- a/Octokit/Clients/MergingClient.cs +++ b/Octokit/Clients/MergingClient.cs @@ -10,6 +10,10 @@ namespace Octokit /// public class MergingClient : ApiClient, IMergingClient { + /// + /// Initializes a new instance of the class. + /// + /// The client's connection public MergingClient(IApiConnection apiConnection) : base(apiConnection) { } diff --git a/Octokit/Models/Request/BaseSearchRequest.cs b/Octokit/Models/Request/BaseSearchRequest.cs index 800bea24..ec11c75d 100644 --- a/Octokit/Models/Request/BaseSearchRequest.cs +++ b/Octokit/Models/Request/BaseSearchRequest.cs @@ -11,6 +11,9 @@ namespace Octokit [SuppressMessage("Microsoft.Design", "CA1012:AbstractTypesShouldNotHaveConstructors")] public abstract class BaseSearchRequest { + /// + /// Initializes a new instance of the class. + /// protected BaseSearchRequest() { Page = 1; @@ -18,6 +21,10 @@ namespace Octokit Order = SortDirection.Descending; } + /// + /// Initializes a new instance of the class. + /// + /// The term. protected BaseSearchRequest(string term) : this() { Ensure.ArgumentNotNullOrEmptyString(term, "term"); @@ -37,6 +44,12 @@ namespace Octokit get; } + /// + /// Gets the sort order as a properly formatted lowercased query string parameter. + /// + /// + /// The sort order. + /// private string SortOrder { get diff --git a/Octokit/Models/Request/BodyWrapper.cs b/Octokit/Models/Request/BodyWrapper.cs index 2c1d332f..a6e32ffa 100644 --- a/Octokit/Models/Request/BodyWrapper.cs +++ b/Octokit/Models/Request/BodyWrapper.cs @@ -1,12 +1,25 @@ namespace Octokit { + /// + /// Wraps a string for the body of a request. + /// public class BodyWrapper { + /// + /// Initializes a new instance of the class. + /// + /// The body. public BodyWrapper(string body) { Body = body; } + /// + /// Gets the body. + /// + /// + /// The body. + /// public string Body { get; private set; } } } \ No newline at end of file diff --git a/Octokit/Models/Request/CommitRequest.cs b/Octokit/Models/Request/CommitRequest.cs index 37e397b8..d015278e 100644 --- a/Octokit/Models/Request/CommitRequest.cs +++ b/Octokit/Models/Request/CommitRequest.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Encapsulates the parameters for a request to retrieve commits. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class CommitRequest : RequestParameters { diff --git a/Octokit/Models/Request/CreateFileRequest.cs b/Octokit/Models/Request/CreateFileRequest.cs index 98f6b702..116d0853 100644 --- a/Octokit/Models/Request/CreateFileRequest.cs +++ b/Octokit/Models/Request/CreateFileRequest.cs @@ -8,9 +8,12 @@ namespace Octokit /// /// Base class with common properties for all the Repository Content Request APIs. /// - /// public abstract class ContentRequest { + /// + /// Initializes a new instance of the class. + /// + /// The message. protected ContentRequest(string message) { Ensure.ArgumentNotNullOrEmptyString(message, "message"); @@ -45,6 +48,11 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class DeleteFileRequest : ContentRequest { + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The sha. public DeleteFileRequest(string message, string sha) : base(message) { Ensure.ArgumentNotNullOrEmptyString(sha, "sha"); diff --git a/Octokit/Models/Request/EditRepositoryHook.cs b/Octokit/Models/Request/EditRepositoryHook.cs index 88973085..974dc1f1 100644 --- a/Octokit/Models/Request/EditRepositoryHook.cs +++ b/Octokit/Models/Request/EditRepositoryHook.cs @@ -6,13 +6,22 @@ using Octokit.Internal; namespace Octokit { + /// + /// Represents the requested changes to an edit repository hook. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class EditRepositoryHook { - public EditRepositoryHook() - : this(null) + /// + /// Initializes a new instance of the class. + /// + public EditRepositoryHook() : this(null) { } + /// + /// Initializes a new instance of the class. + /// + /// The configuration. public EditRepositoryHook(IDictionary config) { Config = config; @@ -20,14 +29,32 @@ namespace Octokit public IDictionary Config { get; private set; } + /// + /// Gets or sets the events. + /// + /// + /// The events. + /// public IEnumerable Events { get; set; } [Parameter(Key = "add_events")] public IEnumerable AddEvents { get; set; } + /// + /// Gets or sets the remove events. + /// + /// + /// The remove events. + /// [Parameter(Key = "remove_events")] public IEnumerable RemoveEvents { get; set; } + /// + /// Gets or sets the active. + /// + /// + /// The active. + /// public bool? Active { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/GistFileUpdate.cs b/Octokit/Models/Request/GistFileUpdate.cs index 2c338fbb..ac9addc7 100644 --- a/Octokit/Models/Request/GistFileUpdate.cs +++ b/Octokit/Models/Request/GistFileUpdate.cs @@ -4,11 +4,29 @@ using System.Globalization; namespace Octokit { + /// + /// Used as part of a to update the name or contents of an existing gist file + /// + /// + /// API docs: https://developer.github.com/v3/gists/ + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class GistFileUpdate { + /// + /// Gets or sets the new name of the file. + /// + /// + /// The new name of the file. + /// public string NewFileName { get; set; } + /// + /// Gets or sets the content. + /// + /// + /// The content. + /// public string Content { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/GistRequest.cs b/Octokit/Models/Request/GistRequest.cs index 86989c94..bd6116c0 100644 --- a/Octokit/Models/Request/GistRequest.cs +++ b/Octokit/Models/Request/GistRequest.cs @@ -4,14 +4,33 @@ using System.Globalization; namespace Octokit { + /// + /// Used to request Gists since a certain date. + /// + /// + /// API docs: https://developer.github.com/v3/gists/ + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class GistRequest : RequestParameters { + /// + /// Initializes a new instance of the class. + /// + /// The date for which only gists updated at or after this time are returned. public GistRequest(DateTimeOffset since) { Since = since; } + /// + /// Gets or sets the date for which only gists updated at or after this time are returned. + /// + /// + /// This is sent as a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + /// + /// + /// The since. + /// public DateTimeOffset Since { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/GistUpdate.cs b/Octokit/Models/Request/GistUpdate.cs index 2ccf21ab..ac7919ed 100644 --- a/Octokit/Models/Request/GistUpdate.cs +++ b/Octokit/Models/Request/GistUpdate.cs @@ -5,6 +5,14 @@ using System.Globalization; namespace Octokit { + /// + /// Used to update a gist and its contents. + /// + /// + /// Note: All files from the previous version of the gist are carried over by default if not included in the + /// object. Deletes can be performed by including the filename with a null object. + /// API docs: https://developer.github.com/v3/gists/ + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class GistUpdate { @@ -19,8 +27,8 @@ namespace Octokit /// Gets a dictionary of gist files to update. /// /// - /// Note: All files from the previous version of the gist are carried over by default if not included in the hash. - /// Deletes can be performed by including the filename with a `null` hash. + /// Note: All files from the previous version of the gist are carried over by default if not included in the + /// hash. Deletes can be performed by including the filename with a `null` hash. /// public IDictionary Files { get; private set; } diff --git a/Octokit/Models/Request/IssueRequest.cs b/Octokit/Models/Request/IssueRequest.cs index dce55524..a751aff4 100644 --- a/Octokit/Models/Request/IssueRequest.cs +++ b/Octokit/Models/Request/IssueRequest.cs @@ -6,9 +6,15 @@ using Octokit.Internal; namespace Octokit { + /// + /// Used to filter a request to list issues. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class IssueRequest : RequestParameters { + /// + /// Initializes a new instance of the class. + /// public IssueRequest() { Filter = IssueFilter.Assigned; @@ -18,13 +24,59 @@ namespace Octokit SortDirection = SortDirection.Descending; } + /// + /// Gets or sets the which indicates which sorts of issues to return. + /// + /// + /// The filter. + /// public IssueFilter Filter { get; set; } + + /// + /// Gets or sets the for the issues to return. + /// + /// + /// The state. + /// public ItemState State { get; set; } + + /// + /// Gets the labels to filter by. Add labels to the collection to only request issues with those labels. + /// + /// Sent as a comma separated list + /// + /// The labels. + /// public Collection Labels { get; private set; } + + /// + /// Gets or sets the property to sort the returned issues by. + /// Combine this with to specify sort direction. + /// + /// + /// The sort property. + /// [Parameter(Key = "sort")] public IssueSort SortProperty { get; set; } + + /// + /// Gets or sets the sort direction. + /// + /// + /// The sort direction. + /// [Parameter(Key = "direction")] public SortDirection SortDirection { get; set; } + + /// + /// Gets or sets the date for which only issues updated at or after this time are returned. + /// + /// + /// This is sent as a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + /// + /// + /// The since. + /// public DateTimeOffset? Since { get; set; } internal string DebuggerDisplay @@ -37,7 +89,7 @@ namespace Octokit } /// - /// + /// The range of filters available for issues. /// /// http://developer.github.com/v3/issues/#list-issues public enum IssueFilter @@ -68,6 +120,9 @@ namespace Octokit All } + /// + /// The range of states that an issue can be in. + /// public enum ItemState { /// @@ -86,6 +141,9 @@ namespace Octokit All } + /// + /// The available properties to sort issues by. + /// public enum IssueSort { /// @@ -104,11 +162,20 @@ namespace Octokit Comments } + /// + /// The two possible sort directions. + /// public enum SortDirection { + /// + /// Sort ascending + /// [Parameter(Value = "asc")] Ascending, + /// + /// Sort descending + /// [Parameter(Value = "desc")] Descending } diff --git a/Octokit/Models/Request/IssueUpdate.cs b/Octokit/Models/Request/IssueUpdate.cs index 1a17bc48..a54e7bcf 100644 --- a/Octokit/Models/Request/IssueUpdate.cs +++ b/Octokit/Models/Request/IssueUpdate.cs @@ -6,6 +6,9 @@ using Octokit.Internal; namespace Octokit { + /// + /// Specifies the values used to update an issue. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class IssueUpdate { @@ -59,6 +62,10 @@ namespace Octokit } } + /// + /// Adds the specified label to the issue. + /// + /// The name of the label. public void AddLabel(string name) { // lazily create the label array @@ -70,6 +77,9 @@ namespace Octokit Labels.Add(name); } + /// + /// Clears all the labels. + /// public void ClearLabels() { // lazily create the label array diff --git a/Octokit/Models/Request/LabelUpdate.cs b/Octokit/Models/Request/LabelUpdate.cs index 573a7d66..bc4a4b2e 100644 --- a/Octokit/Models/Request/LabelUpdate.cs +++ b/Octokit/Models/Request/LabelUpdate.cs @@ -5,11 +5,19 @@ using System.Text.RegularExpressions; namespace Octokit { + /// + /// Used to update an existing label. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class LabelUpdate { private string _color; + /// + /// Initializes a new instance of the class. + /// + /// The name of the label. + /// The color of the label. public LabelUpdate(string name, string color) { Ensure.ArgumentNotNullOrEmptyString(name, "name"); diff --git a/Octokit/Models/Request/MarkAsReadRequest.cs b/Octokit/Models/Request/MarkAsReadRequest.cs index e62074cb..4c033b74 100644 --- a/Octokit/Models/Request/MarkAsReadRequest.cs +++ b/Octokit/Models/Request/MarkAsReadRequest.cs @@ -4,17 +4,30 @@ using System.Globalization; namespace Octokit { + /// + /// Used to mark a notification as "read" which removes it from the default view on GitHub.com. + /// + /// + /// https://developer.github.com/v3/activity/notifications/#mark-as-read + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class MarkAsReadRequest : RequestParameters { + /// + /// Initializes a new instance of the class. + /// public MarkAsReadRequest() { LastReadAt = null; } /// - /// Describes the last point that notifications were checked. Anything updated since this time will not be updated. + /// Describes the last point that notifications were checked. Anything updated since this time will not be + /// updated. /// + /// + /// This is sent as a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Default: the current time. + /// public DateTimeOffset? LastReadAt { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/MilestoneRequest.cs b/Octokit/Models/Request/MilestoneRequest.cs index 22b877b4..b7d583b3 100644 --- a/Octokit/Models/Request/MilestoneRequest.cs +++ b/Octokit/Models/Request/MilestoneRequest.cs @@ -5,6 +5,9 @@ using Octokit.Internal; namespace Octokit { + /// + /// Used to filter requests for lists of milestones + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class MilestoneRequest : RequestParameters { diff --git a/Octokit/Models/Request/MilestoneUpdate.cs b/Octokit/Models/Request/MilestoneUpdate.cs index 4da852cd..865500fb 100644 --- a/Octokit/Models/Request/MilestoneUpdate.cs +++ b/Octokit/Models/Request/MilestoneUpdate.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to update a milestone + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class MilestoneUpdate { diff --git a/Octokit/Models/Request/NewAuthorization.cs b/Octokit/Models/Request/NewAuthorization.cs index 310b4bac..74ae99d2 100644 --- a/Octokit/Models/Request/NewAuthorization.cs +++ b/Octokit/Models/Request/NewAuthorization.cs @@ -12,16 +12,30 @@ namespace Octokit public class NewAuthorization { // TODO: I'd love to not need this + /// + /// Initializes a new instance of the class. + /// public NewAuthorization() { } + /// + /// Initializes a new instance of the class. + /// + /// The note. + /// The scopes. public NewAuthorization(string note, IEnumerable scopes) { Scopes = scopes; Note = note; } + /// + /// Initializes a new instance of the class. + /// + /// The note. + /// The scopes. + /// The fingerprint. public NewAuthorization(string note, IEnumerable scopes, string fingerprint) { Scopes = scopes; diff --git a/Octokit/Models/Request/NewBlob.cs b/Octokit/Models/Request/NewBlob.cs index abb15c93..3a4cd014 100644 --- a/Octokit/Models/Request/NewBlob.cs +++ b/Octokit/Models/Request/NewBlob.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a Blob. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewBlob { diff --git a/Octokit/Models/Request/NewCommit.cs b/Octokit/Models/Request/NewCommit.cs index d449697e..b4a66858 100644 --- a/Octokit/Models/Request/NewCommit.cs +++ b/Octokit/Models/Request/NewCommit.cs @@ -6,6 +6,12 @@ using System.Linq; namespace Octokit { + /// + /// Used to create a commit. + /// + /// + /// API: https://developer.github.com/v3/git/commits/#create-a-commit + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewCommit { @@ -14,7 +20,11 @@ namespace Octokit /// /// The message to associate with the commit /// The tree associated with the commit - /// An array of parent commits to associate with the commit + /// + /// The SHAs of the commits that were the parents of this commit. If empty, the commit will be written as a + /// root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of + /// more than one should be provided. + /// public NewCommit(string message, string tree, IEnumerable parents) { Message = message; @@ -43,11 +53,48 @@ namespace Octokit { } - public string Message { get; set; } - public string Tree { get; set; } - public IEnumerable Parents { get; set; } + /// + /// Gets the commit message. + /// + /// + /// The message. + /// + public string Message { get; private set; } + /// + /// Gets the tree associated with the commit. + /// + /// + /// The tree. + /// + public string Tree { get; private set; } + + /// + /// Gets the SHAs of the commits that were the parents of this commit. If empty, the commit will be written as + /// a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of + /// more than one should be provided. + /// + /// + /// The parents. + /// + public IEnumerable Parents { get; private set; } + + /// + /// Gets or sets the author of the commit. If omitted, it will be filled in with the authenticated user’s + /// information and the current date. + /// + /// + /// The author. + /// public SignatureResponse Author { get; set; } + + /// + /// Gets or sets the person who applied the commit. If omitted, this will be filled in with the + /// . + /// + /// + /// The committer. + /// public SignatureResponse Committer { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/NewCommitComment.cs b/Octokit/Models/Request/NewCommitComment.cs index 3c312704..8d8fb770 100644 --- a/Octokit/Models/Request/NewCommitComment.cs +++ b/Octokit/Models/Request/NewCommitComment.cs @@ -10,6 +10,10 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewCommitComment { + /// + /// Initializes a new instance of the class. + /// + /// The body of the comment. public NewCommitComment(string body) { Ensure.ArgumentNotNull(body, "body"); diff --git a/Octokit/Models/Request/NewCommitStatus.cs b/Octokit/Models/Request/NewCommitStatus.cs index 38b19401..f615f732 100644 --- a/Octokit/Models/Request/NewCommitStatus.cs +++ b/Octokit/Models/Request/NewCommitStatus.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a new commit status. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewCommitStatus { diff --git a/Octokit/Models/Request/NewDeployKey.cs b/Octokit/Models/Request/NewDeployKey.cs index 82f8dd97..4995c037 100644 --- a/Octokit/Models/Request/NewDeployKey.cs +++ b/Octokit/Models/Request/NewDeployKey.cs @@ -7,11 +7,26 @@ namespace Octokit /// /// Describes a new deployment key to create. /// + /// + /// API: https://developer.github.com/v3/repos/keys/ + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewDeployKey { + /// + /// Gets or sets a name for the deployment key. + /// + /// + /// The title. + /// public string Title { get; set; } + /// + /// Gets or sets the contents of the deployment key. + /// + /// + /// The key. + /// public string Key { get; set; } /// diff --git a/Octokit/Models/Request/NewGist.cs b/Octokit/Models/Request/NewGist.cs index ef4c81f6..95282cb8 100644 --- a/Octokit/Models/Request/NewGist.cs +++ b/Octokit/Models/Request/NewGist.cs @@ -5,6 +5,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a new Gist. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewGist { diff --git a/Octokit/Models/Request/NewIssue.cs b/Octokit/Models/Request/NewIssue.cs index 21289aa2..6ac217e5 100644 --- a/Octokit/Models/Request/NewIssue.cs +++ b/Octokit/Models/Request/NewIssue.cs @@ -6,11 +6,15 @@ using System.Globalization; namespace Octokit { /// - /// Describes a new issue to create via the method. + /// Describes a new issue to create via the method. /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewIssue { + /// + /// Initializes a new instance of the class. + /// + /// The title of the issue. public NewIssue(string title) { Title = title; diff --git a/Octokit/Models/Request/NewLabel.cs b/Octokit/Models/Request/NewLabel.cs index 07e68a95..ffdf2648 100644 --- a/Octokit/Models/Request/NewLabel.cs +++ b/Octokit/Models/Request/NewLabel.cs @@ -13,6 +13,11 @@ namespace Octokit { private string _color; + /// + /// Initializes a new instance of the class. + /// + /// The name of the label. + /// The color of the label. public NewLabel(string name, string color) { Ensure.ArgumentNotNullOrEmptyString(name, "name"); diff --git a/Octokit/Models/Request/NewMerge.cs b/Octokit/Models/Request/NewMerge.cs index b8b470dc..11ba4399 100644 --- a/Octokit/Models/Request/NewMerge.cs +++ b/Octokit/Models/Request/NewMerge.cs @@ -4,6 +4,18 @@ using System.Globalization; namespace Octokit { + /// + /// Used to merge branches in a repository. + /// + /// + /// + /// The Repo Merging API supports merging branches in a repository. This accomplishes essentially the same thing + /// as merging one branch into another in a local repository and then pushing to GitHub. The benefit is that the + /// merge is done on the server side and a local repository is not needed. This makes it more appropriate for + /// automation and other tools where maintaining local repositories would be cumbersome and inefficient. + /// + /// API: https://developer.github.com/v3/repos/merging/ + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewMerge { @@ -21,8 +33,28 @@ namespace Octokit Head = head; } + /// + /// Gets or sets the commit message. + /// + /// + /// The commit message. + /// public string CommitMessage { get; set; } + + /// + /// The name of the base branch that the head will be merged into (REQUIRED). + /// + /// + /// The base. + /// public string Base { get; private set; } + + /// + /// The head to merge. This can be a branch name or a commit SHA1 (REQUIRED). + /// + /// + /// The head. + /// public string Head { get; private set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/NewMilestone.cs b/Octokit/Models/Request/NewMilestone.cs index 63362323..ed3a0cf3 100644 --- a/Octokit/Models/Request/NewMilestone.cs +++ b/Octokit/Models/Request/NewMilestone.cs @@ -10,6 +10,10 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewMilestone { + /// + /// Initializes a new instance of the class. + /// + /// The title. public NewMilestone(string title) { Ensure.ArgumentNotNull(title, "title"); diff --git a/Octokit/Models/Request/NewPullRequest.cs b/Octokit/Models/Request/NewPullRequest.cs index fc80764a..d84399bc 100644 --- a/Octokit/Models/Request/NewPullRequest.cs +++ b/Octokit/Models/Request/NewPullRequest.cs @@ -10,6 +10,12 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewPullRequest { + /// + /// Initializes a new instance of the class. + /// + /// The title of the pull request. + /// The branch (or git ref where your changes are implemented. In other words, the source branch/ref + /// The base (or git ref) reference you want your changes pulled into. In other words, the target branch/ref public NewPullRequest(string title, string head, string baseRef) { Ensure.ArgumentNotNullOrEmptyString(title, "title"); diff --git a/Octokit/Models/Request/NewReference.cs b/Octokit/Models/Request/NewReference.cs index 93fce03e..8d551ed3 100644 --- a/Octokit/Models/Request/NewReference.cs +++ b/Octokit/Models/Request/NewReference.cs @@ -5,11 +5,23 @@ using System.Linq; namespace Octokit { + /// + /// Used to create a new Git reference. + /// + /// API: https://developer.github.com/v3/git/refs/#create-a-reference [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewReference { const string _refsPrefix = "refs"; + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the fully qualified reference (ie: refs/heads/master). If it doesn’t start with ‘refs’ and + /// have at least two slashes, it will be rejected. + /// + /// The SHA1 value to set this reference to public NewReference(string reference, string sha) { Ensure.ArgumentNotNullOrEmptyString(reference, "ref"); @@ -19,7 +31,21 @@ namespace Octokit Sha = sha; } + /// + /// The name of the fully qualified reference (ie: refs/heads/master). If it doesn’t start with ‘refs’ and + /// have at least two slashes, it will be rejected. + /// + /// + /// The reference. + /// public string Ref { get; private set; } + + /// + /// The SHA1 value to set this reference to + /// + /// + /// The sha. + /// public string Sha { get; private set; } static string GetReference(string reference) diff --git a/Octokit/Models/Request/NewRelease.cs b/Octokit/Models/Request/NewRelease.cs index 18153498..3c4e1169 100644 --- a/Octokit/Models/Request/NewRelease.cs +++ b/Octokit/Models/Request/NewRelease.cs @@ -4,20 +4,74 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a new release. + /// + /// + /// API: https://developer.github.com/v3/repos/releases/#create-a-release + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewRelease { + /// + /// Initializes a new instance of the class. + /// + /// Name of the tag to create in the repository for this release. public NewRelease(string tagName) { Ensure.ArgumentNotNullOrEmptyString(tagName, "tagName"); TagName = tagName; } + /// + /// Gets the name of the tag. + /// + /// + /// The name of the tag. + /// public string TagName { get; private set; } + + /// + /// Specifies the commitish value that determines where the Git tag is created from. Can be any branch or + /// commit SHA. Unused if the Git tag already exists. Default: the repositorys default branch + /// (usually master). + /// + /// + /// The target commitish. + /// public string TargetCommitish { get; set; } + + /// + /// Gets or sets the name of the release. + /// + /// + /// The name. + /// public string Name { get; set; } + + /// + /// Gets or sets the text describing the contents of the tag. + /// + /// + /// The body. + /// public string Body { get; set; } + + /// + /// Gets or sets a value indicating whether this is a draft (unpublished). + /// Default: false + /// + /// + /// true if draft; otherwise, false. + /// public bool Draft { get; set; } + + /// + /// Gets or sets a value indicating whether this is prerelease. + /// + /// + /// true if prerelease; otherwise, false. + /// public bool Prerelease { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/NewRepository.cs b/Octokit/Models/Request/NewRepository.cs index 04184c5d..7e004679 100644 --- a/Octokit/Models/Request/NewRepository.cs +++ b/Octokit/Models/Request/NewRepository.cs @@ -40,7 +40,7 @@ namespace Octokit /// /// Optional. Gets or sets whether to enable issues for the new repository. The default is true. /// - public bool? HasIssues { get; set; } + public bool HasIssues { get; set; } /// /// Optional. Gets or sets whether to enable the wiki for the new repository. The default is true. diff --git a/Octokit/Models/Request/NewRepositoryFork.cs b/Octokit/Models/Request/NewRepositoryFork.cs index c442f872..d11c3b57 100644 --- a/Octokit/Models/Request/NewRepositoryFork.cs +++ b/Octokit/Models/Request/NewRepositoryFork.cs @@ -4,9 +4,22 @@ using System.Globalization; namespace Octokit { + /// + /// Used to fork a repository. + /// + /// + /// API: https://developer.github.com/v3/repos/forks/#create-a-fork + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewRepositoryFork { + /// + /// Gets or sets the organization name to fork into (Optional). If not specified, creates a fork for the + /// authenticated user. + /// + /// + /// The organization. + /// public string Organization { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/NewRepositoryHook.cs b/Octokit/Models/Request/NewRepositoryHook.cs index 7b2ee43f..86ac3b70 100644 --- a/Octokit/Models/Request/NewRepositoryHook.cs +++ b/Octokit/Models/Request/NewRepositoryHook.cs @@ -2,29 +2,102 @@ using System.Collections.Generic; using System.Diagnostics; using System.Globalization; -using Octokit.Internal; namespace Octokit { + /// + /// Creates a Webhook for the repository. + /// + /// + /// To create a webhook, the following fields are required by the config: + /// + /// + /// url + /// A required string defining the URL to which the payloads will be delivered. + /// + /// + /// content_type + /// + /// An optional string defining the media type used to serialize the payloads.Supported values include json and + /// form.The default is form. + /// + /// + /// + /// secret + /// + /// An optional string that’s passed with the HTTP requests as an X-Hub-Signature header. The value of this + /// header is computed as the HMAC hex digest of the body, using the secret as the key. + /// + /// + /// + /// insecure_ssl: + /// + /// An optional string that determines whether the SSL certificate of the host for url will be verified when + /// delivering payloads.Supported values include "0" (verification is performed) and "1" (verification is not + /// performed). The default is "0". + /// + /// + /// + /// + /// API: https://developer.github.com/v3/repos/hooks/#create-a-hook + /// + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewRepositoryHook { + /// + /// Initializes a new instance of the class. + /// + /// + /// Use "web" for a webhook or use the name of a valid service. (See + /// https://api.github.com/hooks for the list of valid service + /// names.) + /// + /// + /// Key/value pairs to provide settings for this hook. These settings vary between the services and are + /// defined in the github-services repository. Booleans are stored internally as “1” for true, and “0” for + /// false. Any JSON true/false values will be converted automatically. + /// public NewRepositoryHook(string name, IReadOnlyDictionary config) { Name = name; Config = config; } - [Parameter(Key = "name")] - public string Name { get; set; } + /// + /// Gets the name of the hook to create. Use "web" for a webhook or use the name of a valid service. (See + /// https://api.github.com/hooks for the list of valid service + /// names.) + /// + /// + /// The name. + /// + public string Name { get; private set; } /// - /// Is a key value structure determined by the web hook being created + /// Key/value pairs to provide settings for this hook. These settings vary between the services and are + /// defined in the github-services repository. Booleans are stored internally as “1” for true, and “0” for + /// false. Any JSON true/false values will be converted automatically. /// + /// + /// The configuration. + /// public IReadOnlyDictionary Config { get; private set; } + /// + /// Determines what events the hook is triggered for. Default: ["push"] + /// + /// + /// The events. + /// public IEnumerable Events { get; set; } + /// + /// Determines whether the hook is actually triggered on pushes. + /// + /// + /// true if active; otherwise, false. + /// public bool Active { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/NewSubscription.cs b/Octokit/Models/Request/NewSubscription.cs index 844a5d93..a15de8dd 100644 --- a/Octokit/Models/Request/NewSubscription.cs +++ b/Octokit/Models/Request/NewSubscription.cs @@ -4,12 +4,24 @@ using System.Globalization; namespace Octokit { + /// + /// Used to watch a repository (subscribe to repository's notifications). Called by the + /// method. + /// + /// + /// API: https://developer.github.com/v3/activity/watching/#set-a-repository-subscription + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewSubscription { /// /// Determines if notifications should be received from this repository. /// + /// + /// If you would like to watch a repository, set subscribed to true. If you would like to ignore notifications + /// made within a repository, set ignored to true. If you would like to stop watching a repository, delete the + /// repository’s subscription completely using the method. + /// public bool Subscribed { get; set; } /// diff --git a/Octokit/Models/Request/NewTag.cs b/Octokit/Models/Request/NewTag.cs index 344c2a18..96cb24e7 100644 --- a/Octokit/Models/Request/NewTag.cs +++ b/Octokit/Models/Request/NewTag.cs @@ -5,15 +5,59 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a new tag + /// + /// + /// Note that creating a tag object does not create the reference that makes a tag in Git. If you want to create + /// an annotated tag in Git, you have to do this call to create the tag object, and then create the + /// refs/tags/[tag] reference. If you want to create a lightweight tag, you only have to create the tag reference + /// - this call would be unnecessary. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewTag { + /// + /// Gets or sets the tag. + /// + /// + /// The tag. + /// public string Tag { get; set; } + + /// + /// Gets or sets the tag message. + /// + /// + /// The message. + /// public string Message { get; set; } + + /// + /// The SHA of the git object this is tagging + /// + /// + /// The object. + /// public string Object { get; set; } + + /// + /// The type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + /// + /// + /// The type. + /// [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "Property name as defined by web api")] public TaggedType Type { get; set; } + + /// + /// An object with information about the individual creating the tag. + /// + /// + /// The tagger. + /// public SignatureResponse Tagger { get; set; } + internal string DebuggerDisplay { get diff --git a/Octokit/Models/Request/NewTree.cs b/Octokit/Models/Request/NewTree.cs index 46ccbf58..3e083e8f 100644 --- a/Octokit/Models/Request/NewTree.cs +++ b/Octokit/Models/Request/NewTree.cs @@ -6,6 +6,13 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a new Tree. + /// + /// + /// The tree creation API will take nested entries as well. If both a tree and a nested path modifying that tree + /// are specified, it will overwrite the contents of that tree with the new path contents and write a new tree out. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class NewTree { diff --git a/Octokit/Models/Request/OauthLoginRequest.cs b/Octokit/Models/Request/OauthLoginRequest.cs index 501d0cbf..9260f935 100644 --- a/Octokit/Models/Request/OauthLoginRequest.cs +++ b/Octokit/Models/Request/OauthLoginRequest.cs @@ -6,6 +6,9 @@ using Octokit.Internal; namespace Octokit { + /// + /// Used to initiate an OAuth2 authentication flow from 3rd party web sites. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class OauthLoginRequest : RequestParameters { diff --git a/Octokit/Models/Request/OauthTokenRequest.cs b/Octokit/Models/Request/OauthTokenRequest.cs index e34f386a..ad2e13a7 100644 --- a/Octokit/Models/Request/OauthTokenRequest.cs +++ b/Octokit/Models/Request/OauthTokenRequest.cs @@ -5,6 +5,9 @@ using Octokit.Internal; namespace Octokit { + /// + /// Used to create an Oauth login request. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class OauthTokenRequest : RequestParameters { diff --git a/Octokit/Models/Request/Permission.cs b/Octokit/Models/Request/Permission.cs index c9de0fcf..b2b3cea5 100644 --- a/Octokit/Models/Request/Permission.cs +++ b/Octokit/Models/Request/Permission.cs @@ -1,6 +1,11 @@ +using System.Diagnostics.CodeAnalysis; + namespace Octokit { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] + /// + /// Used to describe a permission level. + /// + [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public enum Permission { /// diff --git a/Octokit/Models/Request/PublicRepositoryRequest.cs b/Octokit/Models/Request/PublicRepositoryRequest.cs index a8ee66a8..9b8ebcb4 100644 --- a/Octokit/Models/Request/PublicRepositoryRequest.cs +++ b/Octokit/Models/Request/PublicRepositoryRequest.cs @@ -4,9 +4,16 @@ using System.Globalization; namespace Octokit { + /// + /// Used as part of the request to retrieve all public repositories. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PublicRepositoryRequest : RequestParameters { + /// + /// Initializes a new instance of the class. + /// + /// The integer ID of the last Repository that you’ve seen. public PublicRepositoryRequest(int since) { Ensure.ArgumentNotNull(since, "since"); @@ -14,6 +21,12 @@ namespace Octokit Since = since; } + /// + /// Gets or sets the integer ID of the last Repository that you’ve seen. + /// + /// + /// The since. + /// public long Since { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/PullRequestRequest.cs b/Octokit/Models/Request/PullRequestRequest.cs index fe1e464e..9bbdd7dd 100644 --- a/Octokit/Models/Request/PullRequestRequest.cs +++ b/Octokit/Models/Request/PullRequestRequest.cs @@ -5,6 +5,9 @@ using Octokit.Internal; namespace Octokit { + /// + /// Used to filter requests for lists of pull requests. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PullRequestRequest : RequestParameters { diff --git a/Octokit/Models/Request/PullRequestReviewCommentCreate.cs b/Octokit/Models/Request/PullRequestReviewCommentCreate.cs index 54bc8050..f56e1b02 100644 --- a/Octokit/Models/Request/PullRequestReviewCommentCreate.cs +++ b/Octokit/Models/Request/PullRequestReviewCommentCreate.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a pull request review comment. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PullRequestReviewCommentCreate : RequestParameters { diff --git a/Octokit/Models/Request/PullRequestReviewCommentEdit.cs b/Octokit/Models/Request/PullRequestReviewCommentEdit.cs index 527f4593..ddebeaf0 100644 --- a/Octokit/Models/Request/PullRequestReviewCommentEdit.cs +++ b/Octokit/Models/Request/PullRequestReviewCommentEdit.cs @@ -4,13 +4,16 @@ using System.Globalization; namespace Octokit { + /// + /// Used to edit a pull request review comment + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PullRequestReviewCommentEdit : RequestParameters { /// /// Creates an edit to a comment /// - /// The text of the comment + /// The new text of the comment public PullRequestReviewCommentEdit(string body) { Ensure.ArgumentNotNullOrEmptyString(body, "body"); @@ -19,7 +22,7 @@ namespace Octokit } /// - /// The text of the comment. + /// The new text of the comment. /// public string Body { get; private set; } diff --git a/Octokit/Models/Request/PullRequestReviewCommentReplyCreate.cs b/Octokit/Models/Request/PullRequestReviewCommentReplyCreate.cs index 8a17544b..2f404c2a 100644 --- a/Octokit/Models/Request/PullRequestReviewCommentReplyCreate.cs +++ b/Octokit/Models/Request/PullRequestReviewCommentReplyCreate.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to create a reply to a pull request review comment. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PullRequestReviewCommentReplyCreate : RequestParameters { diff --git a/Octokit/Models/Request/PullRequestReviewCommentRequest.cs b/Octokit/Models/Request/PullRequestReviewCommentRequest.cs index 5d923854..15ade1ce 100644 --- a/Octokit/Models/Request/PullRequestReviewCommentRequest.cs +++ b/Octokit/Models/Request/PullRequestReviewCommentRequest.cs @@ -4,9 +4,15 @@ using System.Globalization; namespace Octokit { + /// + /// Used to filter pull request review comments. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PullRequestReviewCommentRequest : RequestParameters { + /// + /// Initializes a new instance of the class. + /// public PullRequestReviewCommentRequest() { // Default arguments diff --git a/Octokit/Models/Request/PullRequestUpdate.cs b/Octokit/Models/Request/PullRequestUpdate.cs index d5f6121c..b17e97dd 100644 --- a/Octokit/Models/Request/PullRequestUpdate.cs +++ b/Octokit/Models/Request/PullRequestUpdate.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to update an existing pull request. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PullRequestUpdate { diff --git a/Octokit/Models/Request/ReferenceUpdate.cs b/Octokit/Models/Request/ReferenceUpdate.cs index 2c90ad35..e1ac7c4e 100644 --- a/Octokit/Models/Request/ReferenceUpdate.cs +++ b/Octokit/Models/Request/ReferenceUpdate.cs @@ -4,13 +4,28 @@ using System.Globalization; namespace Octokit { + /// + /// Upsed to update a Git reference. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ReferenceUpdate { + /// + /// Initializes a new instance of the class. + /// + /// The sha. public ReferenceUpdate(string sha) : this(sha, false) { } + /// + /// Initializes a new instance of the class. + /// + /// The SHA1 value to set this reference to. + /// + /// Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this + /// out or setting it to false will make sure you’re not overwriting work. + /// public ReferenceUpdate(string sha, bool force) { Ensure.ArgumentNotNullOrEmptyString(sha, "sha"); @@ -19,7 +34,21 @@ namespace Octokit Force = force; } + /// + /// The SHA1 value to set this reference to. + /// + /// + /// The sha. + /// public string Sha { get; private set; } + + /// + /// Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this + /// out or setting it to false will make sure you’re not overwriting work. + /// + /// + /// true if force; otherwise, false. + /// public bool Force { get; private set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/ReleaseAssetUpdate.cs b/Octokit/Models/Request/ReleaseAssetUpdate.cs index 12f32cae..638c5f8c 100644 --- a/Octokit/Models/Request/ReleaseAssetUpdate.cs +++ b/Octokit/Models/Request/ReleaseAssetUpdate.cs @@ -4,9 +4,16 @@ using System.Globalization; namespace Octokit { + /// + /// Used to update a release asset. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ReleaseAssetUpdate { + /// + /// Initializes a new instance of the class. + /// + /// The name. public ReleaseAssetUpdate(string name) { Ensure.ArgumentNotNullOrEmptyString(name, "name"); diff --git a/Octokit/Models/Request/ReleaseAssetUpload.cs b/Octokit/Models/Request/ReleaseAssetUpload.cs index 12e2d79e..9bd64c7a 100644 --- a/Octokit/Models/Request/ReleaseAssetUpload.cs +++ b/Octokit/Models/Request/ReleaseAssetUpload.cs @@ -5,11 +5,34 @@ using System.IO; namespace Octokit { + /// + /// Used to upload a release asset. + /// + /// + /// This endpoint makes use of a Hypermedia relation to determine which URL to access. This endpoint is provided + /// by a URI template in the releases API response. You need to use an HTTP client which supports SNI to make + /// calls to this endpoint. The asset data is expected in its raw binary form, rather than JSON. Everything else + /// about the endpoint is the same as the rest of the API. For example, youll still need to pass your + /// authentication to be able to upload an asset. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ReleaseAssetUpload { + /// + /// Initializes a new instance of the class. + /// public ReleaseAssetUpload() { } + /// + /// Initializes a new instance of the class. + /// + /// Name of the file. + /// + /// The content type of the asset. Example: "application/zip". For a list of acceptable types, refer this list + /// of common media types. + /// + /// The raw data. + /// The timeout. public ReleaseAssetUpload(string fileName, string contentType, Stream rawData, TimeSpan? timeout) { FileName = fileName; @@ -18,9 +41,36 @@ namespace Octokit Timeout = timeout; } + /// + /// Gets or sets the name of the file. + /// + /// + /// The name of the file. + /// public string FileName { get; set; } + + /// + /// Gets or sets the type of the content. + /// + /// + /// The type of the content. + /// public string ContentType { get; set; } + + /// + /// Gets or sets the raw data. + /// + /// + /// The raw data. + /// public Stream RawData { get; set; } + + /// + /// Gets or sets the timeout. + /// + /// + /// The timeout. + /// public TimeSpan? Timeout { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/ReleaseUpdate.cs b/Octokit/Models/Request/ReleaseUpdate.cs index 84f42869..4cea9982 100644 --- a/Octokit/Models/Request/ReleaseUpdate.cs +++ b/Octokit/Models/Request/ReleaseUpdate.cs @@ -4,14 +4,64 @@ using System.Globalization; namespace Octokit { + /// + /// Used to update a release. + /// + /// + /// API: https://developer.github.com/v3/repos/releases/#create-a-release + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ReleaseUpdate { + /// + /// Gets the name of the tag. + /// + /// + /// The name of the tag. + /// public string TagName { get; set; } + + /// + /// Specifies the commitish value that determines where the Git tag is created from. Can be any branch or + /// commit SHA. Unused if the Git tag already exists. Default: the repositorys default branch + /// (usually master). + /// + /// + /// The target commitish. + /// public string TargetCommitish { get; set; } + + /// + /// Gets or sets the name of the release. + /// + /// + /// The name. + /// public string Name { get; set; } + + /// + /// Gets or sets the text describing the contents of the tag. + /// + /// + /// The body. + /// public string Body { get; set; } + + /// + /// Gets or sets a value indicating whether this is a draft (unpublished). + /// Default: false + /// + /// + /// true if draft; otherwise, false. + /// public bool? Draft { get; set; } + + /// + /// Gets or sets a value indicating whether this is prerelease. + /// + /// + /// true if prerelease; otherwise, false. + /// public bool? Prerelease { get; set; } internal string DebuggerDisplay diff --git a/Octokit/Models/Request/RepositoryForksListRequest.cs b/Octokit/Models/Request/RepositoryForksListRequest.cs index 74e1f047..75ce707d 100644 --- a/Octokit/Models/Request/RepositoryForksListRequest.cs +++ b/Octokit/Models/Request/RepositoryForksListRequest.cs @@ -4,14 +4,26 @@ using System.Globalization; namespace Octokit { + /// + /// Used to request and filter a list of repository forks. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class RepositoryForksListRequest : RequestParameters { + /// + /// Initializes a new instance of the class. + /// public RepositoryForksListRequest() { Sort = Sort.Newest; // Default in accordance with the documentation } + /// + /// Gets or sets the sort property. + /// + /// + /// The sort. + /// public Sort Sort { get; set; } internal string DebuggerDisplay @@ -23,10 +35,24 @@ namespace Octokit } } + /// + /// The sort order. + /// public enum Sort { + /// + /// Sort by date and show the newest first. + /// Newest, + + /// + /// Sort by date and show the oldest first. + /// Oldest, + + /// + /// Sort by the number of stargazers. + /// Stargazers } } diff --git a/Octokit/Models/Request/RepositoryIssueRequest.cs b/Octokit/Models/Request/RepositoryIssueRequest.cs index 8d01e19b..6e82cefc 100644 --- a/Octokit/Models/Request/RepositoryIssueRequest.cs +++ b/Octokit/Models/Request/RepositoryIssueRequest.cs @@ -2,6 +2,9 @@ namespace Octokit { + /// + /// Used to requent and filter a list of repository issues. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class RepositoryIssueRequest : IssueRequest { diff --git a/Octokit/Models/Request/RepositoryRequest.cs b/Octokit/Models/Request/RepositoryRequest.cs index a420e9ff..1bd51ae0 100644 --- a/Octokit/Models/Request/RepositoryRequest.cs +++ b/Octokit/Models/Request/RepositoryRequest.cs @@ -1,18 +1,40 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using Octokit.Internal; namespace Octokit { + /// + /// Used to request and filter a list of repositories. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class RepositoryRequest : RequestParameters { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] + /// + /// Gets or sets the repository type. + /// + /// + /// The type. + /// + [SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] public RepositoryType Type { get; set; } + /// + /// Gets or sets the sort property. + /// + /// + /// The sort. + /// public RepositorySort Sort { get; set; } + /// + /// Gets or sets the sort direction. + /// + /// + /// The direction. + /// public SortDirection Direction { get; set; } internal string DebuggerDisplay @@ -24,21 +46,60 @@ namespace Octokit } } + /// + /// The properties that repositories can be filtered by. + /// public enum RepositoryType { + /// + /// Return all repositories. + /// All, + + /// + /// Return repositories that the current authenticated user owns. + /// Owner, + + /// + /// Returns public repositoires. + /// Public, + + /// + /// The privateReturn private repositories. + /// Private, + + /// + /// Return repositories for which the current authenticated user is a member of the org or team. + /// Member } + /// + /// The properties that repositories can be sorted by. + /// public enum RepositorySort { + /// + /// Sort by the date the repository was created. + /// Created, + + /// + /// Sort by the date the repository was last updated. + /// Updated, + + /// + /// Sort by the date the repository was last pushed. + /// Pushed, + /// + /// Sort by the repository name. + /// [Parameter(Value = "full_name")] FullName } diff --git a/Octokit/Models/Request/RequestParameters.cs b/Octokit/Models/Request/RequestParameters.cs index 04a8e06b..43fc7c8f 100644 --- a/Octokit/Models/Request/RequestParameters.cs +++ b/Octokit/Models/Request/RequestParameters.cs @@ -23,6 +23,10 @@ namespace Octokit static readonly ConcurrentDictionary> _propertiesMap = new ConcurrentDictionary>(); #endif + /// + /// Converts the derived object into a dictionary that can be used to supply query string parameters. + /// + /// public virtual IDictionary ToParametersDictionary() { var map = _propertiesMap.GetOrAdd(GetType(), GetPropertyParametersForType); diff --git a/Octokit/Models/Request/SearchCodeRequest.cs b/Octokit/Models/Request/SearchCodeRequest.cs index 21c89f2a..2473b6b4 100644 --- a/Octokit/Models/Request/SearchCodeRequest.cs +++ b/Octokit/Models/Request/SearchCodeRequest.cs @@ -16,11 +16,21 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class SearchCodeRequest : BaseSearchRequest { + /// + /// Initializes a new instance of the class. + /// + /// The search term. public SearchCodeRequest(string term) : base(term) { Repos = new RepositoryCollection(); } + /// + /// Initializes a new instance of the class. + /// + /// The term. + /// The owner. + /// The name. public SearchCodeRequest(string term, string owner, string name) : this(term) { diff --git a/Octokit/Models/Request/SearchQualifierOperator.cs b/Octokit/Models/Request/SearchQualifierOperator.cs index b37e866e..5ed9481f 100644 --- a/Octokit/Models/Request/SearchQualifierOperator.cs +++ b/Octokit/Models/Request/SearchQualifierOperator.cs @@ -1,10 +1,28 @@ namespace Octokit { + /// + /// Used to qualify a serch term. + /// public enum SearchQualifierOperator { - GreaterThan, // > - LessThan, // < - LessThanOrEqualTo, // <= - GreaterThanOrEqualTo// >= + /// + /// Greater than ">" + /// + GreaterThan, + + /// + /// Less than "<" + /// + LessThan, + + /// + /// Less than or equal to. "<=" + /// + LessThanOrEqualTo, + + /// + /// Greater than or equal to. ">=" + /// + GreaterThanOrEqualTo } } diff --git a/Octokit/Models/Request/SearchRepositoriesRequest.cs b/Octokit/Models/Request/SearchRepositoriesRequest.cs index 6e321447..1aa5293e 100644 --- a/Octokit/Models/Request/SearchRepositoriesRequest.cs +++ b/Octokit/Models/Request/SearchRepositoriesRequest.cs @@ -15,10 +15,17 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class SearchRepositoriesRequest : BaseSearchRequest { + /// + /// Initializes a new instance of the class. + /// public SearchRepositoriesRequest() { Order = SortDirection.Descending; } + /// + /// Initializes a new instance of the class. + /// + /// The search term. public SearchRepositoriesRequest(string term) : base(term) { diff --git a/Octokit/Models/Request/SearchUsersRequest.cs b/Octokit/Models/Request/SearchUsersRequest.cs index 9fc966c4..67317f3b 100644 --- a/Octokit/Models/Request/SearchUsersRequest.cs +++ b/Octokit/Models/Request/SearchUsersRequest.cs @@ -14,6 +14,10 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class SearchUsersRequest : BaseSearchRequest { + /// + /// Initializes a new instance of the class. + /// + /// The search term. public SearchUsersRequest(string term) : base(term) { } @@ -24,6 +28,9 @@ namespace Octokit /// public UsersSearchSort? SortField { get; set; } + /// + /// The sort field as a string. + /// public override string Sort { get { return SortField.ToParameter(); } diff --git a/Octokit/Models/Request/SshKeyUpdate.cs b/Octokit/Models/Request/SshKeyUpdate.cs index ab33bf5f..3a3b29f0 100644 --- a/Octokit/Models/Request/SshKeyUpdate.cs +++ b/Octokit/Models/Request/SshKeyUpdate.cs @@ -4,6 +4,9 @@ using System.Globalization; namespace Octokit { + /// + /// Used to update an SSH key + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class SshKeyUpdate { diff --git a/Octokit/Models/Request/StarredRequest.cs b/Octokit/Models/Request/StarredRequest.cs index eb9bb6e8..7eeecf7a 100644 --- a/Octokit/Models/Request/StarredRequest.cs +++ b/Octokit/Models/Request/StarredRequest.cs @@ -5,18 +5,36 @@ using Octokit.Internal; namespace Octokit { + /// + /// Used to retrieve and filter lists of stars. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class StarredRequest : RequestParameters { + /// + /// Initializes a new instance of the class. + /// public StarredRequest() { SortProperty = StarredSort.Created; SortDirection = SortDirection.Ascending; } + /// + /// Gets or sets the sort property. + /// + /// + /// The sort property. + /// [Parameter(Key = "sort")] public StarredSort SortProperty { get; set; } + /// + /// Gets or sets the sort direction. + /// + /// + /// The sort direction. + /// [Parameter(Key = "direction")] public SortDirection SortDirection { get; set; } @@ -29,9 +47,19 @@ namespace Octokit } } + /// + /// Property to sort stars by. + /// public enum StarredSort { + /// + /// Sort y the date the star was created. + /// Created, + + /// + /// Sort by the date the star was last updated. + /// Updated } } diff --git a/Octokit/Models/Request/UpdateTeam.cs b/Octokit/Models/Request/UpdateTeam.cs index 09595b7c..2ae6dff0 100644 --- a/Octokit/Models/Request/UpdateTeam.cs +++ b/Octokit/Models/Request/UpdateTeam.cs @@ -4,14 +4,26 @@ using System.Globalization; namespace Octokit { + /// + /// Used to update a teamm. + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class UpdateTeam { + /// + /// Initializes a new instance of the class. + /// + /// The team. public UpdateTeam(string team) { Name = team; } + /// + /// Initializes a new instance of the class. + /// + /// The team. + /// The permission. public UpdateTeam(string team, Permission permission) { Name = team; diff --git a/Octokit/Models/Response/PullRequestMerge.cs b/Octokit/Models/Response/PullRequestMerge.cs index 898dde4b..667694c3 100644 --- a/Octokit/Models/Response/PullRequestMerge.cs +++ b/Octokit/Models/Response/PullRequestMerge.cs @@ -4,9 +4,19 @@ using System.Globalization; namespace Octokit { + /// + /// Represents the response from an attempt to merge a pull request. + /// + /// + /// Note the request to merge is represented by + /// API: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button + /// [DebuggerDisplay("{DebuggerDisplay,nq}")] public class PullRequestMerge { + /// + /// Initializes a new instance of the class. + /// public PullRequestMerge() { } public PullRequestMerge(string sha, bool merged, string message) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 223445d2..47349726 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,13 @@ +### New in 0.17.0 (released TBD) + +* Improved: Added ability to create deploy keys that are read only and can only be used to read repository contents and not write to them - via @haacked +* Fixed: Bug that prevented sepecifying a commit message for pull request merges - via @haacked + +**Breaking Changes:** + - `NewDeployment` constructor requires a ref as this is required for the API. It no longer has a default constructor. + - `NewDeploymentStatus` constructor requires a `DeploymentState` as this is required for the API. It no longer has a default constructor. + - The `Name` property of `NewTeam` is now read only. It is specified via the constructor. + ### New in 0.16.0 (released 2015/09/17) * New: Implemented `GetMetadata` method of `IMiscellaneousClient` to retrieve information from the Meta endpoint -#892 via @haacked