From bf90de6dd6666636c02b1dbee828cecb2caef2d8 Mon Sep 17 00:00:00 2001 From: devhl Date: Fri, 23 Jan 2026 21:11:49 -0500 Subject: [PATCH] added xml comments and restrict some access --- .../libraries/generichost/RateLimitProvider`1.mustache | 8 ++++++-- .../csharp/libraries/generichost/TokenBase.mustache | 9 +++++++++ .../libraries/generichost/TokenProvider`1.mustache | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../OneOfList/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../latest/Tags/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../Tags/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net10/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net10/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../FormModels/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net10/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../Petstore/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../AllOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../FormModels/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../OneOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../Petstore/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../AllOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../FormModels/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../OneOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../Petstore/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../FormModels/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../Petstore/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net9/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net9/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../FormModels/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../net9/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../Petstore/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- .../src/Org.OpenAPITools/Client/RateLimitProvider`1.cs | 8 ++++++-- .../Petstore/src/Org.OpenAPITools/Client/TokenBase.cs | 9 +++++++++ .../src/Org.OpenAPITools/Client/TokenProvider`1.cs | 8 +++++++- 144 files changed, 1056 insertions(+), 144 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache index a787cfd640db..2e74e493fce2 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/RateLimitProvider`1.mustache @@ -16,7 +16,11 @@ namespace {{packageName}}.{{clientPackage}} /// {{>visibility}} class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new{{^net70OrLater}} Dictionary>{{/net70OrLater}}(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -85,7 +89,7 @@ namespace {{packageName}}.{{clientPackage}} } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel{{nrt?}} tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenBase.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenBase.mustache index d4d520e67c1d..fcb3aa9de945 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenBase.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenBase.mustache @@ -19,7 +19,16 @@ namespace {{packageName}}.{{clientPackage}} internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler{{nrt?}} TokenBecameAvailable; diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenProvider`1.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenProvider`1.mustache index 21dc823e64f5..55743224c4fa 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenProvider`1.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/TokenProvider`1.mustache @@ -16,6 +16,12 @@ namespace {{packageName}} /// {{>visibility}} abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default{{^netstandard20OrLater}}(global::System.Threading.CancellationToken){{/netstandard20OrLater}}); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 0f1476c40c26..c1e9012a9965 100644 --- a/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 41825a6caa05..93eb78fe8829 100644 --- a/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/ComposedEnum/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e391d54816c1..e1947b346887 100644 --- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 4a2eeb313648..260b523cf349 100644 --- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 47f04ad710a3..f47686424279 100644 --- a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 2d668528ef65..3528b94f6725 100644 --- a/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e3393fd59add..580368b3fa8f 100644 --- a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 56f0a7675aec..9ee5d4e3849f 100644 --- a/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/OneOfList/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 37880748aed6..8deb80ac2f35 100644 --- a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -22,7 +22,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -74,7 +78,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenProvider`1.cs index a65bd07d9681..cce71626227e 100644 --- a/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/latest/Tags/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -22,6 +22,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 7b0510910777..9f0455767aca 100644 --- a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 16359b31aa40..c66cdb4ee2a4 100644 --- a/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index be9379a5634d..b3e2c32d4ed1 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index aedb1cef12fa..674ae48622db 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -73,7 +77,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 2d668528ef65..3528b94f6725 100644 --- a/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index be9379a5634d..b3e2c32d4ed1 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index aedb1cef12fa..674ae48622db 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -73,7 +77,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 2d668528ef65..3528b94f6725 100644 --- a/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 63af49ff9e42..a679439c57aa 100644 --- a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 36ae5069699f..aa26e4e69804 100644 --- a/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 79b86c53e0cd..0df212257386 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index c96d82895566..7ec5cecf4014 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e41f3d33abf7..33c9efff7660 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 08831f405128..b02febec9d4c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e41f3d33abf7..33c9efff7660 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 08831f405128..b02febec9d4c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 5fe566880915..92d0282669fa 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e41f3d33abf7..33c9efff7660 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 08831f405128..b02febec9d4c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 5fe566880915..92d0282669fa 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 6443e1b673a8..6f189d0fa7df 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs index a7c8e2a4567e..f11e0d1ad51e 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 79b86c53e0cd..0df212257386 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index c96d82895566..7ec5cecf4014 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e41f3d33abf7..33c9efff7660 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 08831f405128..b02febec9d4c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e41f3d33abf7..33c9efff7660 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 08831f405128..b02febec9d4c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 5fe566880915..92d0282669fa 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index e41f3d33abf7..33c9efff7660 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 08831f405128..b02febec9d4c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 5fe566880915..92d0282669fa 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 6443e1b673a8..6f189d0fa7df 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -45,7 +49,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs index a7c8e2a4567e..f11e0d1ad51e 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 7b0510910777..9f0455767aca 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 16359b31aa40..c66cdb4ee2a4 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index be9379a5634d..b3e2c32d4ed1 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index aedb1cef12fa..674ae48622db 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -73,7 +77,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 2d668528ef65..3528b94f6725 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index be9379a5634d..b3e2c32d4ed1 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index aedb1cef12fa..674ae48622db 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -73,7 +77,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 2d668528ef65..3528b94f6725 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 63af49ff9e42..a679439c57aa 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 36ae5069699f..aa26e4e69804 100644 --- a/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 7b0510910777..9f0455767aca 100644 --- a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 16359b31aa40..c66cdb4ee2a4 100644 --- a/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/AllOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index be9379a5634d..b3e2c32d4ed1 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index aedb1cef12fa..674ae48622db 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -73,7 +77,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 2d668528ef65..3528b94f6725 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 413887f07db1..77d36ad1aa38 100644 --- a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 0f375142c129..7f56320e4115 100644 --- a/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/OneOf/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index be9379a5634d..b3e2c32d4ed1 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index aedb1cef12fa..674ae48622db 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -73,7 +77,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 2d668528ef65..3528b94f6725 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 63af49ff9e42..a679439c57aa 100644 --- a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -21,7 +21,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -47,7 +51,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel? tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs index aa6df45cf7c0..58cc70a257f7 100644 --- a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenBase.cs @@ -17,7 +17,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler? TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 36ae5069699f..aa26e4e69804 100644 --- a/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -21,6 +21,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs index 5fe566880915..92d0282669fa 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/RateLimitProvider`1.cs @@ -19,7 +19,11 @@ namespace Org.OpenAPITools.Client /// public class RateLimitProvider : TokenProvider where TTokenBase : TokenBase { - public Dictionary> AvailableTokens { get; } = new Dictionary>(); + /// + /// Dictionary mapping header names to channels of available tokens for rate limiting. + /// Each channel buffers tokens that have become available and are ready for use. + /// + protected internal Dictionary> AvailableTokens { get; } = new Dictionary>(); /// /// Instantiates a ThrottledTokenProvider. Your tokens will be rate limited based on the token's timeout. @@ -71,7 +75,7 @@ public RateLimitProvider(TokenContainer container) : base() } /// - public override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) + protected internal override async System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default) { if (!AvailableTokens.TryGetValue(header, out global::System.Threading.Channels.Channel tokens)) throw new KeyNotFoundException($"Could not locate a token for header '{header}'."); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs index 11cddf564b33..a03a7085a1ac 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenBase.cs @@ -15,7 +15,16 @@ public abstract class TokenBase internal TimeSpan? Timeout { get; set; } + + /// + /// Delegate for token availability notification events. + /// + /// The token that became available. public delegate void TokenBecameAvailableEventHandler(object sender); + + /// + /// Event raised when a rate-limited token becomes available for use. + /// public event TokenBecameAvailableEventHandler TokenBecameAvailable; diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs index 1a9a30116ee5..4b00ebf1d497 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Client/TokenProvider`1.cs @@ -19,6 +19,12 @@ namespace Org.OpenAPITools /// public abstract class TokenProvider where TTokenBase : TokenBase { - public abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); + /// + /// Gets a token asynchronously for the specified header. + /// + /// The header name to retrieve a token for. Empty string for non-API-key authentication schemes. + /// Cancellation token for the asynchronous operation. + /// A task that returns the requested token. + protected internal abstract System.Threading.Tasks.ValueTask GetAsync(string header = "", System.Threading.CancellationToken cancellation = default); } } \ No newline at end of file