Skip to content

Commit

Permalink
feat: Updated OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 5, 2024
1 parent 0ed72fa commit dfeeef4
Show file tree
Hide file tree
Showing 8 changed files with 304 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/libs/Ultravox/Generated/Ultravox.Models.Call.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public sealed partial class Call
/// * `unjoined` - Client never joined<br/>
/// * `hangup` - Client hung up<br/>
/// * `timeout` - Call timed out<br/>
/// * `connection_error` - Connection error<br/>
/// Included only in responses
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("endReason")]
Expand Down Expand Up @@ -173,6 +174,7 @@ public sealed partial class Call
/// * `unjoined` - Client never joined<br/>
/// * `hangup` - Client hung up<br/>
/// * `timeout` - Call timed out<br/>
/// * `connection_error` - Connection error<br/>
/// Included only in responses
/// </param>
/// <param name="firstSpeaker">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ namespace Ultravox
/// <summary>
/// * `unjoined` - Client never joined<br/>
/// * `hangup` - Client hung up<br/>
/// * `timeout` - Call timed out
/// * `timeout` - Call timed out<br/>
/// * `connection_error` - Connection error
/// </summary>
public enum EndReasonEnum
{
Expand All @@ -22,6 +23,10 @@ public enum EndReasonEnum
///
/// </summary>
Timeout,
/// <summary>
///
/// </summary>
ConnectionError,
}

/// <summary>
Expand All @@ -39,6 +44,7 @@ public static string ToValueString(this EndReasonEnum value)
EndReasonEnum.Unjoined => "unjoined",
EndReasonEnum.Hangup => "hangup",
EndReasonEnum.Timeout => "timeout",
EndReasonEnum.ConnectionError => "connection_error",
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
};
}
Expand All @@ -52,6 +58,7 @@ public static string ToValueString(this EndReasonEnum value)
"unjoined" => EndReasonEnum.Unjoined,
"hangup" => EndReasonEnum.Hangup,
"timeout" => EndReasonEnum.Timeout,
"connection_error" => EndReasonEnum.ConnectionError,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ public sealed partial class UltravoxV1CallMedium
[global::System.Text.Json.Serialization.JsonPropertyName("serverWebSocket")]
public global::Ultravox.UltravoxV1CallMediumWebSocketMedium? ServerWebSocket { get; set; }

/// <summary>
/// The call will use Telnyx's media streaming protocol.<br/>
/// Once you have a join URL from starting a call, include it in your<br/>
/// TexML like so:<br/>
/// &lt;Connect&gt;&lt;Stream url=${your-join-url} /&gt;&lt;/Connect&gt;<br/>
/// This works for both inbound and outbound calls.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("telnyx")]
public object? Telnyx { get; set; }

/// <summary>
/// The call will use Plivo's AudioStreams protocol.<br/>
/// Once you have a join URL from starting a call, include it in your<br/>
/// Plivo XML like so:<br/>
/// &lt;Stream keepCallAlive="true" bidirectional="true" contentType="audio/x-mulaw;rate=8000"&gt;${your-join-url}&lt;/Stream&gt;<br/>
/// This works for both inbound and outbound calls.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("plivo")]
public object? Plivo { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand All @@ -63,15 +83,33 @@ public sealed partial class UltravoxV1CallMedium
/// server-to-server connection. This option provides a simple way to connect your own server to<br/>
/// an Ultravox inference instance.
/// </param>
/// <param name="telnyx">
/// The call will use Telnyx's media streaming protocol.<br/>
/// Once you have a join URL from starting a call, include it in your<br/>
/// TexML like so:<br/>
/// &lt;Connect&gt;&lt;Stream url=${your-join-url} /&gt;&lt;/Connect&gt;<br/>
/// This works for both inbound and outbound calls.
/// </param>
/// <param name="plivo">
/// The call will use Plivo's AudioStreams protocol.<br/>
/// Once you have a join URL from starting a call, include it in your<br/>
/// Plivo XML like so:<br/>
/// &lt;Stream keepCallAlive="true" bidirectional="true" contentType="audio/x-mulaw;rate=8000"&gt;${your-join-url}&lt;/Stream&gt;<br/>
/// This works for both inbound and outbound calls.
/// </param>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public UltravoxV1CallMedium(
object? webRtc,
object? twilio,
global::Ultravox.UltravoxV1CallMediumWebSocketMedium? serverWebSocket)
global::Ultravox.UltravoxV1CallMediumWebSocketMedium? serverWebSocket,
object? telnyx,
object? plivo)
{
this.WebRtc = webRtc;
this.Twilio = twilio;
this.ServerWebSocket = serverWebSocket;
this.Telnyx = telnyx;
this.Plivo = plivo;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace Ultravox
{
public sealed partial class UltravoxV1CallMediumPlivoMedium
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::Ultravox.UltravoxV1CallMediumPlivoMedium? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Ultravox.UltravoxV1CallMediumPlivoMedium),
jsonSerializerContext) as global::Ultravox.UltravoxV1CallMediumPlivoMedium;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::Ultravox.UltravoxV1CallMediumPlivoMedium? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Ultravox.UltravoxV1CallMediumPlivoMedium>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Ultravox.UltravoxV1CallMediumPlivoMedium?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::Ultravox.UltravoxV1CallMediumPlivoMedium),
jsonSerializerContext).ConfigureAwait(false)) as global::Ultravox.UltravoxV1CallMediumPlivoMedium;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::Ultravox.UltravoxV1CallMediumPlivoMedium?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Ultravox.UltravoxV1CallMediumPlivoMedium?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

#nullable enable

namespace Ultravox
{
/// <summary>
/// Details for a Plivo call.
/// </summary>
public sealed partial class UltravoxV1CallMediumPlivoMedium
{

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();

/// <summary>
/// Initializes a new instance of the <see cref="UltravoxV1CallMediumPlivoMedium" /> class.
/// </summary>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public UltravoxV1CallMediumPlivoMedium(
)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#nullable enable

namespace Ultravox
{
public sealed partial class UltravoxV1CallMediumTelnyxMedium
{
/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
/// </summary>
public string ToJson(
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
this.GetType(),
jsonSerializerContext);
}

/// <summary>
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public string ToJson(
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Serialize(
this,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerContext.
/// </summary>
public static global::Ultravox.UltravoxV1CallMediumTelnyxMedium? FromJson(
string json,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return global::System.Text.Json.JsonSerializer.Deserialize(
json,
typeof(global::Ultravox.UltravoxV1CallMediumTelnyxMedium),
jsonSerializerContext) as global::Ultravox.UltravoxV1CallMediumTelnyxMedium;
}

/// <summary>
/// Deserializes a JSON string using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::Ultravox.UltravoxV1CallMediumTelnyxMedium? FromJson(
string json,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.Deserialize<global::Ultravox.UltravoxV1CallMediumTelnyxMedium>(
json,
jsonSerializerOptions);
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerContext.
/// </summary>
public static async global::System.Threading.Tasks.ValueTask<global::Ultravox.UltravoxV1CallMediumTelnyxMedium?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
{
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
jsonStream,
typeof(global::Ultravox.UltravoxV1CallMediumTelnyxMedium),
jsonSerializerContext).ConfigureAwait(false)) as global::Ultravox.UltravoxV1CallMediumTelnyxMedium;
}

/// <summary>
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
/// </summary>
#if NET8_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
[global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
#endif
public static global::System.Threading.Tasks.ValueTask<global::Ultravox.UltravoxV1CallMediumTelnyxMedium?> FromJsonStreamAsync(
global::System.IO.Stream jsonStream,
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
{
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::Ultravox.UltravoxV1CallMediumTelnyxMedium?>(
jsonStream,
jsonSerializerOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

#nullable enable

namespace Ultravox
{
/// <summary>
/// Details for a Telnyx call.
/// </summary>
public sealed partial class UltravoxV1CallMediumTelnyxMedium
{

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
[global::System.Text.Json.Serialization.JsonExtensionData]
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();

/// <summary>
/// Initializes a new instance of the <see cref="UltravoxV1CallMediumTelnyxMedium" /> class.
/// </summary>
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
public UltravoxV1CallMediumTelnyxMedium(
)
{
}
}
}
Loading

0 comments on commit dfeeef4

Please sign in to comment.