Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Dec 26, 2024
1 parent 0d0011d commit 4911aaf
Show file tree
Hide file tree
Showing 448 changed files with 10,008 additions and 1,150 deletions.
253 changes: 214 additions & 39 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,209 @@ await client.Squads.UpdateAsync(
</dl>


</dd>
</dl>
</details>

## KnowledgeBases
<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">ListAsync</a>(KnowledgeBasesListRequest { ... }) -> IEnumerable<object></code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```csharp
await client.KnowledgeBases.ListAsync(new KnowledgeBasesListRequest());
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `KnowledgeBasesListRequest`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">CreateAsync</a>(object { ... }) -> object</code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```csharp
await client.KnowledgeBases.CreateAsync(
new CreateCustomKnowledgeBaseDto { Server = new Server { Url = "url" } }
);
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `object`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">GetAsync</a>(id) -> object</code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```csharp
await client.KnowledgeBases.GetAsync("id");
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**id:** `string`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">DeleteAsync</a>(id) -> object</code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```csharp
await client.KnowledgeBases.DeleteAsync("id");
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**id:** `string`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.KnowledgeBases.<a href="/src/Vapi.Net/KnowledgeBases/KnowledgeBasesClient.cs">UpdateAsync</a>(id) -> object</code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```csharp
await client.KnowledgeBases.UpdateAsync("id");
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**id:** `string`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -1103,7 +1306,14 @@ await client.Tools.ListAsync(new ToolsListRequest());
<dd>

```csharp
await client.Tools.CreateAsync(new CreateOutputToolDto { Async = false });
await client.Tools.CreateAsync(
new CreateTextEditorToolDto
{
Async = false,
SubType = "text_editor_20241022",
Name = "str_replace_editor",
}
);
```
</dd>
</dl>
Expand Down Expand Up @@ -1413,7 +1623,7 @@ await client.Files.UpdateAsync("id", new UpdateFileDto());
</details>

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

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

```csharp
await client.Analytics.GetAsync(
new AnalyticsQueryDto
{
Queries = new List<AnalyticsQuery>()
{
new AnalyticsQuery
{
Table = "call",
Name = "name",
Operations = new List<AnalyticsOperation>()
{
new AnalyticsOperation
{
Operation = AnalyticsOperationOperation.Sum,
Column = AnalyticsOperationColumn.Id,
},
},
},
},
}
);
await client.Analytics.GetAsync();
```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**request:** `AnalyticsQueryDto`

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>

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

Expand Down
61 changes: 61 additions & 0 deletions src/Vapi.Net.Test/Core/EnumSerializerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System;
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
using NUnit.Framework;
using Vapi.Net.Core;

namespace Vapi.Net.Test.Core
{
[TestFixture]
public class StringEnumSerializerTests
{
private static readonly JsonSerializerOptions JsonOptions = new() { WriteIndented = true };

private const DummyEnum KnownEnumValue2 = DummyEnum.KnownValue2;
private const string KnownEnumValue2String = "known_value2";

private static readonly string JsonWithKnownEnum2 = $$"""
{
"enum_property": "{{KnownEnumValue2String}}"
}
""";

[Test]
public void ShouldParseKnownEnumValue2()
{
var obj = JsonSerializer.Deserialize<DummyObject>(JsonWithKnownEnum2, JsonOptions);
Assert.That(obj, Is.Not.Null);
Assert.That(obj.EnumProperty, Is.EqualTo(KnownEnumValue2));
}

[Test]
public void ShouldSerializeKnownEnumValue2()
{
var json = JsonSerializer.SerializeToElement(
new DummyObject { EnumProperty = KnownEnumValue2 },
JsonOptions
);
TestContext.Out.WriteLine("Serialized JSON: \n" + json);
var enumString = json.GetProperty("enum_property").GetString();
Assert.That(enumString, Is.Not.Null);
Assert.That(enumString, Is.EqualTo(KnownEnumValue2String));
}
}

public class DummyObject
{
[JsonPropertyName("enum_property")]
public DummyEnum EnumProperty { get; set; }
}

[JsonConverter(typeof(EnumSerializer<DummyEnum>))]
public enum DummyEnum
{
[EnumMember(Value = "known_value1")]
KnownValue1,

[EnumMember(Value = "known_value2")]
KnownValue2,
}
}
Loading

0 comments on commit 4911aaf

Please sign in to comment.