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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions src/libs/PlayHT/Generated/PlayHT.AutoSDKHttpResponse.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

#nullable enable

namespace PlayHT
{
/// <summary>
/// Represents a successful HTTP response with status code and headers.
/// </summary>
public partial class AutoSDKHttpResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers)
: this(
statusCode: statusCode,
headers: headers,
requestUri: null)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers,
global::System.Uri? requestUri)
{
StatusCode = statusCode;
Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers));
RequestUri = requestUri;
}

/// <summary>
/// Gets the HTTP status code.
/// </summary>
public global::System.Net.HttpStatusCode StatusCode { get; }
/// <summary>
/// Gets the response headers.
/// </summary>
public global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> Headers { get; }
/// <summary>
/// Gets the final request URI associated with the response.
/// </summary>
public global::System.Uri? RequestUri { get; }

internal static global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> 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<string>)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;
}
}

/// <summary>
/// Represents a successful HTTP response with status code, headers, and body.
/// </summary>
public partial class AutoSDKHttpResponse<T> : AutoSDKHttpResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse{T}"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers,
T body)
: this(
statusCode: statusCode,
headers: headers,
requestUri: null,
body: body)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="AutoSDKHttpResponse{T}"/> class.
/// </summary>
public AutoSDKHttpResponse(
global::System.Net.HttpStatusCode statusCode,
global::System.Collections.Generic.Dictionary<string, global::System.Collections.Generic.IEnumerable<string>> headers,
global::System.Uri? requestUri,
T body)
: base(statusCode, headers, requestUri)
{
Body = body;
}

/// <summary>
/// Gets the response body.
/// </summary>
public T Body { get; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ public partial interface ITextToSpeechClient
/// Create an asynchronous text-to-speech job<br/>
/// Returns a job ID that can be polled with `GET /api/v1/tts/{asyncTtsJobId}`.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PlayHT.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PlayHT.AutoSDKHttpResponse<global::PlayHT.CreateSpeechResponse>> CreateSpeechAsResponseAsync(

global::PlayHT.CreateSpeechRequest request,
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create an asynchronous text-to-speech job<br/>
/// Returns a job ID that can be polled with `GET /api/v1/tts/{asyncTtsJobId}`.
/// </summary>
/// <param name="text"></param>
/// <param name="voice">
/// Voice ID or cloned voice manifest URL.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@ public partial interface ITextToSpeechClient
string asyncTtsJobId,
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Get an asynchronous TTS job
/// </summary>
/// <param name="asyncTtsJobId"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PlayHT.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PlayHT.AutoSDKHttpResponse<global::PlayHT.SpeechJob>> GetSpeechJobAsResponseAsync(
string asyncTtsJobId,
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,32 @@ public partial interface ITextToSpeechClient
/// Stream generated speech bytes<br/>
/// Streams audio bytes from the selected PlayAI model.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PlayHT.ApiException"></exception>
global::System.Threading.Tasks.Task<global::System.IO.Stream> StreamSpeechAsStreamAsync(

global::PlayHT.StreamSpeechRequest request,
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Stream generated speech bytes<br/>
/// Streams audio bytes from the selected PlayAI model.
/// </summary>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PlayHT.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PlayHT.AutoSDKHttpResponse<byte[]>> StreamSpeechAsResponseAsync(

global::PlayHT.StreamSpeechRequest request,
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Stream generated speech bytes<br/>
/// Streams audio bytes from the selected PlayAI model.
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@ public partial interface IVoicesClient
global::System.Threading.Tasks.Task<global::PlayHT.ListVoicesResponse> ListVoicesAsync(
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// List prebuilt voices
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PlayHT.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PlayHT.AutoSDKHttpResponse<global::PlayHT.ListVoicesResponse>> ListVoicesAsResponseAsync(
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,14 @@ public partial interface IWebSocketClient
global::System.Threading.Tasks.Task<global::PlayHT.WebSocketAuthResponse> CreateWebSocketAuthAsync(
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Create short-lived WebSocket URLs for realtime TTS
/// </summary>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::PlayHT.ApiException"></exception>
global::System.Threading.Tasks.Task<global::PlayHT.AutoSDKHttpResponse<global::PlayHT.WebSocketAuthResponse>> CreateWebSocketAuthAsResponseAsync(
global::PlayHT.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Loading