Files
octokit.net/Octokit/Models/Response/User.cs
Ryan Gribble 23b25f5922 add GraphQL Node ID's to response models (#1806)
* add node_id to Deployments payloads (Deployment and DeploymentStatus and Account/User/Organization)

* add node_id to gist responses

* add node_id to Git Blob

* add node_id to Git Commit response

* add node_id to GitReference response

* add node_id to everything that inherits GitReference

* add node_id to Issue

* add node_id to IssueComment/IssueEvent

* add node_id to Label

* add node_id to Milestone

* add node_id to Project/ProjectCard/ProjectColumn

* add node_id to Reaction

* add node_id to Release/ReleaseAsset

* add node_id to Team

* add node_id to Repository.RepositoryContributor/RepositoryInvitation/RepositoryTag

* add node_id to Commit related responses

* Add node_id to PullRequest related responses

* Add node_id to any response models it was found to be missing, based on auditing integration test responses

* remove unused test variable that was using a response ctor

* fix tests that need to handle node_id now

* Committer is a request object as well as response, so make nodeId optional

* fix test
2018-06-29 15:41:50 +10:00

65 lines
2.5 KiB
C#

using System;
using System.Diagnostics;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
/// <summary>
/// Represents a user on GitHub.
/// </summary>
[ExcludeFromCtorWithAllPropertiesConventionTest(nameof(Type))]
[DebuggerDisplay("{DebuggerDisplay,nq}")]
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, 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;
LdapDistinguishedName = ldapDistinguishedName;
SuspendedAt = suspendedAt;
UpdatedAt = updatedAt;
}
public RepositoryPermissions Permissions { get; protected set; }
/// <summary>
/// Whether or not the user is an administrator of the site
/// </summary>
public bool SiteAdmin { get; protected set; }
/// <summary>
/// When the user was suspended, if at all (GitHub Enterprise)
/// </summary>
public DateTimeOffset? SuspendedAt { get; protected set; }
/// <summary>
/// Whether or not the user is currently suspended
/// </summary>
public bool Suspended { get { return SuspendedAt.HasValue; } }
/// <summary>
/// LDAP Binding (GitHub Enterprise only)
/// </summary>
[Parameter(Key = "ldap_dn")]
public string LdapDistinguishedName { get; protected set; }
/// <summary>
/// Date the user account was updated.
/// </summary>
public DateTimeOffset UpdatedAt { get; protected set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture,
"User: Id: {0} Login: {1}", Id, Login);
}
}
}
}