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
4 changes: 2 additions & 2 deletions src/libs/PlayHT/Generated/PlayHT.AutoSDKHttpResponse.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public static class AutoSDKConditionalRequests
{
send = send ?? throw new global::System.ArgumentNullException(nameof(send));
requestOptions = CloneRequestOptions(requestOptions);
if (!string.IsNullOrWhiteSpace(entityTag))
if (entityTag is { } nonEmptyEntityTag && !string.IsNullOrWhiteSpace(nonEmptyEntityTag))
{
requestOptions.Headers["If-None-Match"] = entityTag!;
requestOptions.Headers["If-None-Match"] = nonEmptyEntityTag;
}

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList<global::PlayHT.Voice>), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.IList<global::PlayHT.Voice>?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList<global::PlayHT.Voice>).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ListVoicesResponseVariant1!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickListVoicesResponseVariant1(), typeInfo);
}
else if (value.IsListVoicesResponseVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.ListVoicesResponseVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::PlayHT.ListVoicesResponseVariant2?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.ListVoicesResponseVariant2).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ListVoicesResponseVariant2!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickListVoicesResponseVariant2(), typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.CreateSpeechRequest), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::PlayHT.CreateSpeechRequest?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.CreateSpeechRequest).Name}");
var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.Create!, typeInfo);
var __element0 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.PickCreate(), typeInfo);
if (__element0.ValueKind != global::System.Text.Json.JsonValueKind.Object)
{
throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
Expand All @@ -88,7 +88,7 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::PlayHT.StreamSpeechRequestVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::PlayHT.StreamSpeechRequestVariant2?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::PlayHT.StreamSpeechRequestVariant2).Name}");
var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.StreamSpeechRequestVariant2!, typeInfo);
var __element1 = global::System.Text.Json.JsonSerializer.SerializeToElement(value.PickStreamSpeechRequestVariant2(), typeInfo);
if (__element1.ValueKind != global::System.Text.Json.JsonValueKind.Object)
{
throw new global::System.Text.Json.JsonException("AllOf values must serialize as JSON objects.");
Expand Down
32 changes: 16 additions & 16 deletions src/libs/PlayHT/Generated/PlayHT.Models.ListVoicesResponse.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public bool TryPickListVoicesResponseVariant1(
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<global::PlayHT.Voice> PickListVoicesResponseVariant1() => IsListVoicesResponseVariant1
? ListVoicesResponseVariant1!
public global::System.Collections.Generic.IList<global::PlayHT.Voice> PickListVoicesResponseVariant1() => ListVoicesResponseVariant1 is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'ListVoicesResponseVariant1' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -79,8 +79,8 @@ public bool TryPickListVoicesResponseVariant2(
/// <summary>
///
/// </summary>
public global::PlayHT.ListVoicesResponseVariant2 PickListVoicesResponseVariant2() => IsListVoicesResponseVariant2
? ListVoicesResponseVariant2!
public global::PlayHT.ListVoicesResponseVariant2 PickListVoicesResponseVariant2() => ListVoicesResponseVariant2 is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'ListVoicesResponseVariant2' but the value was {ToString()}.");
/// <summary>
///
Expand Down Expand Up @@ -154,13 +154,13 @@ public bool Validate()
Validate();
}

if (IsListVoicesResponseVariant1 && listVoicesResponseVariant1 != null)
if (ListVoicesResponseVariant1 is { } __value0 && listVoicesResponseVariant1 != null)
{
return listVoicesResponseVariant1(ListVoicesResponseVariant1!);
return listVoicesResponseVariant1(__value0);
}
else if (IsListVoicesResponseVariant2 && listVoicesResponseVariant2 != null)
else if (ListVoicesResponseVariant2 is { } __value1 && listVoicesResponseVariant2 != null)
{
return listVoicesResponseVariant2(ListVoicesResponseVariant2!);
return listVoicesResponseVariant2(__value1);
}

return default(TResult);
Expand All @@ -180,13 +180,13 @@ public void Match(
Validate();
}

if (IsListVoicesResponseVariant1)
if (ListVoicesResponseVariant1 is { } __value0)
{
listVoicesResponseVariant1?.Invoke(ListVoicesResponseVariant1!);
listVoicesResponseVariant1?.Invoke(__value0);
}
else if (IsListVoicesResponseVariant2)
else if (ListVoicesResponseVariant2 is { } __value1)
{
listVoicesResponseVariant2?.Invoke(ListVoicesResponseVariant2!);
listVoicesResponseVariant2?.Invoke(__value1);
}
}

Expand All @@ -203,13 +203,13 @@ public void Switch(
Validate();
}

if (IsListVoicesResponseVariant1)
if (ListVoicesResponseVariant1 is { } __value0)
{
listVoicesResponseVariant1?.Invoke(ListVoicesResponseVariant1!);
listVoicesResponseVariant1?.Invoke(__value0);
}
else if (IsListVoicesResponseVariant2)
else if (ListVoicesResponseVariant2 is { } __value1)
{
listVoicesResponseVariant2?.Invoke(ListVoicesResponseVariant2!);
listVoicesResponseVariant2?.Invoke(__value1);
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/libs/PlayHT/Generated/PlayHT.Models.StreamSpeechRequest.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public bool TryPickCreate(
/// <summary>
///
/// </summary>
public global::PlayHT.CreateSpeechRequest PickCreate() => IsCreate
? Create!
public global::PlayHT.CreateSpeechRequest PickCreate() => Create is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'Create' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -79,8 +79,8 @@ public bool TryPickStreamSpeechRequestVariant2(
/// <summary>
///
/// </summary>
public global::PlayHT.StreamSpeechRequestVariant2 PickStreamSpeechRequestVariant2() => IsStreamSpeechRequestVariant2
? StreamSpeechRequestVariant2!
public global::PlayHT.StreamSpeechRequestVariant2 PickStreamSpeechRequestVariant2() => StreamSpeechRequestVariant2 is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'StreamSpeechRequestVariant2' but the value was {ToString()}.");
/// <summary>
///
Expand Down Expand Up @@ -177,13 +177,13 @@ public bool Validate()
Validate();
}

if (IsCreate && create != null)
if (Create is { } __value0 && create != null)
{
return create(Create!);
return create(__value0);
}
else if (IsStreamSpeechRequestVariant2 && streamSpeechRequestVariant2 != null)
else if (StreamSpeechRequestVariant2 is { } __value1 && streamSpeechRequestVariant2 != null)
{
return streamSpeechRequestVariant2(StreamSpeechRequestVariant2!);
return streamSpeechRequestVariant2(__value1);
}

return default(TResult);
Expand All @@ -203,13 +203,13 @@ public void Match(
Validate();
}

if (IsCreate)
if (Create is { } __value0)
{
create?.Invoke(Create!);
create?.Invoke(__value0);
}
else if (IsStreamSpeechRequestVariant2)
else if (StreamSpeechRequestVariant2 is { } __value1)
{
streamSpeechRequestVariant2?.Invoke(StreamSpeechRequestVariant2!);
streamSpeechRequestVariant2?.Invoke(__value1);
}
}

Expand All @@ -226,13 +226,13 @@ public void Switch(
Validate();
}

if (IsCreate)
if (Create is { } __value0)
{
create?.Invoke(Create!);
create?.Invoke(__value0);
}
else if (IsStreamSpeechRequestVariant2)
else if (StreamSpeechRequestVariant2 is { } __value1)
{
streamSpeechRequestVariant2?.Invoke(StreamSpeechRequestVariant2!);
streamSpeechRequestVariant2?.Invoke(__value1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ partial void ProcessCreateSpeechResponseContent(
pathTemplate: "\"/api/v1/tts\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -222,7 +222,7 @@ partial void ProcessCreateSpeechResponseContent(
pathTemplate: "\"/api/v1/tts\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: __exception,
clientOptions: Options,
Expand Down Expand Up @@ -263,7 +263,7 @@ partial void ProcessCreateSpeechResponseContent(
pathTemplate: "\"/api/v1/tts\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -311,7 +311,7 @@ partial void ProcessCreateSpeechResponseContent(
pathTemplate: "\"/api/v1/tts\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand All @@ -333,7 +333,7 @@ partial void ProcessCreateSpeechResponseContent(
pathTemplate: "\"/api/v1/tts\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ partial void ProcessGetSpeechJobResponseContent(
PrepareGetSpeechJobRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
asyncTtsJobId: asyncTtsJobId!);
asyncTtsJobId: asyncTtsJobId);

return __httpRequest;
}
Expand All @@ -175,7 +175,7 @@ partial void ProcessGetSpeechJobResponseContent(
pathTemplate: "$\"/api/v1/tts/{asyncTtsJobId}\"",
httpMethod: "GET",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -209,7 +209,7 @@ partial void ProcessGetSpeechJobResponseContent(
pathTemplate: "$\"/api/v1/tts/{asyncTtsJobId}\"",
httpMethod: "GET",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: __exception,
clientOptions: Options,
Expand Down Expand Up @@ -250,7 +250,7 @@ partial void ProcessGetSpeechJobResponseContent(
pathTemplate: "$\"/api/v1/tts/{asyncTtsJobId}\"",
httpMethod: "GET",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -298,7 +298,7 @@ partial void ProcessGetSpeechJobResponseContent(
pathTemplate: "$\"/api/v1/tts/{asyncTtsJobId}\"",
httpMethod: "GET",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand All @@ -320,7 +320,7 @@ partial void ProcessGetSpeechJobResponseContent(
pathTemplate: "$\"/api/v1/tts/{asyncTtsJobId}\"",
httpMethod: "GET",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down
Loading
Loading