Skip to content

Commit 4911aaf

Browse files
committed
Release 0.2.0
1 parent 0d0011d commit 4911aaf

File tree

448 files changed

+10008
-1150
lines changed

Some content is hidden

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

448 files changed

+10008
-1150
lines changed

reference.md

+214-39
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,209 @@ await client.Squads.UpdateAsync(
836836
</dl>
837837

838838

839+
</dd>
840+
</dl>
841+
</details>
842+
843+
## KnowledgeBases
844+
<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">ListAsync</a>(KnowledgeBasesListRequest { ... }) -> IEnumerable<object></code></summary>
845+
<dl>
846+
<dd>
847+
848+
#### 🔌 Usage
849+
850+
<dl>
851+
<dd>
852+
853+
<dl>
854+
<dd>
855+
856+
```csharp
857+
await client.KnowledgeBases.ListAsync(new KnowledgeBasesListRequest());
858+
```
859+
</dd>
860+
</dl>
861+
</dd>
862+
</dl>
863+
864+
#### ⚙️ Parameters
865+
866+
<dl>
867+
<dd>
868+
869+
<dl>
870+
<dd>
871+
872+
**request:** `KnowledgeBasesListRequest`
873+
874+
</dd>
875+
</dl>
876+
</dd>
877+
</dl>
878+
879+
880+
</dd>
881+
</dl>
882+
</details>
883+
884+
<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">CreateAsync</a>(object { ... }) -> object</code></summary>
885+
<dl>
886+
<dd>
887+
888+
#### 🔌 Usage
889+
890+
<dl>
891+
<dd>
892+
893+
<dl>
894+
<dd>
895+
896+
```csharp
897+
await client.KnowledgeBases.CreateAsync(
898+
new CreateCustomKnowledgeBaseDto { Server = new Server { Url = "url" } }
899+
);
900+
```
901+
</dd>
902+
</dl>
903+
</dd>
904+
</dl>
905+
906+
#### ⚙️ Parameters
907+
908+
<dl>
909+
<dd>
910+
911+
<dl>
912+
<dd>
913+
914+
**request:** `object`
915+
916+
</dd>
917+
</dl>
918+
</dd>
919+
</dl>
920+
921+
922+
</dd>
923+
</dl>
924+
</details>
925+
926+
<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">GetAsync</a>(id) -> object</code></summary>
927+
<dl>
928+
<dd>
929+
930+
#### 🔌 Usage
931+
932+
<dl>
933+
<dd>
934+
935+
<dl>
936+
<dd>
937+
938+
```csharp
939+
await client.KnowledgeBases.GetAsync("id");
940+
```
941+
</dd>
942+
</dl>
943+
</dd>
944+
</dl>
945+
946+
#### ⚙️ Parameters
947+
948+
<dl>
949+
<dd>
950+
951+
<dl>
952+
<dd>
953+
954+
**id:** `string`
955+
956+
</dd>
957+
</dl>
958+
</dd>
959+
</dl>
960+
961+
962+
</dd>
963+
</dl>
964+
</details>
965+
966+
<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">DeleteAsync</a>(id) -> object</code></summary>
967+
<dl>
968+
<dd>
969+
970+
#### 🔌 Usage
971+
972+
<dl>
973+
<dd>
974+
975+
<dl>
976+
<dd>
977+
978+
```csharp
979+
await client.KnowledgeBases.DeleteAsync("id");
980+
```
981+
</dd>
982+
</dl>
983+
</dd>
984+
</dl>
985+
986+
#### ⚙️ Parameters
987+
988+
<dl>
989+
<dd>
990+
991+
<dl>
992+
<dd>
993+
994+
**id:** `string`
995+
996+
</dd>
997+
</dl>
998+
</dd>
999+
</dl>
1000+
1001+
1002+
</dd>
1003+
</dl>
1004+
</details>
1005+
1006+
<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">UpdateAsync</a>(id) -> object</code></summary>
1007+
<dl>
1008+
<dd>
1009+
1010+
#### 🔌 Usage
1011+
1012+
<dl>
1013+
<dd>
1014+
1015+
<dl>
1016+
<dd>
1017+
1018+
```csharp
1019+
await client.KnowledgeBases.UpdateAsync("id");
1020+
```
1021+
</dd>
1022+
</dl>
1023+
</dd>
1024+
</dl>
1025+
1026+
#### ⚙️ Parameters
1027+
1028+
<dl>
1029+
<dd>
1030+
1031+
<dl>
1032+
<dd>
1033+
1034+
**id:** `string`
1035+
1036+
</dd>
1037+
</dl>
1038+
</dd>
1039+
</dl>
1040+
1041+
8391042
</dd>
8401043
</dl>
8411044
</details>
@@ -1103,7 +1306,14 @@ await client.Tools.ListAsync(new ToolsListRequest());
11031306
<dd>
11041307

11051308
```csharp
1106-
await client.Tools.CreateAsync(new CreateOutputToolDto { Async = false });
1309+
await client.Tools.CreateAsync(
1310+
new CreateTextEditorToolDto
1311+
{
1312+
Async = false,
1313+
SubType = "text_editor_20241022",
1314+
Name = "str_replace_editor",
1315+
}
1316+
);
11071317
```
11081318
</dd>
11091319
</dl>
@@ -1413,7 +1623,7 @@ await client.Files.UpdateAsync("id", new UpdateFileDto());
14131623
</details>
14141624

14151625
## Analytics
1416-
<details><summary><code>client.Analytics.<a href="/src/Vapi.Net/Analytics/AnalyticsClient.cs">GetAsync</a>(AnalyticsQueryDto { ... }) -> IEnumerable<AnalyticsQueryResult></code></summary>
1626+
<details><summary><code>client.Analytics.<a href="/src/Vapi.Net/Analytics/AnalyticsClient.cs">GetAsync</a>()</code></summary>
14171627
<dl>
14181628
<dd>
14191629

@@ -1426,55 +1636,20 @@ await client.Files.UpdateAsync("id", new UpdateFileDto());
14261636
<dd>
14271637

14281638
```csharp
1429-
await client.Analytics.GetAsync(
1430-
new AnalyticsQueryDto
1431-
{
1432-
Queries = new List<AnalyticsQuery>()
1433-
{
1434-
new AnalyticsQuery
1435-
{
1436-
Table = "call",
1437-
Name = "name",
1438-
Operations = new List<AnalyticsOperation>()
1439-
{
1440-
new AnalyticsOperation
1441-
{
1442-
Operation = AnalyticsOperationOperation.Sum,
1443-
Column = AnalyticsOperationColumn.Id,
1444-
},
1445-
},
1446-
},
1447-
},
1448-
}
1449-
);
1639+
await client.Analytics.GetAsync();
14501640
```
14511641
</dd>
14521642
</dl>
14531643
</dd>
14541644
</dl>
14551645

1456-
#### ⚙️ Parameters
1457-
1458-
<dl>
1459-
<dd>
1460-
1461-
<dl>
1462-
<dd>
1463-
1464-
**request:** `AnalyticsQueryDto`
1465-
1466-
</dd>
1467-
</dl>
1468-
</dd>
1469-
</dl>
1470-
14711646

14721647
</dd>
14731648
</dl>
14741649
</details>
14751650

14761651
## Logs
1477-
<details><summary><code>client.Logs.<a href="/src/Vapi.Net/Logs/LogsClient.cs">GetAsync</a>(LogsGetRequest { ... }) -> LogsPaginatedResponse</code></summary>
1652+
<details><summary><code>client.Logs.<a href="/src/Vapi.Net/Logs/LogsClient.cs">GetAsync</a>(LogsGetRequest { ... }) -> Pager<Log></code></summary>
14781653
<dl>
14791654
<dd>
14801655

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
using System;
2+
using System.Runtime.Serialization;
3+
using System.Text.Json;
4+
using System.Text.Json.Serialization;
5+
using NUnit.Framework;
6+
using Vapi.Net.Core;
7+
8+
namespace Vapi.Net.Test.Core
9+
{
10+
[TestFixture]
11+
public class StringEnumSerializerTests
12+
{
13+
private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };
14+
15+
private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2;
16+
private const string KnownEnumValue2String = "known_value2";
17+
18+
private static readonly string JsonWithKnownEnum2 = $$"""
19+
{
20+
"enum_property": "{{KnownEnumValue2String}}"
21+
}
22+
""";
23+
24+
[Test]
25+
public void ShouldParseKnownEnumValue2()
26+
{
27+
var obj = JsonSerializer.Deserialize<DummyObject>(JsonWithKnownEnum2, JsonOptions);
28+
Assert.That(obj, Is.Not.Null);
29+
Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2));
30+
}
31+
32+
[Test]
33+
public void ShouldSerializeKnownEnumValue2()
34+
{
35+
var json = JsonSerializer.SerializeToElement(
36+
new DummyObject { EnumProperty = KnownEnumValue2 },
37+
JsonOptions
38+
);
39+
TestContext.Out.WriteLine("Serialized JSON: \n" + json);
40+
var enumString = json.GetProperty("enum_property").GetString();
41+
Assert.That(enumString, Is.Not.Null);
42+
Assert.That(enumString, Is.EqualTo(KnownEnumValue2String));
43+
}
44+
}
45+
46+
public class DummyObject
47+
{
48+
[JsonPropertyName("enum_property")]
49+
public DummyEnum EnumProperty { get; set; }
50+
}
51+
52+
[JsonConverter(typeof(EnumSerializer<DummyEnum>))]
53+
public enum DummyEnum
54+
{
55+
[EnumMember(Value = "known_value1")]
56+
KnownValue1,
57+
58+
[EnumMember(Value = "known_value2")]
59+
KnownValue2,
60+
}
61+
}

0 commit comments

Comments
 (0)