mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
Merge master into dotnetcore (#1599)
* bugfix - PUT should have a payload for Mark as Read (#1579) * bugfix - PUT should have a payload for Mark as Read * also fix the Observable client test * add integration tests for MarkRead methods * Fixup MarkReadForRepository methods to specify a body in the PUT request * Fix unit tests for regular and observable client * helps if the new files are included in the test project :) * Cloning ApiInfo object should work when some fields are null (#1580) * Adjust ApiInfo.Clone() to work even if some elements (eg ETag) are null * Remove c# 6 language feature and do it the old school way * Add a test for cloning ApiInfo when some fields are null * The 3 lists can never be null anyway so remove some un-needed statements * Add test for null RateLimit * Remove Rx-Main dependency from samples This resolves #1592 - LINQPad doesn't understand how to restore this unlisted package and it's not actually needed in the samples. * Adding RemovedFromProject and other missing EventInfoState types. (#1591) * Adding missing review types to event info. * Fixing whitespace. * Reword `BaseRefChanged` comment * Adding missing event types. * Change response models 'Url' properties from `Uri` to `string` (#1585) * Add convention test to ensure 'Url' properties are of type string Closes #1582 * Change 'Url' properties from Uri to string Global Find/Replace FTW! * fix compilation errors in the integration tests project * Extend 'Url' properties type check to request models * Stick to convention tests naming convention * Remove unused using directives in models Changing from `Uri` to `string` means the `using System;` directive was not needed anymore in some files * Update exception message wording * empty commit to trigger a new build - hopefully Travis passes * add convention test to ensure request models have Uri 'Url' properties * make request models 'Url' properties Uri fix typo in convention test name * revert some request models 'Url' properties as `string` see https://github.com/octokit/octokit.net/pull/1585#issuecomment-297186728 * Change test so that all model types must have 'Url' properties of type string - Filter test input to only get types which have 'Url' properties - Merge response and request model types tests into one - Unparameterize the exception since we only check for the string type now * Fix string.Format tokens If this PR doesn't get rebased, it'll be my wall of shame FOREVER! * and then it's even more embarrassing when the commit message says rebased but you really meant squashed * Remove exclusion of `Release` from request models
This commit is contained in:
committed by
Ryan Gribble
parent
11bbb2dbee
commit
9c80b00e6f
@@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Octokit.Tests.Conventions
|
||||||
|
{
|
||||||
|
public class InvalidUrlPropertyTypeException : Exception
|
||||||
|
{
|
||||||
|
public InvalidUrlPropertyTypeException(Type modelType, IEnumerable<PropertyInfo> propertiesWithInvalidType)
|
||||||
|
: base(CreateMessage(modelType, propertiesWithInvalidType))
|
||||||
|
{ }
|
||||||
|
|
||||||
|
static string CreateMessage(Type modelType, IEnumerable<PropertyInfo> propertiesWithInvalidType)
|
||||||
|
{
|
||||||
|
return string.Format("Model type '{0}' contains the following properties that are named or suffixed with 'Url' but are not of type String: {!}{2}",
|
||||||
|
modelType.FullName,
|
||||||
|
Environment.NewLine,
|
||||||
|
string.Join(Environment.NewLine, propertiesWithInvalidType.Select(x => x.Name)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -107,6 +107,22 @@ namespace Octokit.Tests.Conventions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[MemberData("ModelTypesWithUrlProperties")]
|
||||||
|
public void ModelsHaveUrlPropertiesOfTypeString(Type modelType)
|
||||||
|
{
|
||||||
|
var propertiesWithInvalidType = modelType
|
||||||
|
.GetProperties()
|
||||||
|
.Where(IsUrlProperty)
|
||||||
|
.Where(x => x.PropertyType != typeof(string))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (propertiesWithInvalidType.Count > 0)
|
||||||
|
{
|
||||||
|
throw new InvalidUrlPropertyTypeException(modelType, propertiesWithInvalidType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<object[]> GetClientInterfaces()
|
public static IEnumerable<object[]> GetClientInterfaces()
|
||||||
{
|
{
|
||||||
return typeof(IGitHubClient)
|
return typeof(IGitHubClient)
|
||||||
@@ -123,6 +139,16 @@ namespace Octokit.Tests.Conventions
|
|||||||
get { return GetModelTypes(includeRequestModels: true).Select(type => new[] { type }); }
|
get { return GetModelTypes(includeRequestModels: true).Select(type => new[] { type }); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<object[]> ModelTypesWithUrlProperties
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return GetModelTypes(includeRequestModels: true)
|
||||||
|
.Where(type => type.GetProperties().Any(IsUrlProperty))
|
||||||
|
.Select(type => new[] { type });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static IEnumerable<object[]> ResponseModelTypes
|
public static IEnumerable<object[]> ResponseModelTypes
|
||||||
{
|
{
|
||||||
get { return GetModelTypes(includeRequestModels: false).Select(type => new[] { type }); }
|
get { return GetModelTypes(includeRequestModels: false).Select(type => new[] { type }); }
|
||||||
@@ -216,5 +242,10 @@ namespace Octokit.Tests.Conventions
|
|||||||
yield return returnType;
|
yield return returnType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsUrlProperty(PropertyInfo property)
|
||||||
|
{
|
||||||
|
return property.Name.EndsWith("Url");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1228,9 +1228,9 @@ public class IssuesClientTests : IDisposable
|
|||||||
var issue = await _issuesClient.Create(_context.RepositoryOwner, _context.RepositoryName, newIssue);
|
var issue = await _issuesClient.Create(_context.RepositoryOwner, _context.RepositoryName, newIssue);
|
||||||
|
|
||||||
Assert.NotNull(issue.CommentsUrl);
|
Assert.NotNull(issue.CommentsUrl);
|
||||||
Assert.Equal(new Uri(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "comments")), issue.CommentsUrl);
|
Assert.Equal(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "comments"), issue.CommentsUrl);
|
||||||
Assert.NotNull(issue.EventsUrl);
|
Assert.NotNull(issue.EventsUrl);
|
||||||
Assert.Equal(new Uri(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "events")), issue.EventsUrl);
|
Assert.Equal(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "events"), issue.EventsUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -1246,9 +1246,9 @@ public class IssuesClientTests : IDisposable
|
|||||||
var issue = await _issuesClient.Create(_context.Repository.Id, newIssue);
|
var issue = await _issuesClient.Create(_context.Repository.Id, newIssue);
|
||||||
|
|
||||||
Assert.NotNull(issue.CommentsUrl);
|
Assert.NotNull(issue.CommentsUrl);
|
||||||
Assert.Equal(new Uri(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "comments")), issue.CommentsUrl);
|
Assert.Equal(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "comments"), issue.CommentsUrl);
|
||||||
Assert.NotNull(issue.EventsUrl);
|
Assert.NotNull(issue.EventsUrl);
|
||||||
Assert.Equal(new Uri(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "events")), issue.EventsUrl);
|
Assert.Equal(string.Format(expectedUri, _context.RepositoryOwner, _context.RepositoryName, issue.Number, "events"), issue.EventsUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ public class IssuesEventsClientTests : IDisposable
|
|||||||
Assert.NotNull(issueEvent);
|
Assert.NotNull(issueEvent);
|
||||||
Assert.Equal(EventInfoState.Merged, issueEvent.Event);
|
Assert.Equal(EventInfoState.Merged, issueEvent.Event);
|
||||||
Assert.Equal("0bb8747a0ad1a9efff201ea017a0a6a4f69b797e", issueEvent.CommitId);
|
Assert.Equal("0bb8747a0ad1a9efff201ea017a0a6a4f69b797e", issueEvent.CommitId);
|
||||||
Assert.Equal(new Uri("https://api.github.com/repos/octokit/octokit.net/commits/0bb8747a0ad1a9efff201ea017a0a6a4f69b797e"), issueEvent.CommitUrl);
|
Assert.Equal("https://api.github.com/repos/octokit/octokit.net/commits/0bb8747a0ad1a9efff201ea017a0a6a4f69b797e", issueEvent.CommitUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System.Threading.Tasks;
|
||||||
|
using Octokit.Tests.Integration;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
public class NotificationsClientTests
|
||||||
|
{
|
||||||
|
public class TheMarkAsReadMethod
|
||||||
|
{
|
||||||
|
[IntegrationTest]
|
||||||
|
public async Task MarksNotificationsRead()
|
||||||
|
{
|
||||||
|
var github = Helper.GetAuthenticatedClient();
|
||||||
|
|
||||||
|
await github.Activity.Notifications.MarkAsRead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheMarkAsReadForRepositoryMethod
|
||||||
|
{
|
||||||
|
[IntegrationTest]
|
||||||
|
public async Task MarksNotificationsRead()
|
||||||
|
{
|
||||||
|
var owner = "octokit";
|
||||||
|
var repo = "octokit.net";
|
||||||
|
|
||||||
|
var github = Helper.GetAuthenticatedClient();
|
||||||
|
|
||||||
|
await github.Activity.Notifications.MarkAsReadForRepository(owner, repo);
|
||||||
|
}
|
||||||
|
|
||||||
|
[IntegrationTest]
|
||||||
|
public async Task MarksNotificationsReadForRepositoryId()
|
||||||
|
{
|
||||||
|
var repositoryId = 7528679;
|
||||||
|
|
||||||
|
var github = Helper.GetAuthenticatedClient();
|
||||||
|
|
||||||
|
await github.Activity.Notifications.MarkAsReadForRepository(repositoryId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -73,7 +73,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(1, contents.Count);
|
Assert.Equal(1, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -88,7 +88,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(1, contents.Count);
|
Assert.Equal(1, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -131,7 +131,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(3, contents.Count);
|
Assert.Equal(3, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octocat/Spoon-Knife/blob/master/README.md"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octocat/Spoon-Knife/blob/master/README.md", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -146,7 +146,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(3, contents.Count);
|
Assert.Equal(3, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octocat/Spoon-Knife/blob/master/README.md"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octocat/Spoon-Knife/blob/master/README.md", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -190,7 +190,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(1, contents.Count);
|
Assert.Equal(1, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -205,7 +205,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(1, contents.Count);
|
Assert.Equal(1, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octokit/octokit.net/blob/master/Octokit.Reactive/ObservableGitHubClient.cs", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -248,7 +248,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(3, contents.Count);
|
Assert.Equal(3, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octocat/Spoon-Knife/blob/master/README.md"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octocat/Spoon-Knife/blob/master/README.md", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
@@ -263,7 +263,7 @@ namespace Octokit.Tests.Integration.Clients
|
|||||||
|
|
||||||
Assert.Equal(3, contents.Count);
|
Assert.Equal(3, contents.Count);
|
||||||
Assert.Equal(ContentType.File, contents.First().Type);
|
Assert.Equal(ContentType.File, contents.First().Type);
|
||||||
Assert.Equal(new Uri("https://github.com/octocat/Spoon-Knife/blob/master/README.md"), contents.First().HtmlUrl);
|
Assert.Equal("https://github.com/octocat/Spoon-Knife/blob/master/README.md", contents.First().HtmlUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
[IntegrationTest]
|
[IntegrationTest]
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using System.Reactive.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Octokit.Reactive;
|
||||||
|
using Octokit.Tests.Integration;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
public class ObservableNotificationsClientTests
|
||||||
|
{
|
||||||
|
public class TheMarkAsReadMethod
|
||||||
|
{
|
||||||
|
[IntegrationTest]
|
||||||
|
public async Task MarksNotificationsRead()
|
||||||
|
{
|
||||||
|
var client = new ObservableGitHubClient(Helper.GetAuthenticatedClient());
|
||||||
|
|
||||||
|
await client.Activity.Notifications.MarkAsRead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheMarkAsReadForRepositoryMethod
|
||||||
|
{
|
||||||
|
[IntegrationTest]
|
||||||
|
public async Task MarksNotificationsRead()
|
||||||
|
{
|
||||||
|
var owner = "octokit";
|
||||||
|
var repo = "octokit.net";
|
||||||
|
|
||||||
|
var client = new ObservableGitHubClient(Helper.GetAuthenticatedClient());
|
||||||
|
|
||||||
|
await client.Activity.Notifications.MarkAsReadForRepository(owner, repo);
|
||||||
|
}
|
||||||
|
|
||||||
|
[IntegrationTest]
|
||||||
|
public async Task MarksNotificationsReadForRepositoryId()
|
||||||
|
{
|
||||||
|
var repositoryId = 7528679;
|
||||||
|
|
||||||
|
var client = new ObservableGitHubClient(Helper.GetAuthenticatedClient());
|
||||||
|
|
||||||
|
await client.Activity.Notifications.MarkAsReadForRepository(repositoryId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,7 +31,7 @@ namespace Octokit.Tests.Integration
|
|||||||
var issue = await client.Issue.Create(owner, oldRepoName, newIssue);
|
var issue = await client.Issue.Create(owner, oldRepoName, newIssue);
|
||||||
Assert.NotNull(issue);
|
Assert.NotNull(issue);
|
||||||
|
|
||||||
Assert.True(issue.Url.AbsoluteUri.Contains("repository-after-rename"));
|
Assert.True(issue.Url.Contains("repository-after-rename"));
|
||||||
|
|
||||||
var resolvedIssue = await client.Issue.Get(owner, newRepoName, issue.Number);
|
var resolvedIssue = await client.Issue.Get(owner, newRepoName, issue.Number);
|
||||||
|
|
||||||
|
|||||||
@@ -607,10 +607,10 @@ namespace Octokit.Tests.Clients
|
|||||||
|
|
||||||
Assert.Equal(1, response.Body.Number);
|
Assert.Equal(1, response.Body.Number);
|
||||||
|
|
||||||
Assert.Equal(new Uri("https://api.github.com/repos/octokit-net-test/public-repo-20131022050247078/issues/1"), response.Body.Url);
|
Assert.Equal("https://api.github.com/repos/octokit-net-test/public-repo-20131022050247078/issues/1", response.Body.Url);
|
||||||
Assert.Equal(new Uri("https://github.com/octokit-net-test/public-repo-20131022050247078/issues/1"), response.Body.HtmlUrl);
|
Assert.Equal("https://github.com/octokit-net-test/public-repo-20131022050247078/issues/1", response.Body.HtmlUrl);
|
||||||
Assert.Equal(new Uri("https://api.github.com/repos/octokit-net-test/public-repo-20131022050247078/issues/1/comments"), response.Body.CommentsUrl);
|
Assert.Equal("https://api.github.com/repos/octokit-net-test/public-repo-20131022050247078/issues/1/comments", response.Body.CommentsUrl);
|
||||||
Assert.Equal(new Uri("https://api.github.com/repos/octokit-net-test/public-repo-20131022050247078/issues/1/events"), response.Body.EventsUrl);
|
Assert.Equal("https://api.github.com/repos/octokit-net-test/public-repo-20131022050247078/issues/1/events", response.Body.EventsUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ namespace Octokit.Tests.Clients
|
|||||||
|
|
||||||
client.MarkAsRead();
|
client.MarkAsRead();
|
||||||
|
|
||||||
connection.Received().Put(endpoint);
|
connection.Received().Put<object>(endpoint, Args.Object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ namespace Octokit.Tests.Clients
|
|||||||
|
|
||||||
client.MarkAsReadForRepository("banana", "split");
|
client.MarkAsReadForRepository("banana", "split");
|
||||||
|
|
||||||
connection.Received().Put(endpoint);
|
connection.Received().Put<object>(endpoint, Args.Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -311,7 +311,7 @@ namespace Octokit.Tests.Clients
|
|||||||
|
|
||||||
client.MarkAsReadForRepository(1);
|
client.MarkAsReadForRepository(1);
|
||||||
|
|
||||||
connection.Received().Put(endpoint);
|
connection.Received().Put<object>(endpoint, Args.Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -94,6 +94,92 @@ namespace Octokit.Tests.Http
|
|||||||
Assert.Equal(original.RateLimit.Reset, clone.RateLimit.Reset);
|
Assert.Equal(original.RateLimit.Reset, clone.RateLimit.Reset);
|
||||||
Assert.NotSame(original.RateLimit.Reset, clone.RateLimit.Reset);
|
Assert.NotSame(original.RateLimit.Reset, clone.RateLimit.Reset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void CanCloneWithNullETag()
|
||||||
|
{
|
||||||
|
var original = new ApiInfo(
|
||||||
|
new Dictionary<string, Uri>
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"next",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=4&per_page=5")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"last",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=131&per_page=5")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"first",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=1&per_page=5")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prev",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=2&per_page=5")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new List<string>
|
||||||
|
{
|
||||||
|
"user"
|
||||||
|
},
|
||||||
|
new List<string>(),
|
||||||
|
null,
|
||||||
|
new RateLimit(100, 75, 1372700873)
|
||||||
|
);
|
||||||
|
|
||||||
|
var clone = original.Clone();
|
||||||
|
|
||||||
|
Assert.NotNull(clone);
|
||||||
|
Assert.Equal(4, clone.Links.Count);
|
||||||
|
Assert.Equal(1, clone.OauthScopes.Count);
|
||||||
|
Assert.Equal(0, clone.AcceptedOauthScopes.Count);
|
||||||
|
Assert.Null(clone.Etag);
|
||||||
|
Assert.Equal(100, clone.RateLimit.Limit);
|
||||||
|
Assert.Equal(75, clone.RateLimit.Remaining);
|
||||||
|
Assert.Equal(1372700873, clone.RateLimit.ResetAsUtcEpochSeconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void CanCloneWithNullRateLimit()
|
||||||
|
{
|
||||||
|
var original = new ApiInfo(
|
||||||
|
new Dictionary<string, Uri>
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"next",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=4&per_page=5")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"last",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=131&per_page=5")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"first",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=1&per_page=5")
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"prev",
|
||||||
|
new Uri("https://api.github.com/repos/rails/rails/issues?page=2&per_page=5")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new List<string>
|
||||||
|
{
|
||||||
|
"user"
|
||||||
|
},
|
||||||
|
new List<string>(),
|
||||||
|
"123abc",
|
||||||
|
null
|
||||||
|
);
|
||||||
|
|
||||||
|
var clone = original.Clone();
|
||||||
|
|
||||||
|
Assert.NotNull(clone);
|
||||||
|
Assert.Equal(4, clone.Links.Count);
|
||||||
|
Assert.Equal(1, clone.OauthScopes.Count);
|
||||||
|
Assert.Equal(0, clone.AcceptedOauthScopes.Count);
|
||||||
|
Assert.Equal("123abc", clone.Etag);
|
||||||
|
Assert.Null(clone.RateLimit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ namespace Octokit.Tests.Reactive
|
|||||||
|
|
||||||
client.MarkAsRead();
|
client.MarkAsRead();
|
||||||
|
|
||||||
connection.Received().Put(endpoint);
|
connection.Received().Put<object>(endpoint, Args.Object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ namespace Octokit.Tests.Reactive
|
|||||||
|
|
||||||
client.MarkAsReadForRepository("banana", "split");
|
client.MarkAsReadForRepository("banana", "split");
|
||||||
|
|
||||||
connection.Received().Put(endpoint);
|
connection.Received().Put<object>(endpoint, Args.Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -331,7 +331,7 @@ namespace Octokit.Tests.Reactive
|
|||||||
|
|
||||||
client.MarkAsReadForRepository(1);
|
client.MarkAsReadForRepository(1);
|
||||||
|
|
||||||
connection.Received().Put(endpoint);
|
connection.Received().Put<object>(endpoint, Args.Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Octokit
|
|||||||
var endpoint = new Uri("emojis", UriKind.Relative);
|
var endpoint = new Uri("emojis", UriKind.Relative);
|
||||||
var response = await _connection.Get<Dictionary<string, string>>(endpoint, null, null).ConfigureAwait(false);
|
var response = await _connection.Get<Dictionary<string, string>>(endpoint, null, null).ConfigureAwait(false);
|
||||||
return new ReadOnlyCollection<Emoji>(
|
return new ReadOnlyCollection<Emoji>(
|
||||||
response.Body.Select(kvp => new Emoji(kvp.Key, new Uri(kvp.Value))).ToArray());
|
response.Body.Select(kvp => new Emoji(kvp.Key, kvp.Value)).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ namespace Octokit
|
|||||||
/// <remarks>http://developer.github.com/v3/activity/notifications/#mark-as-read</remarks>
|
/// <remarks>http://developer.github.com/v3/activity/notifications/#mark-as-read</remarks>
|
||||||
public Task MarkAsRead()
|
public Task MarkAsRead()
|
||||||
{
|
{
|
||||||
return ApiConnection.Put(ApiUrls.Notifications());
|
return ApiConnection.Put<object>(ApiUrls.Notifications(), new object());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -213,7 +213,7 @@ namespace Octokit
|
|||||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
return ApiConnection.Put(ApiUrls.Notifications(owner, name));
|
return ApiConnection.Put<object>(ApiUrls.Notifications(owner, name), new object());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -223,7 +223,7 @@ namespace Octokit
|
|||||||
/// <remarks>http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository</remarks>
|
/// <remarks>http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository</remarks>
|
||||||
public Task MarkAsReadForRepository(long repositoryId)
|
public Task MarkAsReadForRepository(long repositoryId)
|
||||||
{
|
{
|
||||||
return ApiConnection.Put(ApiUrls.Notifications(repositoryId));
|
return ApiConnection.Put<object>(ApiUrls.Notifications(repositoryId), new object());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
Ensure.ArgumentNotNull(links, "links");
|
Ensure.ArgumentNotNull(links, "links");
|
||||||
Ensure.ArgumentNotNull(oauthScopes, "oauthScopes");
|
Ensure.ArgumentNotNull(oauthScopes, "oauthScopes");
|
||||||
|
Ensure.ArgumentNotNull(acceptedOauthScopes, "acceptedOauthScopes");
|
||||||
|
|
||||||
Links = new ReadOnlyDictionary<string, Uri>(links);
|
Links = new ReadOnlyDictionary<string, Uri>(links);
|
||||||
OauthScopes = new ReadOnlyCollection<string>(oauthScopes);
|
OauthScopes = new ReadOnlyCollection<string>(oauthScopes);
|
||||||
@@ -56,16 +57,11 @@ namespace Octokit
|
|||||||
/// <returns>A clone of <seealso cref="ApiInfo"/></returns>
|
/// <returns>A clone of <seealso cref="ApiInfo"/></returns>
|
||||||
public ApiInfo Clone()
|
public ApiInfo Clone()
|
||||||
{
|
{
|
||||||
// Seem to have to do this to pass a whole bunch of tests (for example Octokit.Tests.Clients.EventsClientTests.DeserializesCommitCommentEventCorrectly)
|
|
||||||
// I believe this has something to do with the Mocking framework.
|
|
||||||
if (Links == null || OauthScopes == null || RateLimit == null || Etag == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return new ApiInfo(Links.Clone(),
|
return new ApiInfo(Links.Clone(),
|
||||||
OauthScopes.Clone(),
|
OauthScopes.Clone(),
|
||||||
AcceptedOauthScopes.Clone(),
|
AcceptedOauthScopes.Clone(),
|
||||||
new string(Etag.ToCharArray()),
|
Etag != null ? new string(Etag.ToCharArray()) : null,
|
||||||
RateLimit.Clone());
|
RateLimit != null ? RateLimit.Clone() : null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
@@ -20,7 +19,7 @@ namespace Octokit
|
|||||||
/// ‘source’ of the Status. For example, if your Continuous Integration system is posting build status,
|
/// ‘source’ of the Status. For example, if your Continuous Integration system is posting build status,
|
||||||
/// you would want to provide the deep link for the build output for this specific sha.
|
/// you would want to provide the deep link for the build output for this specific sha.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri TargetUrl { get; set; }
|
public string TargetUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Short description of the status.
|
/// Short description of the status.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public CommitComment() { }
|
public CommitComment() { }
|
||||||
|
|
||||||
public CommitComment(int id, Uri url, Uri htmlUrl, string body, string path, int position, int? line, string commitId, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
|
public CommitComment(int id, string url, string htmlUrl, string body, string path, int position, int? line, string commitId, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -32,12 +32,12 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this repository comment.
|
/// The URL for this repository comment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The html URL for this repository comment.
|
/// The html URL for this repository comment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Details about the repository comment.
|
/// Details about the repository comment.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
@@ -13,7 +12,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public RepositoryContentInfo() { }
|
public RepositoryContentInfo() { }
|
||||||
|
|
||||||
public RepositoryContentInfo(string name, string path, string sha, int size, ContentType type, Uri downloadUrl, Uri url, Uri gitUrl, Uri htmlUrl)
|
public RepositoryContentInfo(string name, string path, string sha, int size, ContentType type, string downloadUrl, string url, string gitUrl, string htmlUrl)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
Path = path;
|
Path = path;
|
||||||
@@ -55,22 +54,22 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// URL to the raw content
|
/// URL to the raw content
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri DownloadUrl { get; protected set; }
|
public string DownloadUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// URL to this content
|
/// URL to this content
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The GIT URL to this content.
|
/// The GIT URL to this content.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri GitUrl { get; protected set; }
|
public string GitUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL to view this content on GitHub.
|
/// The URL to view this content on GitHub.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public CommitStatus() { }
|
public CommitStatus() { }
|
||||||
|
|
||||||
public CommitStatus(DateTimeOffset createdAt, DateTimeOffset updatedAt, CommitState state, Uri targetUrl, string description, string context, int id, Uri url, User creator)
|
public CommitStatus(DateTimeOffset createdAt, DateTimeOffset updatedAt, CommitState state, string targetUrl, string description, string context, int id, string url, User creator)
|
||||||
{
|
{
|
||||||
CreatedAt = createdAt;
|
CreatedAt = createdAt;
|
||||||
UpdatedAt = updatedAt;
|
UpdatedAt = updatedAt;
|
||||||
@@ -41,7 +41,7 @@ namespace Octokit
|
|||||||
/// URL associated with this status. GitHub.com displays this URL as a link to allow users to easily see the
|
/// URL associated with this status. GitHub.com displays this URL as a link to allow users to easily see the
|
||||||
/// ‘source’ of the Status.
|
/// ‘source’ of the Status.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri TargetUrl { get; protected set; }
|
public string TargetUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Short description of the status.
|
/// Short description of the status.
|
||||||
@@ -61,7 +61,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL of the status.
|
/// The URL of the status.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The user that created the status.
|
/// The user that created the status.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
@@ -9,7 +8,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public Emoji() { }
|
public Emoji() { }
|
||||||
|
|
||||||
public Emoji(string name, Uri url)
|
public Emoji(string name, string url)
|
||||||
{
|
{
|
||||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
Ensure.ArgumentNotNull(url, "url");
|
Ensure.ArgumentNotNull(url, "url");
|
||||||
@@ -19,7 +18,7 @@ namespace Octokit
|
|||||||
}
|
}
|
||||||
|
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public Uri Url { get; private set; }
|
public string Url { get; private set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public EventInfo() { }
|
public EventInfo() { }
|
||||||
|
|
||||||
public EventInfo(int id, Uri url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt)
|
public EventInfo(int id, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -30,7 +30,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this event.
|
/// The URL for this event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Always the User that generated the event.
|
/// Always the User that generated the event.
|
||||||
@@ -162,6 +162,41 @@ namespace Octokit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
HeadRefRestored,
|
HeadRefRestored,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The actor dismissed a review from the pull request.
|
||||||
|
/// </summary>
|
||||||
|
ReviewDismissed,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The actor requested review from the subject on this pull request.
|
||||||
|
/// </summary>
|
||||||
|
ReviewRequested,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The actor removed the review request for the subject on this pull request.
|
||||||
|
/// </summary>
|
||||||
|
ReviewRequestRemoved,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The issue was added to a project board.
|
||||||
|
/// </summary>
|
||||||
|
AddedToProject,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The issue was moved between columns in a project board.
|
||||||
|
/// </summary>
|
||||||
|
MovedColumnsInProject,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The issue was removed from a project board.
|
||||||
|
/// </summary>
|
||||||
|
RemovedFromProject,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The issue was created by converting a note in a project board to an issue.
|
||||||
|
/// </summary>
|
||||||
|
ConvertedNoteToIssue,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The actor unsubscribed from notifications for an issue.
|
/// The actor unsubscribed from notifications for an issue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -178,21 +213,6 @@ namespace Octokit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
Committed,
|
Committed,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The actor requested review from the subject on this pull request.
|
|
||||||
/// </summary>
|
|
||||||
ReviewRequested,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The actor dismissed a review from the pull request.
|
|
||||||
/// </summary>
|
|
||||||
ReviewDismissed,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The actor removed the review request for the subject on this pull request.
|
|
||||||
/// </summary>
|
|
||||||
ReviewRequestRemoved,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base branch of the pull request was changed.
|
/// Base branch of the pull request was changed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public GistComment() { }
|
public GistComment() { }
|
||||||
|
|
||||||
public GistComment(int id, Uri url, string body, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
|
public GistComment(int id, string url, string body, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -27,7 +27,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this gist comment.
|
/// The URL for this gist comment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The body of this gist comment.
|
/// The body of this gist comment.
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Octokit.Internal;
|
using Octokit.Internal;
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public Issue() { }
|
public Issue() { }
|
||||||
|
|
||||||
public Issue(Uri url, Uri htmlUrl, Uri commentsUrl, Uri eventsUrl, int number, ItemState state, string title, string body, User closedBy, User user, IReadOnlyList<Label> labels, User assignee, IReadOnlyList<User> assignees, Milestone milestone, int comments, PullRequest pullRequest, DateTimeOffset? closedAt, DateTimeOffset createdAt, DateTimeOffset? updatedAt, int id, bool locked, Repository repository)
|
public Issue(string url, string htmlUrl, string commentsUrl, string eventsUrl, int number, ItemState state, string title, string body, User closedBy, User user, IReadOnlyList<Label> labels, User assignee, IReadOnlyList<User> assignees, Milestone milestone, int comments, PullRequest pullRequest, DateTimeOffset? closedAt, DateTimeOffset createdAt, DateTimeOffset? updatedAt, int id, bool locked, Repository repository)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -45,22 +45,22 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this issue.
|
/// The URL for this issue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for the HTML view of this issue.
|
/// The URL for the HTML view of this issue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Comments URL of this issue.
|
/// The Comments URL of this issue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri CommentsUrl { get; protected set; }
|
public string CommentsUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Events URL of this issue.
|
/// The Events URL of this issue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri EventsUrl { get; protected set; }
|
public string EventsUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The issue number.
|
/// The issue number.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public IssueComment() { }
|
public IssueComment() { }
|
||||||
|
|
||||||
public IssueComment(int id, Uri url, Uri htmlUrl, string body, DateTimeOffset createdAt, DateTimeOffset? updatedAt, User user)
|
public IssueComment(int id, string url, string htmlUrl, string body, DateTimeOffset createdAt, DateTimeOffset? updatedAt, User user)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -28,12 +28,12 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this issue comment.
|
/// The URL for this issue comment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The html URL for this issue comment.
|
/// The html URL for this issue comment.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Details about the issue comment.
|
/// Details about the issue comment.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public IssueEvent() { }
|
public IssueEvent() { }
|
||||||
|
|
||||||
public IssueEvent(int id, Uri url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, Uri commitUrl)
|
public IssueEvent(int id, string url, User actor, User assignee, Label label, EventInfoState @event, string commitId, DateTimeOffset createdAt, Issue issue, string commitUrl)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -31,7 +31,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this issue/pull request event.
|
/// The URL for this issue/pull request event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Always the User that generated the event.
|
/// Always the User that generated the event.
|
||||||
@@ -61,7 +61,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The commit URL of a commit that referenced this issue.
|
/// The commit URL of a commit that referenced this issue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri CommitUrl { get; protected set; }
|
public string CommitUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Date the event occurred for the issue/pull request.
|
/// Date the event occurred for the issue/pull request.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
@@ -9,7 +8,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public Label() { }
|
public Label() { }
|
||||||
|
|
||||||
public Label(Uri url, string name, string color)
|
public Label(string url, string name, string color)
|
||||||
{
|
{
|
||||||
Url = url;
|
Url = url;
|
||||||
Name = name;
|
Name = name;
|
||||||
@@ -19,7 +18,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Url of the label
|
/// Url of the label
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name of the label
|
/// Name of the label
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -13,8 +12,8 @@ namespace Octokit
|
|||||||
public License(
|
public License(
|
||||||
string key,
|
string key,
|
||||||
string name,
|
string name,
|
||||||
Uri url,
|
string url,
|
||||||
Uri htmlUrl,
|
string htmlUrl,
|
||||||
bool featured,
|
bool featured,
|
||||||
string description,
|
string description,
|
||||||
string category,
|
string category,
|
||||||
@@ -51,7 +50,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Url to the license on https://choosealicense.com
|
/// Url to the license on https://choosealicense.com
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the license is one of the licenses featured on https://choosealicense.com
|
/// Whether the license is one of the licenses featured on https://choosealicense.com
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
@@ -7,7 +6,7 @@ namespace Octokit
|
|||||||
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
[DebuggerDisplay("{DebuggerDisplay,nq}")]
|
||||||
public class LicenseMetadata
|
public class LicenseMetadata
|
||||||
{
|
{
|
||||||
public LicenseMetadata(string key, string name, Uri url)
|
public LicenseMetadata(string key, string name, string url)
|
||||||
{
|
{
|
||||||
Ensure.ArgumentNotNullOrEmptyString(key, "key");
|
Ensure.ArgumentNotNullOrEmptyString(key, "key");
|
||||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
@@ -35,7 +34,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// URL to retrieve details about a license.
|
/// URL to retrieve details about a license.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
internal virtual string DebuggerDisplay
|
internal virtual string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Octokit
|
|||||||
Number = number;
|
Number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Milestone(Uri url, Uri htmlUrl, int number, ItemState state, string title, string description, User creator, int openIssues, int closedIssues, DateTimeOffset createdAt, DateTimeOffset? dueOn, DateTimeOffset? closedAt)
|
public Milestone(string url, string htmlUrl, int number, ItemState state, string title, string description, User creator, int openIssues, int closedIssues, DateTimeOffset createdAt, DateTimeOffset? dueOn, DateTimeOffset? closedAt)
|
||||||
{
|
{
|
||||||
Url = url;
|
Url = url;
|
||||||
HtmlUrl = htmlUrl;
|
HtmlUrl = htmlUrl;
|
||||||
@@ -33,12 +33,12 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this milestone.
|
/// The URL for this milestone.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Html page for this milestone.
|
/// The Html page for this milestone.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The milestone number.
|
/// The milestone number.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Octokit
|
|||||||
Number = number;
|
Number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PullRequest(long id, Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, User mergedBy, string mergeCommitSha, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked)
|
public PullRequest(long id, string url, string htmlUrl, string diffUrl, string patchUrl, string issueUrl, string statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, User mergedBy, string mergeCommitSha, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -57,32 +57,32 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this pull request.
|
/// The URL for this pull request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for the pull request page.
|
/// The URL for the pull request page.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for the pull request's diff (.diff) file.
|
/// The URL for the pull request's diff (.diff) file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri DiffUrl { get; protected set; }
|
public string DiffUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for the pull request's patch (.patch) file.
|
/// The URL for the pull request's patch (.patch) file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri PatchUrl { get; protected set; }
|
public string PatchUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for the specific pull request issue.
|
/// The URL for the specific pull request issue.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri IssueUrl { get; protected set; }
|
public string IssueUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for the pull request statuses.
|
/// The URL for the pull request statuses.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri StatusesUrl { get; protected set; }
|
public string StatusesUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The pull request number.
|
/// The pull request number.
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
@@ -12,7 +11,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public PullRequestCommit() { }
|
public PullRequestCommit() { }
|
||||||
|
|
||||||
public PullRequestCommit(Committer author, Uri commentsUrl, Commit commit, Committer committer, Uri htmlUrl, IEnumerable<GitReference> parents, string sha, Uri url)
|
public PullRequestCommit(Committer author, string commentsUrl, Commit commit, Committer committer, string htmlUrl, IEnumerable<GitReference> parents, string sha, string url)
|
||||||
{
|
{
|
||||||
Ensure.ArgumentNotNull(parents, "parents");
|
Ensure.ArgumentNotNull(parents, "parents");
|
||||||
|
|
||||||
@@ -28,19 +27,19 @@ namespace Octokit
|
|||||||
|
|
||||||
public Committer Author { get; protected set; }
|
public Committer Author { get; protected set; }
|
||||||
|
|
||||||
public Uri CommentsUrl { get; protected set; }
|
public string CommentsUrl { get; protected set; }
|
||||||
|
|
||||||
public Commit Commit { get; protected set; }
|
public Commit Commit { get; protected set; }
|
||||||
|
|
||||||
public Committer Committer { get; protected set; }
|
public Committer Committer { get; protected set; }
|
||||||
|
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
public IReadOnlyList<GitReference> Parents { get; protected set; }
|
public IReadOnlyList<GitReference> Parents { get; protected set; }
|
||||||
|
|
||||||
public string Sha { get; protected set; }
|
public string Sha { get; protected set; }
|
||||||
|
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Octokit.Internal;
|
using Octokit.Internal;
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public PullRequestFile() { }
|
public PullRequestFile() { }
|
||||||
|
|
||||||
public PullRequestFile(string sha, string fileName, string status, int additions, int deletions, int changes, Uri blobUrl, Uri rawUrl, Uri contentsUrl, string patch)
|
public PullRequestFile(string sha, string fileName, string status, int additions, int deletions, int changes, string blobUrl, string rawUrl, string contentsUrl, string patch)
|
||||||
{
|
{
|
||||||
Sha = sha;
|
Sha = sha;
|
||||||
FileName = fileName;
|
FileName = fileName;
|
||||||
@@ -31,9 +30,9 @@ namespace Octokit
|
|||||||
public int Additions { get; protected set; }
|
public int Additions { get; protected set; }
|
||||||
public int Deletions { get; protected set; }
|
public int Deletions { get; protected set; }
|
||||||
public int Changes { get; protected set; }
|
public int Changes { get; protected set; }
|
||||||
public Uri BlobUrl { get; protected set; }
|
public string BlobUrl { get; protected set; }
|
||||||
public Uri RawUrl { get; protected set; }
|
public string RawUrl { get; protected set; }
|
||||||
public Uri ContentsUrl { get; protected set; }
|
public string ContentsUrl { get; protected set; }
|
||||||
public string Patch { get; protected set; }
|
public string Patch { get; protected set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Octokit
|
|||||||
Id = id;
|
Id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PullRequestReviewComment(Uri url, int id, string diffHunk, string path, int? position, int? originalPosition, string commitId, string originalCommitId, User user, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, Uri htmlUrl, Uri pullRequestUrl)
|
public PullRequestReviewComment(string url, int id, string diffHunk, string path, int? position, int? originalPosition, string commitId, string originalCommitId, User user, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, string htmlUrl, string pullRequestUrl)
|
||||||
{
|
{
|
||||||
Url = url;
|
Url = url;
|
||||||
Id = id;
|
Id = id;
|
||||||
@@ -35,7 +35,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// URL of the comment via the API.
|
/// URL of the comment via the API.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The comment Id.
|
/// The comment Id.
|
||||||
@@ -95,12 +95,12 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this comment on Github.com
|
/// The URL for this comment on Github.com
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for the pull request via the API.
|
/// The URL for the pull request via the API.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri PullRequestUrl { get; protected set; }
|
public string PullRequestUrl { get; protected set; }
|
||||||
|
|
||||||
public ReactionSummary Reactions { get; protected set; }
|
public ReactionSummary Reactions { get; protected set; }
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Octokit.Internal;
|
using System.Diagnostics;
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using Octokit.Internal;
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Octokit.Internal;
|
using Octokit.Internal;
|
||||||
|
|
||||||
@@ -17,7 +16,7 @@ namespace Octokit
|
|||||||
public int Confused { get; protected set; }
|
public int Confused { get; protected set; }
|
||||||
public int Heart { get; protected set; }
|
public int Heart { get; protected set; }
|
||||||
public int Hooray { get; protected set; }
|
public int Hooray { get; protected set; }
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,17 +20,17 @@ namespace Octokit
|
|||||||
Ensure.ArgumentNotNull(client, "client");
|
Ensure.ArgumentNotNull(client, "client");
|
||||||
|
|
||||||
Name = response.Name;
|
Name = response.Name;
|
||||||
Url = new Uri(response.Url);
|
Url = response.Url;
|
||||||
HtmlUrl = new Uri(response.HtmlUrl);
|
HtmlUrl = response.HtmlUrl;
|
||||||
if (response.Encoding.Equals("base64", StringComparison.OrdinalIgnoreCase))
|
if (response.Encoding.Equals("base64", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var contentAsBytes = Convert.FromBase64String(response.Content);
|
var contentAsBytes = Convert.FromBase64String(response.Content);
|
||||||
Content = Encoding.UTF8.GetString(contentAsBytes, 0, contentAsBytes.Length);
|
Content = Encoding.UTF8.GetString(contentAsBytes, 0, contentAsBytes.Length);
|
||||||
}
|
}
|
||||||
htmlContent = new Lazy<Task<string>>(async () => await client.GetHtml(Url).ConfigureAwait(false));
|
htmlContent = new Lazy<Task<string>>(async () => await client.GetHtml(new Uri(Url)).ConfigureAwait(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Readme(Lazy<Task<string>> htmlContent, string content, string name, Uri htmlUrl, Uri url)
|
public Readme(Lazy<Task<string>> htmlContent, string content, string name, string htmlUrl, string url)
|
||||||
{
|
{
|
||||||
this.htmlContent = htmlContent;
|
this.htmlContent = htmlContent;
|
||||||
Content = content;
|
Content = content;
|
||||||
@@ -41,8 +41,8 @@ namespace Octokit
|
|||||||
|
|
||||||
public string Content { get; private set; }
|
public string Content { get; private set; }
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
public Uri HtmlUrl { get; private set; }
|
public string HtmlUrl { get; private set; }
|
||||||
public Uri Url { get; private set; }
|
public string Url { get; private set; }
|
||||||
|
|
||||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
|
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
|
||||||
Justification = "Makes a network request")]
|
Justification = "Makes a network request")]
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using Octokit.Internal;
|
using Octokit.Internal;
|
||||||
|
|
||||||
@@ -13,7 +12,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public RepositoryContent() { }
|
public RepositoryContent() { }
|
||||||
|
|
||||||
public RepositoryContent(string name, string path, string sha, int size, ContentType type, Uri downloadUrl, Uri url, Uri gitUrl, Uri htmlUrl, string encoding, string encodedContent, string target, Uri submoduleGitUrl)
|
public RepositoryContent(string name, string path, string sha, int size, ContentType type, string downloadUrl, string url, string gitUrl, string htmlUrl, string encoding, string encodedContent, string target, string submoduleGitUrl)
|
||||||
: base(name, path, sha, size, type, downloadUrl, url, gitUrl, htmlUrl)
|
: base(name, path, sha, size, type, downloadUrl, url, gitUrl, htmlUrl)
|
||||||
{
|
{
|
||||||
Encoding = encoding;
|
Encoding = encoding;
|
||||||
@@ -54,6 +53,6 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The location of the submodule repository if this is a submodule. Otherwise it's null.
|
/// The location of the submodule repository if this is a submodule. Otherwise it's null.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri SubmoduleGitUrl { get; protected set; }
|
public string SubmoduleGitUrl { get; protected set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Octokit.Helpers;
|
|
||||||
using Octokit.Internal;
|
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Octokit
|
namespace Octokit
|
||||||
@@ -9,7 +8,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public SearchCode() { }
|
public SearchCode() { }
|
||||||
|
|
||||||
public SearchCode(string name, string path, string sha, Uri url, Uri gitUrl, Uri htmlUrl, Repository repository)
|
public SearchCode(string name, string path, string sha, string url, string gitUrl, string htmlUrl, Repository repository)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
Path = path;
|
Path = path;
|
||||||
@@ -38,17 +37,17 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// api-url to file
|
/// api-url to file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// git-url to file
|
/// git-url to file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri GitUrl { get; protected set; }
|
public string GitUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// html-url to file
|
/// html-url to file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri HtmlUrl { get; protected set; }
|
public string HtmlUrl { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Repo where this file belongs to
|
/// Repo where this file belongs to
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public Subscription() { }
|
public Subscription() { }
|
||||||
|
|
||||||
public Subscription(bool subscribed, bool ignored, string reason, DateTimeOffset createdAt, Uri url, Uri repositoryUrl)
|
public Subscription(bool subscribed, bool ignored, string reason, DateTimeOffset createdAt, string url, string repositoryUrl)
|
||||||
{
|
{
|
||||||
Subscribed = subscribed;
|
Subscribed = subscribed;
|
||||||
Ignored = ignored;
|
Ignored = ignored;
|
||||||
@@ -42,12 +42,12 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The API URL for this <see cref="Subscription"/>.
|
/// The API URL for this <see cref="Subscription"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The API URL for this <see cref="Repository"/>.
|
/// The API URL for this <see cref="Repository"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri RepositoryUrl { get; protected set; }
|
public string RepositoryUrl { get; protected set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Octokit.Internal;
|
using Octokit.Internal;
|
||||||
@@ -13,7 +12,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public Team() { }
|
public Team() { }
|
||||||
|
|
||||||
public Team(Uri url, int id, string name, Permission permission, int membersCount, int reposCount, Organization organization, string ldapDistinguishedName)
|
public Team(string url, int id, string name, Permission permission, int membersCount, int reposCount, Organization organization, string ldapDistinguishedName)
|
||||||
{
|
{
|
||||||
Url = url;
|
Url = url;
|
||||||
Id = id;
|
Id = id;
|
||||||
@@ -28,7 +27,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// url for this team
|
/// url for this team
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// team id
|
/// team id
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public ThreadSubscription() { }
|
public ThreadSubscription() { }
|
||||||
|
|
||||||
public ThreadSubscription(bool subscribed, bool ignored, string reason, DateTimeOffset createdAt, Uri url, Uri threadUrl)
|
public ThreadSubscription(bool subscribed, bool ignored, string reason, DateTimeOffset createdAt, string url, string threadUrl)
|
||||||
{
|
{
|
||||||
Subscribed = subscribed;
|
Subscribed = subscribed;
|
||||||
Ignored = ignored;
|
Ignored = ignored;
|
||||||
@@ -42,12 +42,12 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The API URL for this <see cref="Subscription"/>.
|
/// The API URL for this <see cref="Subscription"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The API URL for this thread.
|
/// The API URL for this thread.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri ThreadUrl { get; protected set; }
|
public string ThreadUrl { get; protected set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public TreeItem() { }
|
public TreeItem() { }
|
||||||
|
|
||||||
public TreeItem(string path, string mode, TreeType type, int size, string sha, Uri url)
|
public TreeItem(string path, string mode, TreeType type, int size, string sha, string url)
|
||||||
{
|
{
|
||||||
Path = path;
|
Path = path;
|
||||||
Mode = mode;
|
Mode = mode;
|
||||||
@@ -49,7 +48,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL of this Tree Item.
|
/// The URL of this Tree Item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
internal string DebuggerDisplay
|
internal string DebuggerDisplay
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
public TreeResponse() { }
|
public TreeResponse() { }
|
||||||
|
|
||||||
public TreeResponse(string sha, Uri url, IReadOnlyList<TreeItem> tree, bool truncated)
|
public TreeResponse(string sha, string url, IReadOnlyList<TreeItem> tree, bool truncated)
|
||||||
{
|
{
|
||||||
Sha = sha;
|
Sha = sha;
|
||||||
Url = url;
|
Url = url;
|
||||||
@@ -26,7 +25,7 @@ namespace Octokit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The URL for this Tree response.
|
/// The URL for this Tree response.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Uri Url { get; protected set; }
|
public string Url { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The list of Tree Items for this Tree response.
|
/// The list of Tree Items for this Tree response.
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>System.Reactive.Linq</Namespace>
|
<Namespace>System.Reactive.Linq</Namespace>
|
||||||
<Namespace>System.Threading.Tasks</Namespace>
|
<Namespace>System.Threading.Tasks</Namespace>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>System.Net</Namespace>
|
<Namespace>System.Net</Namespace>
|
||||||
<Namespace>System.Threading.Tasks</Namespace>
|
<Namespace>System.Threading.Tasks</Namespace>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>System.Threading.Tasks</Namespace>
|
<Namespace>System.Threading.Tasks</Namespace>
|
||||||
</Query>
|
</Query>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>System</Namespace>
|
<Namespace>System</Namespace>
|
||||||
<Namespace>System.Reactive.Linq</Namespace>
|
<Namespace>System.Reactive.Linq</Namespace>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>System.Threading.Tasks</Namespace>
|
<Namespace>System.Threading.Tasks</Namespace>
|
||||||
</Query>
|
</Query>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<Reference><RuntimeDirectory>\System.Runtime.dll</Reference>
|
<Reference><RuntimeDirectory>\System.Runtime.dll</Reference>
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>System.Net.Http.Headers</Namespace>
|
<Namespace>System.Net.Http.Headers</Namespace>
|
||||||
<Namespace>System.Reactive.Linq</Namespace>
|
<Namespace>System.Reactive.Linq</Namespace>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
<Reference><RuntimeDirectory>\System.Runtime.dll</Reference>
|
<Reference><RuntimeDirectory>\System.Runtime.dll</Reference>
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>System.Reactive.Linq</Namespace>
|
<Namespace>System.Reactive.Linq</Namespace>
|
||||||
<Namespace>System.Net.Http.Headers</Namespace>
|
<Namespace>System.Net.Http.Headers</Namespace>
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>Octokit.Reactive</Namespace>
|
<Namespace>Octokit.Reactive</Namespace>
|
||||||
<Namespace>System</Namespace>
|
<Namespace>System</Namespace>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>Octokit.Reactive</Namespace>
|
<Namespace>Octokit.Reactive</Namespace>
|
||||||
<Namespace>System</Namespace>
|
<Namespace>System</Namespace>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<Query Kind="Program">
|
<Query Kind="Program">
|
||||||
<NuGetReference>Octokit</NuGetReference>
|
<NuGetReference>Octokit</NuGetReference>
|
||||||
<NuGetReference>Octokit.Reactive</NuGetReference>
|
<NuGetReference>Octokit.Reactive</NuGetReference>
|
||||||
<NuGetReference>Rx-Main</NuGetReference>
|
|
||||||
<Namespace>Octokit</Namespace>
|
<Namespace>Octokit</Namespace>
|
||||||
<Namespace>Octokit.Reactive</Namespace>
|
<Namespace>Octokit.Reactive</Namespace>
|
||||||
<Namespace>System</Namespace>
|
<Namespace>System</Namespace>
|
||||||
|
|||||||
Reference in New Issue
Block a user