NickSoftware.Switchboard.SourceGenerators 0.1.0-preview.16

This is a prerelease version of NickSoftware.Switchboard.SourceGenerators.
This package has a SemVer 2.0.0 package version: 0.1.0-preview.16+6311724.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package NickSoftware.Switchboard.SourceGenerators --version 0.1.0-preview.16
                    
NuGet\Install-Package NickSoftware.Switchboard.SourceGenerators -Version 0.1.0-preview.16
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NickSoftware.Switchboard.SourceGenerators" Version="0.1.0-preview.16">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NickSoftware.Switchboard.SourceGenerators" Version="0.1.0-preview.16" />
                    
Directory.Packages.props
<PackageReference Include="NickSoftware.Switchboard.SourceGenerators">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NickSoftware.Switchboard.SourceGenerators --version 0.1.0-preview.16
                    
#r "nuget: NickSoftware.Switchboard.SourceGenerators, 0.1.0-preview.16"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NickSoftware.Switchboard.SourceGenerators@0.1.0-preview.16
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NickSoftware.Switchboard.SourceGenerators&version=0.1.0-preview.16&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NickSoftware.Switchboard.SourceGenerators&version=0.1.0-preview.16&prerelease
                    
Install as a Cake Tool

Switchboard - Amazon Connect Infrastructure Framework

A code-first, type-safe .NET framework for building Amazon Connect contact centers using AWS CDK.

CI NuGet codecov

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 Builder 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 Switchboard

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

Project Structure

src/
├── Switchboard/                 # Core framework library
│   ├── Models/                  # Domain models
│   ├── Builders/                # Fluent builders
│   ├── Constructs/              # CDK constructs
│   └── Core/                    # Framework orchestration
tests/
├── Switchboard.Tests/           # Unit tests
examples/
├── SimpleCallCenter/            # Basic example

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 caller
  • TransferToQueue() - Transfer to a queue
  • GetCustomerInput() - Collect DTMF input
  • InvokeLambda() - Call AWS Lambda function
  • CheckHoursOfOperation() - Check business hours
  • Disconnect() - 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")
        .Build();

    // Assert
    flow.Should().NotBeNull();
    flow.Name.Should().Be("TestFlow");
    flow.Actions.Should().HaveCount(2);
}

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

This project is licensed under the MIT License - see LICENSE for details.

Resources

Support


Built with ❤️ using .NET 10 and AWS CDK

There are no supported framework assets in this package.

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