diff --git a/src/libs/PlayHT/Generated/PlayHT.AutoSDKHttpResponse.g.cs b/src/libs/PlayHT/Generated/PlayHT.AutoSDKHttpResponse.g.cs new file mode 100644 index 0000000..7e9efa8 --- /dev/null +++ b/src/libs/PlayHT/Generated/PlayHT.AutoSDKHttpResponse.g.cs @@ -0,0 +1,121 @@ + +#nullable enable + +namespace PlayHT +{ + /// + /// Represents a successful HTTP response with status code and headers. + /// + public partial class AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri) + { + StatusCode = statusCode; + Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers)); + RequestUri = requestUri; + } + + /// + /// Gets the HTTP status code. + /// + public global::System.Net.HttpStatusCode StatusCode { get; } + /// + /// Gets the response headers. + /// + public global::System.Collections.Generic.Dictionary> Headers { get; } + /// + /// Gets the final request URI associated with the response. + /// + public global::System.Uri? RequestUri { get; } + + internal static global::System.Collections.Generic.Dictionary> CreateHeaders( + global::System.Net.Http.HttpResponseMessage response) + { + response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + + var headers = global::System.Linq.Enumerable.ToDictionary( + response.Headers, + static header => header.Key, + static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value), + global::System.StringComparer.OrdinalIgnoreCase); + + if (response.Content?.Headers == null) + { + return headers; + } + + foreach (var header in response.Content.Headers) + { + if (headers.TryGetValue(header.Key, out var existingValues)) + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray( + global::System.Linq.Enumerable.Concat(existingValues, header.Value)); + } + else + { + headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value); + } + } + + return headers; + } + } + + /// + /// Represents a successful HTTP response with status code, headers, and body. + /// + public partial class AutoSDKHttpResponse : AutoSDKHttpResponse + { + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + T body) + : this( + statusCode: statusCode, + headers: headers, + requestUri: null, + body: body) + { + } + + /// + /// Initializes a new instance of the class. + /// + public AutoSDKHttpResponse( + global::System.Net.HttpStatusCode statusCode, + global::System.Collections.Generic.Dictionary> headers, + global::System.Uri? requestUri, + T body) + : base(statusCode, headers, requestUri) + { + Body = body; + } + + /// + /// Gets the response body. + /// + public T Body { get; } + } +} \ No newline at end of file diff --git a/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.CreateSpeech.g.cs b/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.CreateSpeech.g.cs index e57d89d..a4039ab 100644 --- a/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.CreateSpeech.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.CreateSpeech.g.cs @@ -21,6 +21,19 @@ public partial interface ITextToSpeechClient /// Create an asynchronous text-to-speech job
/// Returns a job ID that can be polled with `GET /api/v1/tts/{asyncTtsJobId}`. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateSpeechAsResponseAsync( + + global::PlayHT.CreateSpeechRequest request, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an asynchronous text-to-speech job
+ /// Returns a job ID that can be polled with `GET /api/v1/tts/{asyncTtsJobId}`. + ///
/// /// /// Voice ID or cloned voice manifest URL. diff --git a/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.GetSpeechJob.g.cs b/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.GetSpeechJob.g.cs index 15de3de..ec0b6df 100644 --- a/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.GetSpeechJob.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.GetSpeechJob.g.cs @@ -15,5 +15,16 @@ public partial interface ITextToSpeechClient string asyncTtsJobId, global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an asynchronous TTS job + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSpeechJobAsResponseAsync( + string asyncTtsJobId, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.StreamSpeech.g.cs b/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.StreamSpeech.g.cs index 7f7a25f..a5bb7ee 100644 --- a/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.StreamSpeech.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.ITextToSpeechClient.StreamSpeech.g.cs @@ -21,6 +21,32 @@ public partial interface ITextToSpeechClient /// Stream generated speech bytes
/// Streams audio bytes from the selected PlayAI model. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task StreamSpeechAsStreamAsync( + + global::PlayHT.StreamSpeechRequest request, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream generated speech bytes
+ /// Streams audio bytes from the selected PlayAI model. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> StreamSpeechAsResponseAsync( + + global::PlayHT.StreamSpeechRequest request, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Stream generated speech bytes
+ /// Streams audio bytes from the selected PlayAI model. + ///
/// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/PlayHT/Generated/PlayHT.IVoicesClient.ListVoices.g.cs b/src/libs/PlayHT/Generated/PlayHT.IVoicesClient.ListVoices.g.cs index f7fdb5f..aa71e88 100644 --- a/src/libs/PlayHT/Generated/PlayHT.IVoicesClient.ListVoices.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.IVoicesClient.ListVoices.g.cs @@ -13,5 +13,14 @@ public partial interface IVoicesClient global::System.Threading.Tasks.Task ListVoicesAsync( global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List prebuilt voices + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListVoicesAsResponseAsync( + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/PlayHT/Generated/PlayHT.IWebSocketClient.CreateWebSocketAuth.g.cs b/src/libs/PlayHT/Generated/PlayHT.IWebSocketClient.CreateWebSocketAuth.g.cs index 9ec351b..bb5a5c7 100644 --- a/src/libs/PlayHT/Generated/PlayHT.IWebSocketClient.CreateWebSocketAuth.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.IWebSocketClient.CreateWebSocketAuth.g.cs @@ -13,5 +13,14 @@ public partial interface IWebSocketClient global::System.Threading.Tasks.Task CreateWebSocketAuthAsync( global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create short-lived WebSocket URLs for realtime TTS + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateWebSocketAuthAsResponseAsync( + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/PlayHT/Generated/PlayHT.OptionsSupport.g.cs b/src/libs/PlayHT/Generated/PlayHT.OptionsSupport.g.cs index 8808aa9..8fd5484 100644 --- a/src/libs/PlayHT/Generated/PlayHT.OptionsSupport.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::PlayHT.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::PlayHT.AutoSDKClientOptions clientOptions, global::PlayHT.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::PlayHT.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::PlayHT.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode( diff --git a/src/libs/PlayHT/Generated/PlayHT.PlayHTClient.g.cs b/src/libs/PlayHT/Generated/PlayHT.PlayHTClient.g.cs index cf612db..de8d699 100644 --- a/src/libs/PlayHT/Generated/PlayHT.PlayHTClient.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.PlayHTClient.g.cs @@ -44,7 +44,7 @@ public sealed partial class PlayHTClient : global::PlayHT.IPlayHTClient, global: /// /// /// - public TextToSpeechClient TextToSpeech => new TextToSpeechClient(HttpClient, authorizations: Authorizations, options: Options) + public TextToSpeechClient TextToSpeech => new TextToSpeechClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -53,7 +53,7 @@ public sealed partial class PlayHTClient : global::PlayHT.IPlayHTClient, global: /// /// /// - public VoicesClient Voices => new VoicesClient(HttpClient, authorizations: Authorizations, options: Options) + public VoicesClient Voices => new VoicesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -62,7 +62,7 @@ public sealed partial class PlayHTClient : global::PlayHT.IPlayHTClient, global: /// /// /// - public WebSocketClient WebSocket => new WebSocketClient(HttpClient, authorizations: Authorizations, options: Options) + public WebSocketClient WebSocket => new WebSocketClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -101,10 +101,10 @@ public PlayHTClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public PlayHTClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::PlayHT.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::PlayHT.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/PlayHT/Generated/PlayHT.ResponseStream.g.cs b/src/libs/PlayHT/Generated/PlayHT.ResponseStream.g.cs new file mode 100644 index 0000000..f494138 --- /dev/null +++ b/src/libs/PlayHT/Generated/PlayHT.ResponseStream.g.cs @@ -0,0 +1,117 @@ + +#nullable enable + +namespace PlayHT +{ + internal sealed class ResponseStream : global::System.IO.Stream + { + private readonly global::System.Net.Http.HttpResponseMessage _response; + private readonly global::System.IO.Stream _stream; + private bool _disposed; + + public ResponseStream( + global::System.Net.Http.HttpResponseMessage response, + global::System.IO.Stream stream) + { + _response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + _stream = stream ?? throw new global::System.ArgumentNullException(nameof(stream)); + } + + public override bool CanRead => _stream.CanRead; + public override bool CanSeek => _stream.CanSeek; + public override bool CanWrite => _stream.CanWrite; + public override bool CanTimeout => _stream.CanTimeout; + public override long Length => _stream.Length; + + public override long Position + { + get => _stream.Position; + set => _stream.Position = value; + } + + public override int ReadTimeout + { + get => _stream.ReadTimeout; + set => _stream.ReadTimeout = value; + } + + public override int WriteTimeout + { + get => _stream.WriteTimeout; + set => _stream.WriteTimeout = value; + } + + public override void Flush() => _stream.Flush(); + + public override global::System.Threading.Tasks.Task FlushAsync( + global::System.Threading.CancellationToken cancellationToken) => + _stream.FlushAsync(cancellationToken); + + public override int Read(byte[] buffer, int offset, int count) => + _stream.Read(buffer, offset, count); + + public override global::System.Threading.Tasks.Task ReadAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.ReadAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask ReadAsync( + global::System.Memory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.ReadAsync(buffer, cancellationToken); +#endif + + public override long Seek(long offset, global::System.IO.SeekOrigin origin) => + _stream.Seek(offset, origin); + + public override void SetLength(long value) => + _stream.SetLength(value); + + public override void Write(byte[] buffer, int offset, int count) => + _stream.Write(buffer, offset, count); + + public override global::System.Threading.Tasks.Task WriteAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.WriteAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask WriteAsync( + global::System.ReadOnlyMemory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.WriteAsync(buffer, cancellationToken); +#endif + + protected override void Dispose(bool disposing) + { + if (!_disposed && disposing) + { + _disposed = true; + _stream.Dispose(); + _response.Dispose(); + } + + base.Dispose(disposing); + } + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override async global::System.Threading.Tasks.ValueTask DisposeAsync() + { + if (_disposed) + { + return; + } + + _disposed = true; + await _stream.DisposeAsync().ConfigureAwait(false); + _response.Dispose(); + await base.DisposeAsync().ConfigureAwait(false); + } +#endif + } +} \ No newline at end of file diff --git a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.CreateSpeech.g.cs b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.CreateSpeech.g.cs index 642730c..d5022ed 100644 --- a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.CreateSpeech.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.CreateSpeech.g.cs @@ -59,6 +59,29 @@ partial void ProcessCreateSpeechResponseContent( /// public async global::System.Threading.Tasks.Task CreateSpeechAsync( + global::PlayHT.CreateSpeechRequest request, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateSpeechAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an asynchronous text-to-speech job
+ /// Returns a job ID that can be polled with `GET /api/v1/tts/{asyncTtsJobId}`. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateSpeechAsResponseAsync( + global::PlayHT.CreateSpeechRequest request, global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -93,6 +116,7 @@ partial void ProcessCreateSpeechResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::PlayHT.PathBuilder( path: "/api/v1/tts", baseUri: HttpClient.BaseAddress); @@ -172,6 +196,8 @@ partial void ProcessCreateSpeechResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -182,6 +208,11 @@ partial void ProcessCreateSpeechResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -199,6 +230,8 @@ partial void ProcessCreateSpeechResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -208,8 +241,7 @@ partial void ProcessCreateSpeechResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -218,6 +250,11 @@ partial void ProcessCreateSpeechResponseContent( __attempt < __maxAttempts && global::PlayHT.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -234,14 +271,15 @@ partial void ProcessCreateSpeechResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -281,6 +319,8 @@ partial void ProcessCreateSpeechResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -301,6 +341,8 @@ partial void ProcessCreateSpeechResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request. @@ -363,9 +405,13 @@ partial void ProcessCreateSpeechResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::PlayHT.CreateSpeechResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::PlayHT.CreateSpeechResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -393,9 +439,13 @@ partial void ProcessCreateSpeechResponseContent( #endif ).ConfigureAwait(false); - return - await global::PlayHT.CreateSpeechResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::PlayHT.CreateSpeechResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.GetSpeechJob.g.cs b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.GetSpeechJob.g.cs index c08b6fe..81ab9c7 100644 --- a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.GetSpeechJob.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.GetSpeechJob.g.cs @@ -60,6 +60,26 @@ partial void ProcessGetSpeechJobResponseContent( string asyncTtsJobId, global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSpeechJobAsResponseAsync( + asyncTtsJobId: asyncTtsJobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an asynchronous TTS job + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetSpeechJobAsResponseAsync( + string asyncTtsJobId, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -89,6 +109,7 @@ partial void ProcessGetSpeechJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::PlayHT.PathBuilder( path: $"/api/v1/tts/{asyncTtsJobId}", baseUri: HttpClient.BaseAddress); @@ -162,6 +183,8 @@ partial void ProcessGetSpeechJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -172,6 +195,11 @@ partial void ProcessGetSpeechJobResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -189,6 +217,8 @@ partial void ProcessGetSpeechJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -198,8 +228,7 @@ partial void ProcessGetSpeechJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -208,6 +237,11 @@ partial void ProcessGetSpeechJobResponseContent( __attempt < __maxAttempts && global::PlayHT.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -224,14 +258,15 @@ partial void ProcessGetSpeechJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -271,6 +306,8 @@ partial void ProcessGetSpeechJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -291,6 +328,8 @@ partial void ProcessGetSpeechJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Job not found. @@ -353,9 +392,13 @@ partial void ProcessGetSpeechJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::PlayHT.SpeechJob.FromJson(__content, JsonSerializerContext) ?? + var __value = global::PlayHT.SpeechJob.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -383,9 +426,13 @@ partial void ProcessGetSpeechJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::PlayHT.SpeechJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::PlayHT.SpeechJob.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.StreamSpeech.g.cs b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.StreamSpeech.g.cs index 2e94402..484c261 100644 --- a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.StreamSpeech.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.StreamSpeech.g.cs @@ -59,6 +59,29 @@ partial void ProcessStreamSpeechResponseContent( /// public async global::System.Threading.Tasks.Task StreamSpeechAsync( + global::PlayHT.StreamSpeechRequest request, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StreamSpeechAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Stream generated speech bytes
+ /// Streams audio bytes from the selected PlayAI model. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task StreamSpeechAsStreamAsync( + global::PlayHT.StreamSpeechRequest request, global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +114,7 @@ partial void ProcessStreamSpeechResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::PlayHT.PathBuilder( path: "/api/v1/tts/stream", baseUri: HttpClient.BaseAddress); @@ -170,16 +194,23 @@ partial void ProcessStreamSpeechResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { __response = await HttpClient.SendAsync( request: __httpRequest, - completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -197,6 +228,8 @@ partial void ProcessStreamSpeechResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -206,8 +239,7 @@ partial void ProcessStreamSpeechResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -216,6 +248,11 @@ partial void ProcessStreamSpeechResponseContent( __attempt < __maxAttempts && global::PlayHT.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -232,14 +269,377 @@ partial void ProcessStreamSpeechResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + try + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessStreamSpeechResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSpeech", + methodName: "StreamSpeechAsync", + pathTemplate: "\"/api/v1/tts/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSpeech", + methodName: "StreamSpeechAsync", + pathTemplate: "\"/api/v1/tts/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Invalid request. + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::PlayHT.ErrorResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::PlayHT.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::PlayHT.ErrorResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::PlayHT.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + try + { + __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::PlayHT.ResponseStream(__response, __content); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::PlayHT.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + } + catch + { + __response.Dispose(); + throw; + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Stream generated speech bytes
+ /// Streams audio bytes from the selected PlayAI model. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> StreamSpeechAsResponseAsync( + + global::PlayHT.StreamSpeechRequest request, + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareStreamSpeechArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::PlayHT.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_StreamSpeechSecurityRequirements, + operationName: "StreamSpeechAsync"); + + using var __timeoutCancellationTokenSource = global::PlayHT.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::PlayHT.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::PlayHT.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::PlayHT.PathBuilder( + path: "/api/v1/tts/stream", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::PlayHT.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::PlayHT.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareStreamSpeechRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::PlayHT.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSpeech", + methodName: "StreamSpeechAsync", + pathTemplate: "\"/api/v1/tts/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSpeech", + methodName: "StreamSpeechAsync", + pathTemplate: "\"/api/v1/tts/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::PlayHT.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( clientOptions: Options, requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "StreamSpeech", + methodName: "StreamSpeechAsync", + pathTemplate: "\"/api/v1/tts/stream\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -279,6 +679,8 @@ partial void ProcessStreamSpeechResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +701,8 @@ partial void ProcessStreamSpeechResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Invalid request. @@ -357,7 +761,11 @@ partial void ProcessStreamSpeechResponseContent( { __response.EnsureSuccessStatusCode(); - return __content; + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { @@ -384,7 +792,11 @@ partial void ProcessStreamSpeechResponseContent( #endif ).ConfigureAwait(false); - return __content; + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __content); } catch (global::System.Exception __ex) { diff --git a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.g.cs b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.g.cs index 06f7bd1..a7bc8f0 100644 --- a/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.TextToSpeechClient.g.cs @@ -72,10 +72,10 @@ public TextToSpeechClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public TextToSpeechClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::PlayHT.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::PlayHT.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/PlayHT/Generated/PlayHT.VoicesClient.ListVoices.g.cs b/src/libs/PlayHT/Generated/PlayHT.VoicesClient.ListVoices.g.cs index fd77115..42f78c1 100644 --- a/src/libs/PlayHT/Generated/PlayHT.VoicesClient.ListVoices.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.VoicesClient.ListVoices.g.cs @@ -56,6 +56,23 @@ partial void ProcessListVoicesResponseContent( public async global::System.Threading.Tasks.Task ListVoicesAsync( global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListVoicesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List prebuilt voices + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> ListVoicesAsResponseAsync( + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -84,6 +101,7 @@ partial void ProcessListVoicesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::PlayHT.PathBuilder( path: "/api/v1/voices", baseUri: HttpClient.BaseAddress); @@ -156,6 +174,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -166,6 +186,11 @@ partial void ProcessListVoicesResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -183,6 +208,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -192,8 +219,7 @@ partial void ProcessListVoicesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -202,6 +228,11 @@ partial void ProcessListVoicesResponseContent( __attempt < __maxAttempts && global::PlayHT.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -218,14 +249,15 @@ partial void ProcessListVoicesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -265,6 +297,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -285,6 +319,8 @@ partial void ProcessListVoicesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -309,9 +345,13 @@ partial void ProcessListVoicesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::PlayHT.ListVoicesResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::PlayHT.ListVoicesResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -339,9 +379,13 @@ partial void ProcessListVoicesResponseContent( #endif ).ConfigureAwait(false); - return - await global::PlayHT.ListVoicesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::PlayHT.ListVoicesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/PlayHT/Generated/PlayHT.VoicesClient.g.cs b/src/libs/PlayHT/Generated/PlayHT.VoicesClient.g.cs index 4d8d46f..024d502 100644 --- a/src/libs/PlayHT/Generated/PlayHT.VoicesClient.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.VoicesClient.g.cs @@ -72,10 +72,10 @@ public VoicesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public VoicesClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::PlayHT.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::PlayHT.AutoSDKClientOptions? options, bool disposeHttpClient = true) { diff --git a/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.CreateWebSocketAuth.g.cs b/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.CreateWebSocketAuth.g.cs index 04e6e95..372e23d 100644 --- a/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.CreateWebSocketAuth.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.CreateWebSocketAuth.g.cs @@ -56,6 +56,23 @@ partial void ProcessCreateWebSocketAuthResponseContent( public async global::System.Threading.Tasks.Task CreateWebSocketAuthAsync( global::PlayHT.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateWebSocketAuthAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create short-lived WebSocket URLs for realtime TTS + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreateWebSocketAuthAsResponseAsync( + global::PlayHT.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -84,6 +101,7 @@ partial void ProcessCreateWebSocketAuthResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::PlayHT.PathBuilder( path: "/api/v1/tts/websocket-auth", baseUri: HttpClient.BaseAddress); @@ -156,6 +174,8 @@ partial void ProcessCreateWebSocketAuthResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -166,6 +186,11 @@ partial void ProcessCreateWebSocketAuthResponseContent( } catch (global::System.Net.Http.HttpRequestException __exception) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, @@ -183,6 +208,8 @@ partial void ProcessCreateWebSocketAuthResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -192,8 +219,7 @@ partial void ProcessCreateWebSocketAuthResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -202,6 +228,11 @@ partial void ProcessCreateWebSocketAuthResponseContent( __attempt < __maxAttempts && global::PlayHT.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) { + var __retryDelay = global::PlayHT.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); await global::PlayHT.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( clientOptions: Options, context: global::PlayHT.AutoSDKRequestOptionsSupport.CreateHookContext( @@ -218,14 +249,15 @@ partial void ProcessCreateWebSocketAuthResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); __response.Dispose(); __response = null; __httpRequest.Dispose(); __httpRequest = null; await global::PlayHT.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -265,6 +297,8 @@ partial void ProcessCreateWebSocketAuthResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -285,6 +319,8 @@ partial void ProcessCreateWebSocketAuthResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -309,9 +345,13 @@ partial void ProcessCreateWebSocketAuthResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::PlayHT.WebSocketAuthResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::PlayHT.WebSocketAuthResponse.FromJson(__content, JsonSerializerContext) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { @@ -339,9 +379,13 @@ partial void ProcessCreateWebSocketAuthResponseContent( #endif ).ConfigureAwait(false); - return - await global::PlayHT.WebSocketAuthResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::PlayHT.WebSocketAuthResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::PlayHT.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::PlayHT.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); } catch (global::System.Exception __ex) { diff --git a/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.g.cs b/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.g.cs index 6e495d6..fad6e0f 100644 --- a/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.g.cs +++ b/src/libs/PlayHT/Generated/PlayHT.WebSocketClient.g.cs @@ -72,10 +72,10 @@ public WebSocketClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public WebSocketClient( - global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null, - global::System.Collections.Generic.List? authorizations = null, - global::PlayHT.AutoSDKClientOptions? options = null, + global::System.Net.Http.HttpClient? httpClient, + global::System.Uri? baseUri, + global::System.Collections.Generic.List? authorizations, + global::PlayHT.AutoSDKClientOptions? options, bool disposeHttpClient = true) {