Skip to content

Commit 4318aac

Browse files
author
github-actions[bot]
committed
feat: Updated OpenAPI spec
1 parent 3215aa8 commit 4318aac

File tree

41 files changed

+3586
-746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3586
-746
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#nullable enable
2+
3+
namespace ElevenLabs
4+
{
5+
public sealed partial class BatchCallResponse
6+
{
7+
/// <summary>
8+
/// Serializes the current instance to a JSON string using the provided JsonSerializerContext.
9+
/// </summary>
10+
public string ToJson(
11+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
12+
{
13+
return global::System.Text.Json.JsonSerializer.Serialize(
14+
this,
15+
this.GetType(),
16+
jsonSerializerContext);
17+
}
18+
19+
/// <summary>
20+
/// Serializes the current instance to a JSON string using the provided JsonSerializerOptions.
21+
/// </summary>
22+
#if NET8_0_OR_GREATER
23+
[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.")]
24+
[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.")]
25+
#endif
26+
public string ToJson(
27+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
28+
{
29+
return global::System.Text.Json.JsonSerializer.Serialize(
30+
this,
31+
jsonSerializerOptions);
32+
}
33+
34+
/// <summary>
35+
/// Deserializes a JSON string using the provided JsonSerializerContext.
36+
/// </summary>
37+
public static global::ElevenLabs.BatchCallResponse? FromJson(
38+
string json,
39+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
40+
{
41+
return global::System.Text.Json.JsonSerializer.Deserialize(
42+
json,
43+
typeof(global::ElevenLabs.BatchCallResponse),
44+
jsonSerializerContext) as global::ElevenLabs.BatchCallResponse;
45+
}
46+
47+
/// <summary>
48+
/// Deserializes a JSON string using the provided JsonSerializerOptions.
49+
/// </summary>
50+
#if NET8_0_OR_GREATER
51+
[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.")]
52+
[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.")]
53+
#endif
54+
public static global::ElevenLabs.BatchCallResponse? FromJson(
55+
string json,
56+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
57+
{
58+
return global::System.Text.Json.JsonSerializer.Deserialize<global::ElevenLabs.BatchCallResponse>(
59+
json,
60+
jsonSerializerOptions);
61+
}
62+
63+
/// <summary>
64+
/// Deserializes a JSON stream using the provided JsonSerializerContext.
65+
/// </summary>
66+
public static async global::System.Threading.Tasks.ValueTask<global::ElevenLabs.BatchCallResponse?> FromJsonStreamAsync(
67+
global::System.IO.Stream jsonStream,
68+
global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext)
69+
{
70+
return (await global::System.Text.Json.JsonSerializer.DeserializeAsync(
71+
jsonStream,
72+
typeof(global::ElevenLabs.BatchCallResponse),
73+
jsonSerializerContext).ConfigureAwait(false)) as global::ElevenLabs.BatchCallResponse;
74+
}
75+
76+
/// <summary>
77+
/// Deserializes a JSON stream using the provided JsonSerializerOptions.
78+
/// </summary>
79+
#if NET8_0_OR_GREATER
80+
[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.")]
81+
[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.")]
82+
#endif
83+
public static global::System.Threading.Tasks.ValueTask<global::ElevenLabs.BatchCallResponse?> FromJsonStreamAsync(
84+
global::System.IO.Stream jsonStream,
85+
global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null)
86+
{
87+
return global::System.Text.Json.JsonSerializer.DeserializeAsync<global::ElevenLabs.BatchCallResponse?>(
88+
jsonStream,
89+
jsonSerializerOptions);
90+
}
91+
}
92+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
2+
#nullable enable
3+
4+
namespace ElevenLabs
5+
{
6+
/// <summary>
7+
///
8+
/// </summary>
9+
public sealed partial class BatchCallResponse
10+
{
11+
/// <summary>
12+
///
13+
/// </summary>
14+
[global::System.Text.Json.Serialization.JsonPropertyName("batch_id")]
15+
[global::System.Text.Json.Serialization.JsonRequired]
16+
public required string BatchId { get; set; }
17+
18+
/// <summary>
19+
///
20+
/// </summary>
21+
[global::System.Text.Json.Serialization.JsonPropertyName("phone_number_id")]
22+
[global::System.Text.Json.Serialization.JsonRequired]
23+
public required string PhoneNumberId { get; set; }
24+
25+
/// <summary>
26+
///
27+
/// </summary>
28+
[global::System.Text.Json.Serialization.JsonPropertyName("name")]
29+
[global::System.Text.Json.Serialization.JsonRequired]
30+
public required string Name { get; set; }
31+
32+
/// <summary>
33+
///
34+
/// </summary>
35+
[global::System.Text.Json.Serialization.JsonPropertyName("agent_id")]
36+
[global::System.Text.Json.Serialization.JsonRequired]
37+
public required string AgentId { get; set; }
38+
39+
/// <summary>
40+
///
41+
/// </summary>
42+
[global::System.Text.Json.Serialization.JsonPropertyName("created_at_unix")]
43+
[global::System.Text.Json.Serialization.JsonRequired]
44+
public required int CreatedAtUnix { get; set; }
45+
46+
/// <summary>
47+
///
48+
/// </summary>
49+
[global::System.Text.Json.Serialization.JsonPropertyName("scheduled_time_unix")]
50+
[global::System.Text.Json.Serialization.JsonRequired]
51+
public required int ScheduledTimeUnix { get; set; }
52+
53+
/// <summary>
54+
///
55+
/// </summary>
56+
[global::System.Text.Json.Serialization.JsonPropertyName("total_calls_dispatched")]
57+
[global::System.Text.Json.Serialization.JsonRequired]
58+
public required int TotalCallsDispatched { get; set; }
59+
60+
/// <summary>
61+
///
62+
/// </summary>
63+
[global::System.Text.Json.Serialization.JsonPropertyName("total_calls_scheduled")]
64+
[global::System.Text.Json.Serialization.JsonRequired]
65+
public required int TotalCallsScheduled { get; set; }
66+
67+
/// <summary>
68+
///
69+
/// </summary>
70+
[global::System.Text.Json.Serialization.JsonPropertyName("last_updated_at_unix")]
71+
[global::System.Text.Json.Serialization.JsonRequired]
72+
public required int LastUpdatedAtUnix { get; set; }
73+
74+
/// <summary>
75+
///
76+
/// </summary>
77+
[global::System.Text.Json.Serialization.JsonPropertyName("status")]
78+
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::ElevenLabs.JsonConverters.BatchCallStatusJsonConverter))]
79+
[global::System.Text.Json.Serialization.JsonRequired]
80+
public required global::ElevenLabs.BatchCallStatus Status { get; set; }
81+
82+
/// <summary>
83+
///
84+
/// </summary>
85+
[global::System.Text.Json.Serialization.JsonPropertyName("agent_name")]
86+
[global::System.Text.Json.Serialization.JsonRequired]
87+
public required string AgentName { get; set; }
88+
89+
/// <summary>
90+
/// Additional properties that are not explicitly defined in the schema
91+
/// </summary>
92+
[global::System.Text.Json.Serialization.JsonExtensionData]
93+
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>();
94+
95+
/// <summary>
96+
/// Initializes a new instance of the <see cref="BatchCallResponse" /> class.
97+
/// </summary>
98+
/// <param name="batchId"></param>
99+
/// <param name="phoneNumberId"></param>
100+
/// <param name="name"></param>
101+
/// <param name="agentId"></param>
102+
/// <param name="createdAtUnix"></param>
103+
/// <param name="scheduledTimeUnix"></param>
104+
/// <param name="totalCallsDispatched"></param>
105+
/// <param name="totalCallsScheduled"></param>
106+
/// <param name="lastUpdatedAtUnix"></param>
107+
/// <param name="status"></param>
108+
/// <param name="agentName"></param>
109+
#if NET7_0_OR_GREATER
110+
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
111+
#endif
112+
public BatchCallResponse(
113+
string batchId,
114+
string phoneNumberId,
115+
string name,
116+
string agentId,
117+
int createdAtUnix,
118+
int scheduledTimeUnix,
119+
int totalCallsDispatched,
120+
int totalCallsScheduled,
121+
int lastUpdatedAtUnix,
122+
global::ElevenLabs.BatchCallStatus status,
123+
string agentName)
124+
{
125+
this.BatchId = batchId ?? throw new global::System.ArgumentNullException(nameof(batchId));
126+
this.PhoneNumberId = phoneNumberId ?? throw new global::System.ArgumentNullException(nameof(phoneNumberId));
127+
this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name));
128+
this.AgentId = agentId ?? throw new global::System.ArgumentNullException(nameof(agentId));
129+
this.CreatedAtUnix = createdAtUnix;
130+
this.ScheduledTimeUnix = scheduledTimeUnix;
131+
this.TotalCallsDispatched = totalCallsDispatched;
132+
this.TotalCallsScheduled = totalCallsScheduled;
133+
this.LastUpdatedAtUnix = lastUpdatedAtUnix;
134+
this.Status = status;
135+
this.AgentName = agentName ?? throw new global::System.ArgumentNullException(nameof(agentName));
136+
}
137+
138+
/// <summary>
139+
/// Initializes a new instance of the <see cref="BatchCallResponse" /> class.
140+
/// </summary>
141+
public BatchCallResponse()
142+
{
143+
}
144+
}
145+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
#nullable enable
3+
4+
namespace ElevenLabs
5+
{
6+
/// <summary>
7+
///
8+
/// </summary>
9+
public enum BatchCallStatus
10+
{
11+
/// <summary>
12+
///
13+
/// </summary>
14+
Pending,
15+
/// <summary>
16+
///
17+
/// </summary>
18+
InProgress,
19+
/// <summary>
20+
///
21+
/// </summary>
22+
Completed,
23+
/// <summary>
24+
///
25+
/// </summary>
26+
Failed,
27+
/// <summary>
28+
///
29+
/// </summary>
30+
Cancelled,
31+
}
32+
33+
/// <summary>
34+
/// Enum extensions to do fast conversions without the reflection.
35+
/// </summary>
36+
public static class BatchCallStatusExtensions
37+
{
38+
/// <summary>
39+
/// Converts an enum to a string.
40+
/// </summary>
41+
public static string ToValueString(this BatchCallStatus value)
42+
{
43+
return value switch
44+
{
45+
BatchCallStatus.Pending => "pending",
46+
BatchCallStatus.InProgress => "in_progress",
47+
BatchCallStatus.Completed => "completed",
48+
BatchCallStatus.Failed => "failed",
49+
BatchCallStatus.Cancelled => "cancelled",
50+
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
51+
};
52+
}
53+
/// <summary>
54+
/// Converts an string to a enum.
55+
/// </summary>
56+
public static BatchCallStatus? ToEnum(string value)
57+
{
58+
return value switch
59+
{
60+
"pending" => BatchCallStatus.Pending,
61+
"in_progress" => BatchCallStatus.InProgress,
62+
"completed" => BatchCallStatus.Completed,
63+
"failed" => BatchCallStatus.Failed,
64+
"cancelled" => BatchCallStatus.Cancelled,
65+
_ => null,
66+
};
67+
}
68+
}
69+
}

0 commit comments

Comments
 (0)