Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.2"
".": "0.1.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 138
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-86aec85be1021cea51f9fc0bb95248276c8b85e3ac0fd810490114599ed7cf00.yml
openapi_spec_hash: 6b119a3213e324f3826453deca57f10b
config_hash: 7fca08d9dae18513f5d7451cea11e34c
configured_endpoints: 183
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zavu/zavudev-fc96dae99e9649b4cfb99002b7dfee6480114b8dda4ff136541533c9c9069118.yml
openapi_spec_hash: 3c2c8da8c73cdd7e656b7f2c06cc01b4
config_hash: 261e1b852ca7f8364e4a283a3edd350a
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.1.0 (2026-08-31)

Full Changelog: [v0.0.2...v0.1.0](https://github.com/zavudev/sdk-csharp/compare/v0.0.2...v0.1.0)

### Features

* **api:** api update ([e5056d9](https://github.com/zavudev/sdk-csharp/commit/e5056d98cb153e995d446f6db6a2108c650b32f0))
* **api:** api update ([96ab7f3](https://github.com/zavudev/sdk-csharp/commit/96ab7f3c8699713449314334fb4fd6da77328e45))
* **api:** api update ([4e858c7](https://github.com/zavudev/sdk-csharp/commit/4e858c781f3fed4c097fd183e7100e7a2fb820f6))
* **api:** api update ([b4437bc](https://github.com/zavudev/sdk-csharp/commit/b4437bc578ddee38ed35c2b36bfd7c56668ac899))
* **api:** api update ([158b835](https://github.com/zavudev/sdk-csharp/commit/158b83539d3d2e5ff856370d135046f3c86d648f))
* **api:** api update ([ab63674](https://github.com/zavudev/sdk-csharp/commit/ab63674d56ece9623457bc26b3e7f7de61dc56af))
* **api:** api update ([075d0c2](https://github.com/zavudev/sdk-csharp/commit/075d0c247aee199ad08c180fa65925beb52b0f08))
* **api:** api update ([c89fc7b](https://github.com/zavudev/sdk-csharp/commit/c89fc7b716dc67adaeebc0389d47bee998137f05))
* **api:** api update ([47de211](https://github.com/zavudev/sdk-csharp/commit/47de211deff2c722fe0158faedbf35690434fcdc))
* **api:** manual updates ([18aecff](https://github.com/zavudev/sdk-csharp/commit/18aecff0d1bd009748ef781eb2261cc219ed6aef))

## 0.0.2 (2026-08-10)

Full Changelog: [v0.0.1...v0.0.2](https://github.com/zavudev/sdk-csharp/compare/v0.0.1...v0.0.2)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
namespace Zavudev.Tests.Models.AgentTemplates;
Original file line number Diff line number Diff line change
@@ -0,0 +1,347 @@
using System.Collections.Generic;
using System.Text.Json;
using Zavudev.Core;
using Zavudev.Exceptions;
using Zavudev.Models.AgentTemplates;

namespace Zavudev.Tests.Models.AgentTemplates;

public class AgentTemplateListResponseTest : TestBase
{
[Fact]
public void FieldRoundtrip_Works()
{
var model = new AgentTemplateListResponse
{
Items =
[
new()
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
},
],
};

List<Item> expectedItems =
[
new()
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
},
];

Assert.Equal(expectedItems.Count, model.Items.Count);
for (int i = 0; i < expectedItems.Count; i++)
{
Assert.Equal(expectedItems[i], model.Items[i]);
}
}

[Fact]
public void SerializationRoundtrip_Works()
{
var model = new AgentTemplateListResponse
{
Items =
[
new()
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
},
],
};

string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<AgentTemplateListResponse>(
json,
ModelBase.SerializerOptions
);

Assert.Equal(model, deserialized);
}

[Fact]
public void FieldRoundtripThroughSerialization_Works()
{
var model = new AgentTemplateListResponse
{
Items =
[
new()
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
},
],
};

string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<AgentTemplateListResponse>(
element,
ModelBase.SerializerOptions
);
Assert.NotNull(deserialized);

List<Item> expectedItems =
[
new()
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
},
];

Assert.Equal(expectedItems.Count, deserialized.Items.Count);
for (int i = 0; i < expectedItems.Count; i++)
{
Assert.Equal(expectedItems[i], deserialized.Items[i]);
}
}

[Fact]
public void Validation_Works()
{
var model = new AgentTemplateListResponse
{
Items =
[
new()
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
},
],
};

model.Validate();
}

[Fact]
public void CopyConstructor_Works()
{
var model = new AgentTemplateListResponse
{
Items =
[
new()
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
},
],
};

AgentTemplateListResponse copied = new(model);

Assert.Equal(model, copied);
}
}

public class ItemTest : TestBase
{
[Fact]
public void FieldRoundtrip_Works()
{
var model = new Item
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
};

string expectedID = "fermi";
ApiEnum<string, ItemCategory> expectedCategory = ItemCategory.Sales;
string expectedName = "name";
string expectedSummary = "summary";
long expectedToolCount = 0;
bool expectedVoice = true;

Assert.Equal(expectedID, model.ID);
Assert.Equal(expectedCategory, model.Category);
Assert.Equal(expectedName, model.Name);
Assert.Equal(expectedSummary, model.Summary);
Assert.Equal(expectedToolCount, model.ToolCount);
Assert.Equal(expectedVoice, model.Voice);
}

[Fact]
public void SerializationRoundtrip_Works()
{
var model = new Item
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
};

string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<Item>(json, ModelBase.SerializerOptions);

Assert.Equal(model, deserialized);
}

[Fact]
public void FieldRoundtripThroughSerialization_Works()
{
var model = new Item
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
};

string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<Item>(element, ModelBase.SerializerOptions);
Assert.NotNull(deserialized);

string expectedID = "fermi";
ApiEnum<string, ItemCategory> expectedCategory = ItemCategory.Sales;
string expectedName = "name";
string expectedSummary = "summary";
long expectedToolCount = 0;
bool expectedVoice = true;

Assert.Equal(expectedID, deserialized.ID);
Assert.Equal(expectedCategory, deserialized.Category);
Assert.Equal(expectedName, deserialized.Name);
Assert.Equal(expectedSummary, deserialized.Summary);
Assert.Equal(expectedToolCount, deserialized.ToolCount);
Assert.Equal(expectedVoice, deserialized.Voice);
}

[Fact]
public void Validation_Works()
{
var model = new Item
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
};

model.Validate();
}

[Fact]
public void CopyConstructor_Works()
{
var model = new Item
{
ID = "fermi",
Category = ItemCategory.Sales,
Name = "name",
Summary = "summary",
ToolCount = 0,
Voice = true,
};

Item copied = new(model);

Assert.Equal(model, copied);
}
}

public class ItemCategoryTest : TestBase
{
[Theory]
[InlineData(ItemCategory.Sales)]
[InlineData(ItemCategory.Support)]
[InlineData(ItemCategory.FrontDesk)]
[InlineData(ItemCategory.Ops)]
public void Validation_Works(ItemCategory rawValue)
{
// force implicit conversion because Theory can't do that for us
ApiEnum<string, ItemCategory> value = rawValue;
value.Validate();
}

[Fact]
public void InvalidEnumValidationThrows_Works()
{
var value = JsonSerializer.Deserialize<ApiEnum<string, ItemCategory>>(
JsonSerializer.SerializeToElement("invalid value"),
ModelBase.SerializerOptions
);

Assert.NotNull(value);
Assert.Throws<ZavudevInvalidDataException>(() => value.Validate());
}

[Theory]
[InlineData(ItemCategory.Sales)]
[InlineData(ItemCategory.Support)]
[InlineData(ItemCategory.FrontDesk)]
[InlineData(ItemCategory.Ops)]
public void SerializationRoundtrip_Works(ItemCategory rawValue)
{
// force implicit conversion because Theory can't do that for us
ApiEnum<string, ItemCategory> value = rawValue;

string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<ApiEnum<string, ItemCategory>>(
json,
ModelBase.SerializerOptions
);

Assert.Equal(value, deserialized);
}

[Fact]
public void InvalidEnumSerializationRoundtrip_Works()
{
var value = JsonSerializer.Deserialize<ApiEnum<string, ItemCategory>>(
JsonSerializer.SerializeToElement("invalid value"),
ModelBase.SerializerOptions
);
string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions);
var deserialized = JsonSerializer.Deserialize<ApiEnum<string, ItemCategory>>(
json,
ModelBase.SerializerOptions
);

Assert.Equal(value, deserialized);
}
}
Loading
Loading