using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using Octokit.Internal; namespace Octokit { [DebuggerDisplay("{DebuggerDisplay,nq}")] public class OauthToken { public OauthToken() { } public OauthToken(string tokenType, string accessToken, IReadOnlyList scope, string error, string errorDescription, string errorUri) { this.TokenType = tokenType; this.AccessToken = accessToken; this.Scope = scope; this.Error = error; this.ErrorDescription = errorDescription; this.ErrorUri = errorUri; } /// /// The type of OAuth token /// public string TokenType { get; private set; } /// /// The secret OAuth access token. Use this to authenticate Octokit.net's client. /// public string AccessToken { get; private set; } /// /// The list of scopes the token includes. /// public IReadOnlyList Scope { get; private set; } /// /// Gets or sets the error code or the response. /// [Parameter(Key = "error")] public string Error { get; private set; } /// /// Gets or sets the error description. /// [Parameter(Key = "error_description")] public string ErrorDescription { get; private set; } /// /// Gets or sets the error uri. /// [Parameter(Key = "error_uri")] public string ErrorUri { get; private set; } internal string DebuggerDisplay { get { return string.Format(CultureInfo.InvariantCulture, "TokenType: {0}, AccessToken: {1}, Scopes: {2}", this.TokenType, this.AccessToken, this.Scope); } } } }