Skip to content
Open
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
@@ -1,6 +1,5 @@
// <auto-generated>
{{>partial_header}}

{{#nrt}}
#nullable enable

Expand All @@ -17,21 +16,21 @@ namespace {{packageName}}.{{clientPackage}}
/// <typeparam name="TTokenBase"></typeparam>
{{>visibility}} class RateLimitProvider<TTokenBase> : TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
internal Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>>{{/net70OrLater}}();
public Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>>{{/net70OrLater}}();

/// <summary>
/// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout.
/// </summary>
/// <param name="container"></param>
public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.Tokens)
public RateLimitProvider(TokenContainer<TTokenBase> container) : base()
{
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40));

{{#lambda.copy}}
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length)
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(container.Tokens.Count)
{
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropOldest
};

AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded<TTokenBase>(options));
Expand All @@ -45,7 +44,7 @@ namespace {{packageName}}.{{clientPackage}}
{
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(apiKeyTokenContainer.Tokens.Count(t => ClientUtils.ApiKeyHeaderToString(t.Header).Equals(header)))
{
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropOldest
};

AvailableTokens.Add(header, global::System.Threading.Channels.Channel.CreateBounded<TTokenBase>(options));
Expand All @@ -65,7 +64,7 @@ namespace {{packageName}}.{{clientPackage}}
{{/hasApiKeyMethods}}

foreach (var availableToken in AvailableTokens)
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
{
{{#hasApiKeyMethods}}
if (token is ApiKeyToken apiKeyToken)
Expand All @@ -85,7 +84,7 @@ 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}})
public 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 @@ -19,8 +19,8 @@ namespace {{packageName}}.{{clientPackage}}


internal TimeSpan? Timeout { get; set; }
internal delegate void TokenBecameAvailableEventHandler(object sender);
internal event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable;
public delegate void TokenBecameAvailableEventHandler(object sender);
public event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// <auto-generated>
{{>partial_header}}

{{#nrt}}
#nullable enable

Expand All @@ -17,23 +16,6 @@ namespace {{packageName}}
/// </summary>
{{>visibility}} abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
/// <summary>
/// The array of tokens.
/// </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>
/// Instantiates a TokenProvider.
/// </summary>
/// <param name="tokens"></param>
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
public abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* The version of the OpenAPI document: 0.0.1
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

#nullable enable

using System;
Expand All @@ -22,32 +21,32 @@
/// <typeparam name="TTokenBase"></typeparam>
public class RateLimitProvider<TTokenBase> : TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
internal Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new();
public Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new();

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.AvailableTokens'

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.AvailableTokens'

/// <summary>
/// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout.
/// </summary>
/// <param name="container"></param>
public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.Tokens)
public RateLimitProvider(TokenContainer<TTokenBase> container) : base()
{
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40));

global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length)
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(container.Tokens.Count)
{
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropOldest
};

AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded<TTokenBase>(options));

foreach (var availableToken in AvailableTokens)
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
{
token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender));
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
public override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)

Check warning on line 49 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.GetAsync(string, CancellationToken)'

Check warning on line 49 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.GetAsync(string, CancellationToken)'
{
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 @@ -17,8 +17,8 @@


internal TimeSpan? Timeout { get; set; }
internal delegate void TokenBecameAvailableEventHandler(object sender);
internal event TokenBecameAvailableEventHandler? TokenBecameAvailable;
public delegate void TokenBecameAvailableEventHandler(object sender);

Check warning on line 20 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailableEventHandler'

Check warning on line 20 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailableEventHandler'
public event TokenBecameAvailableEventHandler? TokenBecameAvailable;

Check warning on line 21 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailable'

Check warning on line 21 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailable'


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* The version of the OpenAPI document: 0.0.1
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

#nullable enable

using System;
Expand All @@ -22,23 +21,6 @@
/// </summary>
public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
/// <summary>
/// The array of tokens.
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
/// </summary>
/// <param name="tokens"></param>
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
public abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'TokenProvider<TTokenBase>.GetAsync(string, CancellationToken)'

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/ComposedEnum)

Missing XML comment for publicly visible type or member 'TokenProvider<TTokenBase>.GetAsync(string, CancellationToken)'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

#nullable enable

using System;
Expand All @@ -22,32 +21,32 @@
/// <typeparam name="TTokenBase"></typeparam>
public class RateLimitProvider<TTokenBase> : TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
internal Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new();
public Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new();

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.AvailableTokens'

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.AvailableTokens'

/// <summary>
/// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout.
/// </summary>
/// <param name="container"></param>
public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.Tokens)
public RateLimitProvider(TokenContainer<TTokenBase> container) : base()
{
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40));

global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length)
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(container.Tokens.Count)
{
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropOldest
};

AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded<TTokenBase>(options));

foreach (var availableToken in AvailableTokens)
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
{
token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender));
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
public override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)

Check warning on line 49 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.GetAsync(string, CancellationToken)'

Check warning on line 49 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.GetAsync(string, CancellationToken)'
{
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 @@ -17,8 +17,8 @@


internal TimeSpan? Timeout { get; set; }
internal delegate void TokenBecameAvailableEventHandler(object sender);
internal event TokenBecameAvailableEventHandler? TokenBecameAvailable;
public delegate void TokenBecameAvailableEventHandler(object sender);

Check warning on line 20 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailableEventHandler'

Check warning on line 20 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailableEventHandler'
public event TokenBecameAvailableEventHandler? TokenBecameAvailable;

Check warning on line 21 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailable'

Check warning on line 21 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailable'


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

#nullable enable

using System;
Expand All @@ -22,23 +21,6 @@
/// </summary>
public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
/// <summary>
/// The array of tokens.
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
/// </summary>
/// <param name="tokens"></param>
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
public abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'TokenProvider<TTokenBase>.GetAsync(string, CancellationToken)'

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/HelloWorld)

Missing XML comment for publicly visible type or member 'TokenProvider<TTokenBase>.GetAsync(string, CancellationToken)'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

#nullable enable

using System;
Expand All @@ -22,32 +21,32 @@
/// <typeparam name="TTokenBase"></typeparam>
public class RateLimitProvider<TTokenBase> : TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
internal Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new();
public Dictionary<string, global::System.Threading.Channels.Channel<TTokenBase>> AvailableTokens { get; } = new();

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.AvailableTokens'

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.AvailableTokens'

/// <summary>
/// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout.
/// </summary>
/// <param name="container"></param>
public RateLimitProvider(TokenContainer<TTokenBase> container) : base(container.Tokens)
public RateLimitProvider(TokenContainer<TTokenBase> container) : base()
{
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
token.StartTimer(token.Timeout ?? TimeSpan.FromMilliseconds(40));

global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(_tokens.Length)
global::System.Threading.Channels.BoundedChannelOptions options = new global::System.Threading.Channels.BoundedChannelOptions(container.Tokens.Count)
{
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropWrite
FullMode = global::System.Threading.Channels.BoundedChannelFullMode.DropOldest
};

AvailableTokens.Add(string.Empty, global::System.Threading.Channels.Channel.CreateBounded<TTokenBase>(options));

foreach (var availableToken in AvailableTokens)
foreach(TTokenBase token in _tokens)
foreach(TTokenBase token in container.Tokens)
{
token.TokenBecameAvailable += ((sender) => availableToken.Value.Writer.TryWrite((TTokenBase)sender));
}
}

internal override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)
public override async System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default)

Check warning on line 49 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.GetAsync(string, CancellationToken)'

Check warning on line 49 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'RateLimitProvider<TTokenBase>.GetAsync(string, CancellationToken)'
{
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 @@ -17,8 +17,8 @@


internal TimeSpan? Timeout { get; set; }
internal delegate void TokenBecameAvailableEventHandler(object sender);
internal event TokenBecameAvailableEventHandler? TokenBecameAvailable;
public delegate void TokenBecameAvailableEventHandler(object sender);

Check warning on line 20 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailableEventHandler'

Check warning on line 20 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailableEventHandler'
public event TokenBecameAvailableEventHandler? TokenBecameAvailable;

Check warning on line 21 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailable'

Check warning on line 21 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'TokenBase.TokenBecameAvailable'


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

#nullable enable

using System;
Expand All @@ -22,23 +21,6 @@
/// </summary>
public abstract class TokenProvider<TTokenBase> where TTokenBase : TokenBase
{
/// <summary>
/// The array of tokens.
/// </summary>
protected TTokenBase[] _tokens;

internal abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

/// <summary>
/// Instantiates a TokenProvider.
/// </summary>
/// <param name="tokens"></param>
public TokenProvider(IEnumerable<TTokenBase> tokens)
{
_tokens = tokens.ToArray();

if (_tokens.Length == 0)
throw new ArgumentException("You did not provide any tokens.");
}
public abstract System.Threading.Tasks.ValueTask<TTokenBase> GetAsync(string header = "", System.Threading.CancellationToken cancellation = default);

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'TokenProvider<TTokenBase>.GetAsync(string, CancellationToken)'

Check warning on line 24 in samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs

View workflow job for this annotation

GitHub Actions / Build .Net projects (samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf)

Missing XML comment for publicly visible type or member 'TokenProvider<TTokenBase>.GetAsync(string, CancellationToken)'
}
}
Loading
Loading