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
58 changes: 54 additions & 4 deletions src/libs/PlayHT/Generated/PlayHT.Models.ListVoicesResponse.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ namespace PlayHT
#endif
public bool IsListVoicesResponseVariant1 => ListVoicesResponseVariant1 != null;

/// <summary>
///
/// </summary>
public bool TryPickListVoicesResponseVariant1(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::System.Collections.Generic.IList<global::PlayHT.Voice>? value)
{
value = ListVoicesResponseVariant1;
return IsListVoicesResponseVariant1;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace PlayHT
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(ListVoicesResponseVariant2))]
#endif
public bool IsListVoicesResponseVariant2 => ListVoicesResponseVariant2 != null;

/// <summary>
///
/// </summary>
public bool TryPickListVoicesResponseVariant2(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::PlayHT.ListVoicesResponseVariant2? value)
{
value = ListVoicesResponseVariant2;
return IsListVoicesResponseVariant2;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -100,8 +126,8 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::System.Collections.Generic.IList<global::PlayHT.Voice>?, TResult>? listVoicesResponseVariant1 = null,
global::System.Func<global::PlayHT.ListVoicesResponseVariant2?, TResult>? listVoicesResponseVariant2 = null,
global::System.Func<global::System.Collections.Generic.IList<global::PlayHT.Voice>, TResult>? listVoicesResponseVariant1 = null,
global::System.Func<global::PlayHT.ListVoicesResponseVariant2, TResult>? listVoicesResponseVariant2 = null,
bool validate = true)
{
if (validate)
Expand All @@ -125,8 +151,32 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::System.Collections.Generic.IList<global::PlayHT.Voice>?>? listVoicesResponseVariant1 = null,
global::System.Action<global::PlayHT.ListVoicesResponseVariant2?>? listVoicesResponseVariant2 = null,
global::System.Action<global::System.Collections.Generic.IList<global::PlayHT.Voice>>? listVoicesResponseVariant1 = null,

global::System.Action<global::PlayHT.ListVoicesResponseVariant2>? listVoicesResponseVariant2 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

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

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::System.Collections.Generic.IList<global::PlayHT.Voice>>? listVoicesResponseVariant1 = null,
global::System.Action<global::PlayHT.ListVoicesResponseVariant2>? listVoicesResponseVariant2 = null,
bool validate = true)
{
if (validate)
Expand Down
58 changes: 54 additions & 4 deletions src/libs/PlayHT/Generated/PlayHT.Models.StreamSpeechRequest.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ namespace PlayHT
#endif
public bool IsCreate => Create != null;

/// <summary>
///
/// </summary>
public bool TryPickCreate(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::PlayHT.CreateSpeechRequest? value)
{
value = Create;
return IsCreate;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace PlayHT
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(StreamSpeechRequestVariant2))]
#endif
public bool IsStreamSpeechRequestVariant2 => StreamSpeechRequestVariant2 != null;

/// <summary>
///
/// </summary>
public bool TryPickStreamSpeechRequestVariant2(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::PlayHT.StreamSpeechRequestVariant2? value)
{
value = StreamSpeechRequestVariant2;
return IsStreamSpeechRequestVariant2;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -118,8 +144,8 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::PlayHT.CreateSpeechRequest?, TResult>? create = null,
global::System.Func<global::PlayHT.StreamSpeechRequestVariant2?, TResult>? streamSpeechRequestVariant2 = null,
global::System.Func<global::PlayHT.CreateSpeechRequest, TResult>? create = null,
global::System.Func<global::PlayHT.StreamSpeechRequestVariant2, TResult>? streamSpeechRequestVariant2 = null,
bool validate = true)
{
if (validate)
Expand All @@ -143,8 +169,32 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::PlayHT.CreateSpeechRequest?>? create = null,
global::System.Action<global::PlayHT.StreamSpeechRequestVariant2?>? streamSpeechRequestVariant2 = null,
global::System.Action<global::PlayHT.CreateSpeechRequest>? create = null,

global::System.Action<global::PlayHT.StreamSpeechRequestVariant2>? streamSpeechRequestVariant2 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

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

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::PlayHT.CreateSpeechRequest>? create = null,
global::System.Action<global::PlayHT.StreamSpeechRequestVariant2>? streamSpeechRequestVariant2 = null,
bool validate = true)
{
if (validate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ partial void Authorizing(
ref string apiKey);
partial void Authorized(
global::System.Net.Http.HttpClient client);

}
}