From c65de95d29e981b68555310e9ca63b983bbfbc75 Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Tue, 5 Jun 2018 09:48:44 -0700 Subject: [PATCH 01/22] add node_id to Deployments payloads (Deployment and DeploymentStatus and Account/User/Organization) --- Octokit/Models/Response/Account.cs | 8 +++++++- Octokit/Models/Response/Deployment.cs | 8 +++++++- Octokit/Models/Response/DeploymentStatus.cs | 8 +++++++- Octokit/Models/Response/Organization.cs | 4 ++-- Octokit/Models/Response/User.cs | 4 ++-- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Octokit/Models/Response/Account.cs b/Octokit/Models/Response/Account.cs index 9538411933..9e242b9e9e 100644 --- a/Octokit/Models/Response/Account.cs +++ b/Octokit/Models/Response/Account.cs @@ -9,7 +9,7 @@ public abstract class Account { protected Account() { } - protected Account(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, AccountType type, string url) + protected Account(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, string nodeId, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, AccountType type, string url) { AvatarUrl = avatarUrl; Bio = bio; @@ -28,6 +28,7 @@ protected Account(string avatarUrl, string bio, string blog, int collaborators, Location = location; Login = login; Name = name; + NodeId = nodeId; OwnedPrivateRepos = ownedPrivateRepos; Plan = plan; PrivateGists = privateGists; @@ -103,6 +104,11 @@ protected Account(string avatarUrl, string bio, string blog, int collaborators, /// public int Id { get; protected set; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// The account's geographic location. /// diff --git a/Octokit/Models/Response/Deployment.cs b/Octokit/Models/Response/Deployment.cs index a9ab8fe2cd..4d4e5be667 100644 --- a/Octokit/Models/Response/Deployment.cs +++ b/Octokit/Models/Response/Deployment.cs @@ -13,9 +13,10 @@ public class Deployment { public Deployment() { } - public Deployment(int id, string sha, string url, User creator, IReadOnlyDictionary payload, DateTimeOffset createdAt, DateTimeOffset updatedAt, string description, string statusesUrl, bool transientEnvironment, bool productionEnvironment) + public Deployment(int id, string nodeId, string sha, string url, User creator, IReadOnlyDictionary payload, DateTimeOffset createdAt, DateTimeOffset updatedAt, string description, string statusesUrl, bool transientEnvironment, bool productionEnvironment) { Id = id; + NodeId = nodeId; Sha = sha; Url = url; Creator = creator; @@ -33,6 +34,11 @@ public Deployment(int id, string sha, string url, User creator, IReadOnlyDiction /// public int Id { get; protected set; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// /// diff --git a/Octokit/Models/Response/DeploymentStatus.cs b/Octokit/Models/Response/DeploymentStatus.cs index 363144da5f..a7bef3ca05 100644 --- a/Octokit/Models/Response/DeploymentStatus.cs +++ b/Octokit/Models/Response/DeploymentStatus.cs @@ -11,9 +11,10 @@ public class DeploymentStatus { public DeploymentStatus() { } - public DeploymentStatus(int id, string url, DeploymentState state, User creator, IReadOnlyDictionary payload, string targetUrl, string logUrl, string environmentUrl, DateTimeOffset createdAt, DateTimeOffset updatedAt, string description) + public DeploymentStatus(int id, string nodeId, string url, DeploymentState state, User creator, IReadOnlyDictionary payload, string targetUrl, string logUrl, string environmentUrl, DateTimeOffset createdAt, DateTimeOffset updatedAt, string description) { Id = id; + NodeId = nodeId; Url = url; State = state; Creator = creator; @@ -31,6 +32,11 @@ public DeploymentStatus(int id, string url, DeploymentState state, User creator, /// public int Id { get; protected set; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// The API URL for this deployment status. /// diff --git a/Octokit/Models/Response/Organization.cs b/Octokit/Models/Response/Organization.cs index 9a1eea5620..9a0ad5dc25 100644 --- a/Octokit/Models/Response/Organization.cs +++ b/Octokit/Models/Response/Organization.cs @@ -10,8 +10,8 @@ public class Organization : Account { public Organization() { } - public Organization(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, string billingAddress) - : base(avatarUrl, bio, blog, collaborators, company, createdAt, diskUsage, email, followers, following, hireable, htmlUrl, totalPrivateRepos, id, location, login, name, ownedPrivateRepos, plan, privateGists, publicGists, publicRepos, AccountType.Organization, url) + public Organization(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string nodeId, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, string billingAddress) + : base(avatarUrl, bio, blog, collaborators, company, createdAt, diskUsage, email, followers, following, hireable, htmlUrl, totalPrivateRepos, id, location, login, name, nodeId, ownedPrivateRepos, plan, privateGists, publicGists, publicRepos, AccountType.Organization, url) { BillingAddress = billingAddress; } diff --git a/Octokit/Models/Response/User.cs b/Octokit/Models/Response/User.cs index 3fcf93ec61..96a2c611a1 100644 --- a/Octokit/Models/Response/User.cs +++ b/Octokit/Models/Response/User.cs @@ -14,8 +14,8 @@ public class User : Account { public User() { } - public User(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, DateTimeOffset updatedAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, RepositoryPermissions permissions, bool siteAdmin, string ldapDistinguishedName, DateTimeOffset? suspendedAt) - : base(avatarUrl, bio, blog, collaborators, company, createdAt, diskUsage, email, followers, following, hireable, htmlUrl, totalPrivateRepos, id, location, login, name, ownedPrivateRepos, plan, privateGists, publicGists, publicRepos, AccountType.User, url) + public User(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, DateTimeOffset updatedAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, string nodeId, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, RepositoryPermissions permissions, bool siteAdmin, string ldapDistinguishedName, DateTimeOffset? suspendedAt) + : base(avatarUrl, bio, blog, collaborators, company, createdAt, diskUsage, email, followers, following, hireable, htmlUrl, totalPrivateRepos, id, location, login, name, nodeId, ownedPrivateRepos, plan, privateGists, publicGists, publicRepos, AccountType.User, url) { Permissions = permissions; SiteAdmin = siteAdmin; From bee23f3baa3cae3eb3e4309cfa3b9a2be264277f Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Tue, 5 Jun 2018 10:06:14 -0700 Subject: [PATCH 02/22] add node_id to gist responses --- Octokit/Models/Response/Gist.cs | 8 +++++++- Octokit/Models/Response/GistComment.cs | 8 +++++++- Octokit/Models/Response/GistFork.cs | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Octokit/Models/Response/Gist.cs b/Octokit/Models/Response/Gist.cs index 1c50a50c00..2ec6ffdc52 100644 --- a/Octokit/Models/Response/Gist.cs +++ b/Octokit/Models/Response/Gist.cs @@ -10,10 +10,11 @@ public class Gist { public Gist() { } - public Gist(string url, string id, string description, bool @public, User owner, IReadOnlyDictionary files, int comments, string commentsUrl, string htmlUrl, string gitPullUrl, string gitPushUrl, DateTimeOffset createdAt, DateTimeOffset updatedAt, IReadOnlyList forks, IReadOnlyList history) + public Gist(string url, string id, string nodeId, string description, bool @public, User owner, IReadOnlyDictionary files, int comments, string commentsUrl, string htmlUrl, string gitPullUrl, string gitPushUrl, DateTimeOffset createdAt, DateTimeOffset updatedAt, IReadOnlyList forks, IReadOnlyList history) { Url = url; Id = id; + NodeId = nodeId; Description = description; Public = @public; Owner = owner; @@ -42,6 +43,11 @@ public Gist(string url, string id, string description, bool @public, User owner, /// public string Id { get; protected set; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// A description of the . /// diff --git a/Octokit/Models/Response/GistComment.cs b/Octokit/Models/Response/GistComment.cs index e88d46ccba..9a9b773c18 100644 --- a/Octokit/Models/Response/GistComment.cs +++ b/Octokit/Models/Response/GistComment.cs @@ -9,9 +9,10 @@ public class GistComment { public GistComment() { } - public GistComment(int id, string url, string body, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt) + public GistComment(int id, string nodeId, string url, string body, User user, DateTimeOffset createdAt, DateTimeOffset? updatedAt) { Id = id; + NodeId = nodeId; Url = url; Body = body; User = user; @@ -24,6 +25,11 @@ public GistComment(int id, string url, string body, User user, DateTimeOffset cr /// public int Id { get; protected set; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// The URL for this gist comment. /// diff --git a/Octokit/Models/Response/GistFork.cs b/Octokit/Models/Response/GistFork.cs index 9729fc4307..888b81cb8c 100644 --- a/Octokit/Models/Response/GistFork.cs +++ b/Octokit/Models/Response/GistFork.cs @@ -9,13 +9,19 @@ public class GistFork { public GistFork() { } - public GistFork(User user, string url, DateTimeOffset createdAt) + public GistFork(string nodeId, User user, string url, DateTimeOffset createdAt) { + NodeId = nodeId; User = user; Url = url; CreatedAt = createdAt; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// The that created this /// From 79011f882658e9d80d5ffa4d3d2eff81387dfe81 Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Tue, 5 Jun 2018 10:10:35 -0700 Subject: [PATCH 03/22] add node_id to Git Blob --- Octokit/Models/Response/Blob.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Octokit/Models/Response/Blob.cs b/Octokit/Models/Response/Blob.cs index 61af602889..b4df6a4f36 100644 --- a/Octokit/Models/Response/Blob.cs +++ b/Octokit/Models/Response/Blob.cs @@ -9,14 +9,20 @@ public class Blob { public Blob() { } - public Blob(string content, EncodingType encoding, string sha, int size) + public Blob(string nodeId, string content, EncodingType encoding, string sha, int size) { + NodeId = nodeId; Content = content; Encoding = encoding; Sha = sha; Size = size; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// The content of the blob. /// From c70ba807e1434131bcf668a4a48303e186fea16e Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Tue, 5 Jun 2018 13:51:35 -0700 Subject: [PATCH 04/22] add node_id to Git Commit response --- Octokit/Models/Response/Commit.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Octokit/Models/Response/Commit.cs b/Octokit/Models/Response/Commit.cs index 1623692a48..c4764b3572 100644 --- a/Octokit/Models/Response/Commit.cs +++ b/Octokit/Models/Response/Commit.cs @@ -10,11 +10,12 @@ public class Commit : GitReference { public Commit() { } - public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable parents, int commentCount, Verification verification) + public Commit(string nodeId, string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable parents, int commentCount, Verification verification) : base(url, label, @ref, sha, user, repository) { Ensure.ArgumentNotNull(parents, nameof(parents)); + NodeId = nodeId; Message = message; Author = author; Committer = committer; @@ -24,6 +25,11 @@ public Commit(string url, string label, string @ref, string sha, User user, Repo Verification = verification; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + public string Message { get; protected set; } public Committer Author { get; protected set; } From da564f07f28e3d8ba3e66e4c40a371e27262be1e Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Tue, 5 Jun 2018 13:52:58 -0700 Subject: [PATCH 05/22] add node_id to GitReference response --- Octokit/Models/Response/GitReference.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Octokit/Models/Response/GitReference.cs b/Octokit/Models/Response/GitReference.cs index ec4466839f..8d9906917a 100644 --- a/Octokit/Models/Response/GitReference.cs +++ b/Octokit/Models/Response/GitReference.cs @@ -9,8 +9,9 @@ public class GitReference { public GitReference() { } - public GitReference(string url, string label, string @ref, string sha, User user, Repository repository) + public GitReference(string nodeId, string url, string label, string @ref, string sha, User user, Repository repository) { + NodeId = nodeId; Url = url; Label = label; Ref = @ref; @@ -19,6 +20,11 @@ public GitReference(string url, string label, string @ref, string sha, User user Repository = repository; } + /// + /// GraphQL Node Id + /// + public string NodeId { get; protected set; } + /// /// The URL associated with this reference. /// From 05bf5ffb3cdbf24919c9e25188fb9eb286c9f64e Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Tue, 5 Jun 2018 13:57:28 -0700 Subject: [PATCH 06/22] add node_id to everything that inherits GitReference --- Octokit/Models/Response/Commit.cs | 8 +------- Octokit/Models/Response/GitHubCommit.cs | 4 ++-- Octokit/Models/Response/GitTag.cs | 5 +++-- Octokit/Models/Response/Merge.cs | 4 ++-- Octokit/Models/Response/TagObject.cs | 4 ++-- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Octokit/Models/Response/Commit.cs b/Octokit/Models/Response/Commit.cs index c4764b3572..e72abbf649 100644 --- a/Octokit/Models/Response/Commit.cs +++ b/Octokit/Models/Response/Commit.cs @@ -11,11 +11,10 @@ public class Commit : GitReference public Commit() { } public Commit(string nodeId, string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable parents, int commentCount, Verification verification) - : base(url, label, @ref, sha, user, repository) + : base(nodeId, url, label, @ref, sha, user, repository) { Ensure.ArgumentNotNull(parents, nameof(parents)); - NodeId = nodeId; Message = message; Author = author; Committer = committer; @@ -25,11 +24,6 @@ public Commit(string nodeId, string url, string label, string @ref, string sha, Verification = verification; } - /// - /// GraphQL Node Id - /// - public string NodeId { get; protected set; } - public string Message { get; protected set; } public Committer Author { get; protected set; } diff --git a/Octokit/Models/Response/GitHubCommit.cs b/Octokit/Models/Response/GitHubCommit.cs index facc929b71..34f4a35606 100644 --- a/Octokit/Models/Response/GitHubCommit.cs +++ b/Octokit/Models/Response/GitHubCommit.cs @@ -11,8 +11,8 @@ public class GitHubCommit : GitReference { public GitHubCommit() { } - public GitHubCommit(string url, string label, string @ref, string sha, User user, Repository repository, Author author, string commentsUrl, Commit commit, Author committer, string htmlUrl, GitHubCommitStats stats, IReadOnlyList parents, IReadOnlyList files) - : base(url, label, @ref, sha, user, repository) + public GitHubCommit(string nodeId, string url, string label, string @ref, string sha, User user, Repository repository, Author author, string commentsUrl, Commit commit, Author committer, string htmlUrl, GitHubCommitStats stats, IReadOnlyList parents, IReadOnlyList files) + : base(nodeId, url, label, @ref, sha, user, repository) { Author = author; CommentsUrl = commentsUrl; diff --git a/Octokit/Models/Response/GitTag.cs b/Octokit/Models/Response/GitTag.cs index 5c7e73d5d7..6db53711d7 100644 --- a/Octokit/Models/Response/GitTag.cs +++ b/Octokit/Models/Response/GitTag.cs @@ -7,8 +7,8 @@ public class GitTag : GitReference { public GitTag() { } - public GitTag(string url, string label, string @ref, string sha, User user, Repository repository, string tag, string message, Committer tagger, TagObject @object, Verification verification) - : base(url, label, @ref, sha, user, repository) + public GitTag(string nodeId, string url, string label, string @ref, string sha, User user, Repository repository, string tag, string message, Committer tagger, TagObject @object, Verification verification) + : base(nodeId, url, label, @ref, sha, user, repository) { Tag = tag; Message = message; @@ -17,6 +17,7 @@ public GitTag(string url, string label, string @ref, string sha, User user, Repo Verification = verification; } + public string Tag { get; protected set; } public string Message { get; protected set; } diff --git a/Octokit/Models/Response/Merge.cs b/Octokit/Models/Response/Merge.cs index bfea87ef22..8af031a08b 100644 --- a/Octokit/Models/Response/Merge.cs +++ b/Octokit/Models/Response/Merge.cs @@ -10,8 +10,8 @@ public class Merge : GitReference { public Merge() { } - public Merge(string url, string label, string @ref, string sha, User user, Repository repository, Author author, Author committer, Commit commit, IEnumerable parents, string commentsUrl, int commentCount, string htmlUrl) - : base(url, label, @ref, sha, user, repository) + public Merge(string nodeId, string url, string label, string @ref, string sha, User user, Repository repository, Author author, Author committer, Commit commit, IEnumerable parents, string commentsUrl, int commentCount, string htmlUrl) + : base(nodeId, url, label, @ref, sha, user, repository) { Ensure.ArgumentNotNull(parents, nameof(parents)); diff --git a/Octokit/Models/Response/TagObject.cs b/Octokit/Models/Response/TagObject.cs index 26080b3b3d..0ffa976dfe 100644 --- a/Octokit/Models/Response/TagObject.cs +++ b/Octokit/Models/Response/TagObject.cs @@ -9,8 +9,8 @@ public class TagObject : GitReference { public TagObject() { } - public TagObject(string url, string label, string @ref, string sha, User user, Repository repository, TaggedType type) - : base(url, label, @ref, sha, user, repository) + public TagObject(string nodeId, string url, string label, string @ref, string sha, User user, Repository repository, TaggedType type) + : base(nodeId, url, label, @ref, sha, user, repository) { Type = type; } From a1b7a3144a412a148b36d0d4edcebe4b116284cb Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Fri, 8 Jun 2018 10:24:04 -0700 Subject: [PATCH 07/22] add node_id to Issue --- Octokit/Models/Response/Issue.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Octokit/Models/Response/Issue.cs b/Octokit/Models/Response/Issue.cs index 2f7b930234..4a0add46fa 100644 --- a/Octokit/Models/Response/Issue.cs +++ b/Octokit/Models/Response/Issue.cs @@ -11,9 +11,10 @@ public class Issue { public Issue() { } - public Issue(string url, string htmlUrl, string commentsUrl, string eventsUrl, int number, ItemState state, string title, string body, User closedBy, User user, IReadOnlyList