NickSoftware.Switchboard.SourceGenerators
0.1.0-preview.37
See the version list below for details.
dotnet add package NickSoftware.Switchboard.SourceGenerators --version 0.1.0-preview.37
NuGet\Install-Package NickSoftware.Switchboard.SourceGenerators -Version 0.1.0-preview.37
<PackageReference Include="NickSoftware.Switchboard.SourceGenerators" Version="0.1.0-preview.37"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="NickSoftware.Switchboard.SourceGenerators" Version="0.1.0-preview.37" />
<PackageReference Include="NickSoftware.Switchboard.SourceGenerators"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add NickSoftware.Switchboard.SourceGenerators --version 0.1.0-preview.37
#r "nuget: NickSoftware.Switchboard.SourceGenerators, 0.1.0-preview.37"
#:package NickSoftware.Switchboard.SourceGenerators@0.1.0-preview.37
#addin nuget:?package=NickSoftware.Switchboard.SourceGenerators&version=0.1.0-preview.37&prerelease
#tool nuget:?package=NickSoftware.Switchboard.SourceGenerators&version=0.1.0-preview.37&prerelease
Switchboard - Amazon Connect Infrastructure Framework
A code-first, type-safe .NET framework for building Amazon Connect contact centers.
Overview
Switchboard provides a modern, fluent API for defining Amazon Connect resources as code. Built on .NET 10 and AWS CDK, it eliminates the need for manual console configuration and enables version-controlled, testable contact center infrastructure.
Features
- Fluent API: Intuitive, chainable methods for building contact flows, queues, and routing profiles
- Type-Safe: Full IntelliSense support with strong typing throughout
- CDK Integration: Seamless integration with AWS CDK for infrastructure as code
- Modular Design: Clean separation of concerns following SOLID principles
- Testable: Comprehensive unit tests with NUnit and FluentAssertions
- .NET 10: Built on the latest .NET platform with modern C# features
Quick Start
Prerequisites
- .NET 10 SDK
- AWS CLI configured with credentials
- AWS CDK CLI (
npm install -g aws-cdk)
Installation
dotnet add package NickSoftware.Switchboard --version 0.1.0-preview.26
Basic Example
using Switchboard;
var app = new SwitchboardApp();
var stack = app.CreateStack("MyCallCenter", "MyConnectInstance");
// Create hours of operation
var hours = new HoursOfOperation
{
Name = "BusinessHours",
TimeZone = "America/New_York"
};
for (var day = DayOfWeek.Monday; day <= DayOfWeek.Friday; day++)
{
hours.AddDayConfig(new HoursOfOperationConfig
{
Day = day,
StartTime = new TimeRange { Hours = 9, Minutes = 0 },
EndTime = new TimeRange { Hours = 17, Minutes = 0 }
});
}
stack.AddHoursOfOperation(hours);
// Create a queue
var queue = new QueueBuilder()
.SetName("Sales")
.SetDescription("Sales inquiries queue")
.SetMaxContacts(50)
.Build();
stack.AddQueue(queue, "BusinessHours");
// Create a contact flow
var flow = new FlowBuilder()
.SetName("MainFlow")
.PlayPrompt("Thank you for calling. Please wait while we connect you.")
.TransferToQueue("Sales")
.Build();
stack.AddContactFlow(flow);
// Synthesize to CloudFormation
app.Synth();
Deploy
cd examples/SimpleCallCenter
cdk deploy
Architecture
Core Components
- Models: Strongly-typed domain models for Amazon Connect resources
ContactFlow,Queue,RoutingProfile,HoursOfOperation,User
- Builders: Fluent builders for creating resources
FlowBuilder,QueueBuilder,RoutingProfileBuilder
- CDK Constructs: AWS CDK constructs for deployment
ContactFlowConstruct,QueueConstruct,RoutingProfileConstruct
- Framework: Core orchestration classes
SwitchboardApp,SwitchboardStack
Building Contact Flows
Using the Fluent Builder
var flow = new FlowBuilder()
.SetName("CustomerService")
.SetDescription("Customer service flow")
.PlayPrompt("Welcome to customer service")
.GetCustomerInput("Press 1 for sales, 2 for support", input =>
{
input.MaxDigits = 1;
input.TimeoutSeconds = 5;
})
.TransferToQueue("Support")
.Disconnect()
.Build();
Supported Actions
PlayPrompt()- Play a message to the callerTransferToQueue()- Transfer to a queueGetCustomerInput()- Collect DTMF inputInvokeLambda()- Call AWS Lambda functionCheckHoursOfOperation()- Check business hoursDisconnect()- End the contact
Creating Queues
var queue = new QueueBuilder()
.SetName("PremiumSupport")
.SetDescription("Premium customer support")
.SetMaxContacts(25)
.SetHoursOfOperation("24x7")
.SetOutboundCallerId("Support Team", "+18005551234")
.AddTag("Department", "Support")
.AddTag("Priority", "High")
.Build();
stack.AddQueue(queue, "24x7");
Routing Profiles
var profile = new RoutingProfileBuilder()
.SetName("AgentProfile")
.SetDescription("Standard agent routing profile")
.AddMediaConcurrency(ChannelType.Voice, concurrency: 1)
.AddMediaConcurrency(ChannelType.Chat, concurrency: 3)
.AddQueue(queueArn, ChannelType.Voice, priority: 1, delay: 0)
.Build();
stack.AddRoutingProfile(profile);
Hours of Operation
var hours = new HoursOfOperation
{
Name = "24x7",
TimeZone = "UTC"
};
for (var day = DayOfWeek.Sunday; day <= DayOfWeek.Saturday; day++)
{
hours.AddDayConfig(new HoursOfOperationConfig
{
Day = day,
StartTime = new TimeRange { Hours = 0, Minutes = 0 },
EndTime = new TimeRange { Hours = 23, Minutes = 59 }
});
}
stack.AddHoursOfOperation(hours);
Testing
The framework includes comprehensive unit tests:
dotnet test
Example test:
[Test]
public void Build_WithValidConfiguration_ShouldCreateFlow()
{
// Arrange
var builder = new FlowBuilder();
// Act
var flow = builder
.SetName("TestFlow")
.PlayPrompt("Welcome")
.TransferToQueue("Sales")
.Disconnect()
.Build();
// Assert
flow.Should().NotBeNull();
flow.Name.Should().Be("TestFlow");
flow.Actions.Should().HaveCount(3);
}
CDK Integration
Switchboard generates standard AWS CDK constructs that can be customized:
var stack = app.CreateStack("MyStack", "MyInstance", "123456789012", "us-east-1");
// Add resources
stack.AddHoursOfOperation(hours);
stack.AddQueue(queue);
stack.AddContactFlow(flow);
// Access underlying CDK constructs if needed
var queueConstruct = stack.GetQueue("Sales");
var queueArn = queueConstruct?.QueueArn;
// Synthesize
app.Synth();
Roadmap
Phase 1 (Current)
- ✅ Core domain models
- ✅ Fluent builders
- ✅ Basic CDK constructs
- ✅ Unit tests
Phase 2 (Planned)
- Attribute-based flow definitions
- Advanced flow actions (Set attributes, Check conditions)
- Flow modules and reusable components
- DynamoDB-backed dynamic configuration
Phase 3 (Future)
- Source generators for compile-time validation
- Roslyn analyzers for design-time feedback
- Visual Studio/VS Code extensions
- Flow visualization tools
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
Licensing terms will be announced before the 1.0 release. The framework is currently in preview (alpha) stage.
Resources
Support
- GitHub Issues: Report bugs or request features
- Documentation: Full documentation
- Examples: Example projects
Built with ❤️ using .NET 10 and AWS CDK
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.52 | 48 | 12/3/2025 |
| 0.1.0-preview.51 | 33 | 12/2/2025 |
| 0.1.0-preview.48 | 42 | 12/2/2025 |
| 0.1.0-preview.47 | 27 | 12/1/2025 |
| 0.1.0-preview.46 | 43 | 12/1/2025 |
| 0.1.0-preview.45 | 55 | 11/30/2025 |
| 0.1.0-preview.44 | 43 | 11/30/2025 |
| 0.1.0-preview.43 | 40 | 11/30/2025 |
| 0.1.0-preview.42 | 53 | 11/30/2025 |
| 0.1.0-preview.41 | 42 | 11/30/2025 |
| 0.1.0-preview.39 | 40 | 11/30/2025 |
| 0.1.0-preview.38 | 41 | 11/29/2025 |
| 0.1.0-preview.37 | 46 | 11/29/2025 |
| 0.1.0-preview.36 | 47 | 11/28/2025 |
| 0.1.0-preview.35 | 51 | 11/27/2025 |
| 0.1.0-preview.34 | 49 | 11/27/2025 |
| 0.1.0-preview.32 | 51 | 11/27/2025 |
| 0.1.0-preview.31 | 47 | 11/27/2025 |
| 0.1.0-preview.29 | 59 | 11/26/2025 |
| 0.1.0-preview.26 | 55 | 11/25/2025 |
| 0.1.0-preview.16 | 105 | 10/26/2025 |
Preview release - APIs may change. See documentation at https://nicksoftware.github.io/switchboard-docs/