Skip to content

Commit 2725d0e

Browse files
feat: refactor union types to use discriminated dispatch and add new providers
Overhaul the assistant-related union types (AssistantCredentialsItem, AssistantModel, AssistantTranscriber, AssistantVoice, and their UpdateAssistantDto counterparts) to use a provider-discriminated pattern instead of try-each untagged deserialization. All union struct fields are renamed from verbose DTO names (e.g. CreateElevenLabsCredentialDto) to short provider-keyed names (e.g. Field11Labs), and all Visitor interface methods are renamed accordingly (e.g. VisitCreateElevenLabsCredentialDto → VisitField11Labs). Key changes: - All union types now expose a `Provider` string discriminant field and use `internal.MarshalJSONWithExtraProperty` for serialization, ensuring the provider tag is always present on the wire - Renamed exported struct fields and Visitor methods across AssistantCredentialsItem, AssistantModel, AssistantTranscriber, AssistantVoice, UpdateAssistantDtoCredentialsItem, UpdateAssistantDtoModel, UpdateAssistantDtoTranscriber, and UpdateAssistantDtoVoice — existing callers must update field access and Visitor implementations - New credential providers added: AnthropicBedrock, Soniox, Wellsaid, Email, SlackWebhook; new model providers: AnthropicBedrock, Minimax; new transcriber providers: Soniox; new voice providers: Wellsaid - New enum constants AssistantClientMessagesItemAssistantSpeechStarted, AssistantServerMessagesItemAssistantSpeechStarted, and their UpdateAssistantDto counterparts - SessionCreatedHook added to AssistantHooksItem and UpdateAssistantDtoHooksItem unions - Metadata field type changed from map[string]interface{} to map[string]any (source-compatible in Go 1.18+) - Nil-guard and String() nil checks added to Assistant methods - UpdateAssistantDto gains explicit MarshalJSON/UnmarshalJSON methods 🌿 Generated with Fern
1 parent d92f8c5 commit 2725d0e

90 files changed

Lines changed: 699350 additions & 53080 deletions

Some content is hidden

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

.fern/metadata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"cliVersion": "4.63.4",
3+
"generatorName": "fernapi/fern-go-sdk",
4+
"generatorVersion": "1.32.1",
5+
"generatorConfig": {
6+
"union": "v1"
7+
},
8+
"originGitCommit": "7ba38da97d0e48c7157051761284febe129e15c6",
9+
"sdkVersion": "v1.0.0"
10+
}

.fernignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Specify files that shouldn't be modified by Fern
22

33
README.md
4+
changelog.md

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: ci
22

33
on: [push]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: false
8+
59
jobs:
610
compile:
711
runs-on: ubuntu-latest
@@ -14,6 +18,19 @@ jobs:
1418

1519
- name: Compile
1620
run: go build ./...
21+
lint:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout repo
25+
uses: actions/checkout@v4
26+
27+
- name: Set up go
28+
uses: actions/setup-go@v4
29+
30+
- name: Lint
31+
uses: golangci/golangci-lint-action@v9
32+
with:
33+
version: v2.10.1
1734
test:
1835
runs-on: ubuntu-latest
1936
steps:
@@ -23,5 +40,23 @@ jobs:
2340
- name: Set up go
2441
uses: actions/setup-go@v4
2542

43+
- name: Setup wiremock server
44+
run: |
45+
PROJECT_NAME="wiremock-$(basename $(dirname $(pwd)) | tr -d '.')"
46+
echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV
47+
if [ -f wiremock/docker-compose.test.yml ]; then
48+
docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml down
49+
docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml up -d
50+
WIREMOCK_PORT=$(docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml port wiremock 8080 | cut -d: -f2)
51+
echo "WIREMOCK_URL=http://localhost:$WIREMOCK_PORT" >> $GITHUB_ENV
52+
fi
53+
2654
- name: Test
2755
run: go test ./...
56+
57+
- name: Teardown wiremock server
58+
if: always()
59+
run: |
60+
if [ -f wiremock/docker-compose.test.yml ]; then
61+
docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml down
62+
fi

analytics.go

Lines changed: 59 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analytics/client.go

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analytics/raw_client.go

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)