mirror of
https://github.com/hanzo-csharp/sdk.git
synced 2026-11-15 01:32:19 +00:00
Every /v1 operation the gateway serves as a typed method, generated by hanzoai/openapi's driver from its `csharp` row (openapi-generator 7.14.0, httpclient library). Published as `Hanzo` on nuget.org, namespace Hanzo.AI. The repo owns the csproj, Gateway.cs (endpoint, bearer and X-Org-Id from the environment), seven wire tests against a stub transport, and the six flows every Hanzo SDK carries. hanzo.yml gates all three and puts the repo on the client lane; release.yml pushes a version nuget.org does not yet serve. scripts/dotnet installs a .NET 10 SDK where a runner has none.
22 lines
913 B
Bash
Executable File
22 lines
913 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Regenerate src/Hanzo.AI/{Api,Client,Model} from the Hanzo Cloud API document.
|
|
#
|
|
# A call site, not a generator invocation: the invocation lives once, in
|
|
# hanzoai/openapi `generate.py`, and every C# knob is the `csharp` row of its
|
|
# `sdks.yaml`.
|
|
#
|
|
# ./scripts/generate.sh # regenerate in place
|
|
# ./scripts/generate.sh --check # non-zero if the committed client drifted
|
|
#
|
|
# $SPEC is the document, already fetched at the ref `.spec-lock` names and
|
|
# digest-checked; $OPENAPI is a checkout of hanzoai/openapi. hanzoai/ci's
|
|
# client lane sets both. Requires uv and java 11+.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
: "${OPENAPI:?the generator lives in hanzoai/openapi; the ci client lane sets OPENAPI, or point it at a checkout}"
|
|
|
|
if [ -n "${SPEC:-}" ]; then set -- --spec "$SPEC" "$@"; fi
|
|
|
|
exec uv run --with pyyaml python3 "$OPENAPI/generate.py" csharp --repo "$PWD" "$@"
|