This Go module provides type definitions for Operata's EventBridge event catalog. It includes structs for all event types published by Operata to Amazon EventBridge.
go get github.com/tommyorndorff/operata-events
This module includes support for the following Operata event types:
Delivered after call completion with comprehensive metrics including:
- Contact information and call flow
- WebRTC session metrics (packet loss, jitter, MOS scores)
- Service agent details (machine specs, network info, browser)
- Interaction durations and billing information
Generated when insights are established for a call, containing:
- Account and contact information
- Insight tags and descriptions
Created when agents report issues through the system, including:
- Issue context (category, cause, severity)
- System information (CPU, memory usage)
- Browser and softphone error details
Delivered when headset statistics collection is enabled, containing:
- Headset device information
- Speech metrics (crosstalk, silence, etc.)
- Audio quality measurements
Generated from heartbeat test workflows with:
- Agent and call identification
- Quality scores (AX, CX, Network)
- Test status and timing
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/tommyorndorff/operata-events/events"
)
func main() {
// Example: Parse a CallSummary event
var callEvent events.CallSummaryEvent
if err := json.Unmarshal(eventData, &callEvent); err != nil {
log.Fatal(err)
}
fmt.Printf("Call ended by: %s\n", callEvent.Detail.Contact.EndedBy)
fmt.Printf("Duration: %d seconds\n",
callEvent.Detail.ServiceAgent.Interaction.TotalDurationSec)
fmt.Printf("Packet loss: %.2f%%\n",
callEvent.Detail.WebRTCSession.Metrics.Inbound.PacketsLostPercentage)
// Example: Parse an InsightsSummary event
var insightEvent events.InsightsSummaryEvent
if err := json.Unmarshal(insightData, &insightEvent); err != nil {
log.Fatal(err)
}
fmt.Printf("Insights count: %d\n", insightEvent.Detail.Insights.Count)
for _, tag := range insightEvent.Detail.Insights.Tags {
fmt.Printf("- %s\n", tag.Description)
}
}
All events follow the standard EventBridge event structure:
type EventBridgeEvent struct {
Version string `json:"version"`
ID string `json:"id"`
DetailType string `json:"detail-type"`
Source string `json:"source"`
Account string `json:"account"`
Time time.Time `json:"time"`
Region string `json:"region"`
Resources []string `json:"resources"`
Detail interface{} `json:"detail"`
}
Each event type has a specific detail payload structure. See the individual struct definitions for complete field documentation.
Run the test suite to verify the structs work correctly with example data:
go test ./events
For more information about Operata's event catalog and field descriptions, see:
This module is automatically generated based on Operata's published event schemas. For updates or corrections, please refer to the official Operata documentation.
This project uses Conventional Commits for commit messages. This enables automatic semantic versioning and changelog generation.
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
feat
: A new featurefix
: A bug fixdocs
: Documentation only changesstyle
: Changes that do not affect the meaning of the coderefactor
: A code change that neither fixes a bug nor adds a featureperf
: A code change that improves performancetest
: Adding missing tests or correcting existing testsbuild
: Changes that affect the build system or external dependenciesci
: Changes to our CI configuration files and scriptschore
: Other changes that don't modify src or test files
events
: Changes to event struct definitionsexamples
: Changes to example codeutils
: Changes to utility functionsci
: Changes to CI/CD configurationdeps
: Changes to dependencies
feat(events): add support for new CallAnalytics event type
fix(utils): correct validation logic for event source
docs: update README with new installation instructions
feat!: remove deprecated fields from CallSummary struct
BREAKING CHANGE: Legacy field removed from CallSummary struct
Install development tools:
make install-tools
Setup git commit message template:
make setup-git-hooks
Get help with commit format:
make commit-help
Validate your last commit:
make validate-commit
This project follows Semantic Versioning:
- MAJOR version when you make incompatible API changes (breaking changes)
- MINOR version when you add functionality in a backwards compatible manner
- PATCH version when you make backwards compatible bug fixes
Releases are automatically created when commits are pushed to the main branch using semantic-release.
- Create a feature branch:
git checkout -b feat/new-feature
- Make your changes with conventional commit messages
- Push the branch:
git push origin feat/new-feature
- Create a pull request
- After merge to main, a release will be automatically created if appropriate
The project includes GitHub Actions workflows for:
- CI: Runs tests, linting, and validation on PRs and pushes
- Release: Automatically creates releases and updates changelog
- Commit Lint: Validates commit messages follow conventional format
See LICENSE file for details. Operata helper library