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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,43 @@ partial void ProcessAssistantControllerRemoveResponseContent(
retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
//
if ((int)__response.StatusCode == 409)
{
string? __content_409 = null;
global::System.Exception? __exception_409 = null;
global::Vapi.AssistantPinnedConflictResponseDTO? __value_409 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_409 = global::Vapi.AssistantPinnedConflictResponseDTO.FromJson(__content_409, JsonSerializerContext);
}
else
{
__content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_409 = global::Vapi.AssistantPinnedConflictResponseDTO.FromJson(__content_409, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_409 = __ex;
}


throw global::Vapi.ApiException<global::Vapi.AssistantPinnedConflictResponseDTO>.Create(
statusCode: __response.StatusCode,
message: __content_409 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_409,
responseBody: __content_409,
responseObject: __value_409,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}

if (__effectiveReadResponseAsString)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ partial void ProcessAssistantControllerUpdateResponseContent(
bool? modelOutputInMessagesEnabled = default,
global::System.Collections.Generic.IList<global::Vapi.TransportConfigurationTwilio>? transportConfigurations = default,
global::Vapi.LangfuseObservabilityPlan? observabilityPlan = default,
global::System.Collections.Generic.IList<global::Vapi.CredentialsItem5>? credentials = default,
global::System.Collections.Generic.IList<global::Vapi.CredentialsItem9>? credentials = default,
global::System.Collections.Generic.IList<global::Vapi.OneOf<global::Vapi.CallHookCallEnding, global::Vapi.CallHookAssistantSpeechInterrupted, global::Vapi.CallHookCustomerSpeechInterrupted, global::Vapi.CallHookCustomerSpeechTimeout, global::Vapi.SessionCreatedHook>>? hooks = default,
string? name = default,
string? voicemailMessage = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,10 @@ partial void ProcessCallControllerCreateResponseContent(
/// <summary>
/// Create Call
/// </summary>
/// <param name="assistantVersion">
/// This is the assistant version to use for this call. Supported only with<br/>
/// direct `assistantId`. Omit to follow the latest version.
/// </param>
/// <param name="transport">
/// This is the transport of the call.
/// </param>
Expand Down Expand Up @@ -519,6 +523,7 @@ partial void ProcessCallControllerCreateResponseContent(
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::Vapi.OneOf<global::Vapi.Call, global::Vapi.CallBatchResponse>> CallControllerCreateAsync(
string? assistantVersion = default,
global::Vapi.OneOf<global::Vapi.VapiWebsocketTransport, global::Vapi.VonageTransport, global::Vapi.TwilioTransport, global::Vapi.VapiSipTransport, global::Vapi.TelnyxTransport, global::Vapi.VapiWebCallTransport>? transport = default,
global::System.Collections.Generic.IList<global::Vapi.CreateCustomerDTO>? customers = default,
string? name = default,
Expand All @@ -541,6 +546,7 @@ partial void ProcessCallControllerCreateResponseContent(
{
var __request = new global::Vapi.CreateCallDTO
{
AssistantVersion = assistantVersion,
Transport = transport,
Customers = customers,
Name = name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public partial interface IAssistantsClient
bool? modelOutputInMessagesEnabled = default,
global::System.Collections.Generic.IList<global::Vapi.TransportConfigurationTwilio>? transportConfigurations = default,
global::Vapi.LangfuseObservabilityPlan? observabilityPlan = default,
global::System.Collections.Generic.IList<global::Vapi.CredentialsItem5>? credentials = default,
global::System.Collections.Generic.IList<global::Vapi.CredentialsItem9>? credentials = default,
global::System.Collections.Generic.IList<global::Vapi.OneOf<global::Vapi.CallHookCallEnding, global::Vapi.CallHookAssistantSpeechInterrupted, global::Vapi.CallHookCustomerSpeechInterrupted, global::Vapi.CallHookCustomerSpeechTimeout, global::Vapi.SessionCreatedHook>>? hooks = default,
string? name = default,
string? voicemailMessage = default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public partial interface ICallsClient
/// <summary>
/// Create Call
/// </summary>
/// <param name="assistantVersion">
/// This is the assistant version to use for this call. Supported only with<br/>
/// direct `assistantId`. Omit to follow the latest version.
/// </param>
/// <param name="transport">
/// This is the transport of the call.
/// </param>
Expand Down Expand Up @@ -116,6 +120,7 @@ public partial interface ICallsClient
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::Vapi.OneOf<global::Vapi.Call, global::Vapi.CallBatchResponse>> CallControllerCreateAsync(
string? assistantVersion = default,
global::Vapi.OneOf<global::Vapi.VapiWebsocketTransport, global::Vapi.VonageTransport, global::Vapi.TwilioTransport, global::Vapi.VapiSipTransport, global::Vapi.TelnyxTransport, global::Vapi.VapiWebCallTransport>? transport = default,
global::System.Collections.Generic.IList<global::Vapi.CreateCustomerDTO>? customers = default,
string? name = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Vapi.JsonConverters
{
/// <inheritdoc />
public sealed class AssistantDraftBackgroundSoundJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vapi.AssistantDraftBackgroundSound>
{
/// <inheritdoc />
public override global::Vapi.AssistantDraftBackgroundSound Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vapi.AssistantDraftBackgroundSoundExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vapi.AssistantDraftBackgroundSound)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vapi.AssistantDraftBackgroundSound);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vapi.AssistantDraftBackgroundSound value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Vapi.AssistantDraftBackgroundSoundExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Vapi.JsonConverters
{
/// <inheritdoc />
public sealed class AssistantDraftBackgroundSoundNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vapi.AssistantDraftBackgroundSound?>
{
/// <inheritdoc />
public override global::Vapi.AssistantDraftBackgroundSound? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vapi.AssistantDraftBackgroundSoundExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vapi.AssistantDraftBackgroundSound)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vapi.AssistantDraftBackgroundSound?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vapi.AssistantDraftBackgroundSound? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Vapi.AssistantDraftBackgroundSoundExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Vapi.JsonConverters
{
/// <inheritdoc />
public sealed class AssistantDraftClientMessageJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vapi.AssistantDraftClientMessage>
{
/// <inheritdoc />
public override global::Vapi.AssistantDraftClientMessage Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vapi.AssistantDraftClientMessageExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vapi.AssistantDraftClientMessage)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vapi.AssistantDraftClientMessage);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vapi.AssistantDraftClientMessage value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Vapi.AssistantDraftClientMessageExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace Vapi.JsonConverters
{
/// <inheritdoc />
public sealed class AssistantDraftClientMessageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vapi.AssistantDraftClientMessage?>
{
/// <inheritdoc />
public override global::Vapi.AssistantDraftClientMessage? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vapi.AssistantDraftClientMessageExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vapi.AssistantDraftClientMessage)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vapi.AssistantDraftClientMessage?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vapi.AssistantDraftClientMessage? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(global::Vapi.AssistantDraftClientMessageExtensions.ToValueString(value.Value));
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Vapi.JsonConverters
{
/// <inheritdoc />
public sealed class AssistantDraftCredentialDiscriminatorProviderJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Vapi.AssistantDraftCredentialDiscriminatorProvider>
{
/// <inheritdoc />
public override global::Vapi.AssistantDraftCredentialDiscriminatorProvider Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Vapi.AssistantDraftCredentialDiscriminatorProviderExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Vapi.AssistantDraftCredentialDiscriminatorProvider)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Vapi.AssistantDraftCredentialDiscriminatorProvider);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Vapi.AssistantDraftCredentialDiscriminatorProvider value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Vapi.AssistantDraftCredentialDiscriminatorProviderExtensions.ToValueString(value));
}
}
}
Loading