-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
User.cs
64 lines (55 loc) · 2.54 KB
/
User.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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; private set; }
/// <summary>
/// Whether or not the user is an administrator of the site
/// </summary>
public bool SiteAdmin { get; private set; }
/// <summary>
/// When the user was suspended, if at all (GitHub Enterprise)
/// </summary>
public DateTimeOffset? SuspendedAt { get; private 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; private set; }
/// <summary>
/// Date the user account was updated.
/// </summary>
public DateTimeOffset UpdatedAt { get; private set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture,
"User: Id: {0} Login: {1}", Id, Login);
}
}
}
}