Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ namespace {{packageName}}.{{clientPackage}}
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}})
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}})
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>{{nrt?}} tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ namespace {{packageName}}
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}});
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}});

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -31,9 +36,6 @@ namespace {{packageName}}
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -36,9 +41,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -36,9 +41,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -36,9 +41,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -36,9 +41,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -37,9 +42,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -36,9 +41,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -36,9 +41,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -36,9 +41,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase> tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);
/// <summary>
/// Gets an authentication token to be used in request authorization.
/// </summary>
/// <param name="header"></param>
/// <param name="cancellation"></param>
protected internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
Expand All @@ -34,9 +39,6 @@ public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
/// <inheritdoc/>
protected internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
{
if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel<TTokenBase>? tokens))
throw new KeyNotFoundException($"Could not locate a token for header '{header}'.");
Expand Down
Loading
Loading