Skip to content

refactor!: .Models sub-namespace + PascalCase client names (#114)#119

Merged
daviburg merged 5 commits intomainfrom
feature/codegen-naming
May 7, 2026
Merged

refactor!: .Models sub-namespace + PascalCase client names (#114)#119
daviburg merged 5 commits intomainfrom
feature/codegen-naming

Conversation

@daviburg
Copy link
Copy Markdown
Member

@daviburg daviburg commented May 7, 2026

Summary

Two codegen naming improvements (issue #114):

1. .Models Sub-namespace (#16)

Move model types from the connector root namespace to a .Models sub-namespace:

// BEFORE - 30+ types in one namespace
using Azure.Connectors.Sdk.Office365;

// AFTER - client in root, models in .Models
using Azure.Connectors.Sdk.Office365;
using Azure.Connectors.Sdk.Office365.Models;

2. PascalCase Client Names (#17)

Before After
AzureblobClient AzureBlobClient
MsgraphgroupsanduserClient MsGraphGroupsAndUsersClient
OnedriveforbusinessClient OneDriveForBusinessClient
SharepointonlineClient SharePointOnlineClient

Breaking Changes

  • Model types require using {Connector}.Models;
  • 4 client classes renamed to PascalCase
  • 4 ConnectorNames constants renamed to match
  • ModelFactory classes moved to .Models namespace

Validation

  • dotnet build - 0 errors, 0 warnings
  • dotnet test - 259 passed, 0 failed

Generator Changes

BPM CodefulSdkGenerator updated in parallel (internal ADO PR) to emit these naming changes for future regeneration.

Closes #114

BREAKING CHANGES:
- Model types moved to .Models sub-namespace (e.g.,
  Azure.Connectors.Sdk.Office365.Models instead of
  Azure.Connectors.Sdk.Office365)
- 4 clients renamed to PascalCase:
  - AzureblobClient -> AzureBlobClient
  - MsgraphgroupsanduserClient -> MsGraphGroupsAndUsersClient
  - OnedriveforbusinessClient -> OneDriveForBusinessClient
  - SharepointonlineClient -> SharePointOnlineClient
- ConnectorNames constants renamed to match:
  - ConnectorNames.Azureblob -> ConnectorNames.AzureBlob
  - ConnectorNames.Msgraphgroupsanduser -> ConnectorNames.MsGraphGroupsAndUsers
  - ConnectorNames.Onedriveforbusiness -> ConnectorNames.OneDriveForBusiness
  - ConnectorNames.Sharepointonline -> ConnectorNames.SharePointOnline
- ModelFactory classes moved to .Models namespace

Migration: Add 'using {Connector}.Models;' for model type references.
Replace old client/constant names with new PascalCase names.

Closes #114
Copilot AI review requested due to automatic review settings May 7, 2026 18:48
@daviburg daviburg requested a review from a team as a code owner May 7, 2026 18:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Refactors generated connector SDK naming by moving model types into a .Models sub-namespace and renaming select client classes / connector constants to PascalCase to improve API consistency (breaking change).

Changes:

  • Moved generated model types and *ModelFactory classes under {Connector}.Models namespaces.
  • Renamed 4 generated client classes (and related constants/tests) to PascalCase (AzureBlob, MsGraphGroupsAndUsers, OneDriveForBusiness, SharePointOnline).
  • Updated unit tests and generated usage docs/comments to reference the new namespaces and client names.

Reviewed changes

Copilot reviewed 18 out of 44 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/Azure.Connectors.Sdk.Tests/TriggerCallbackPayloadTests.cs Adds .Models import to align tests with model namespace move.
tests/Azure.Connectors.Sdk.Tests/TeamsClientTests.cs Adds Teams .Models import for moved model types.
tests/Azure.Connectors.Sdk.Tests/SmtpClientTests.cs Adds Smtp .Models import for moved model types.
tests/Azure.Connectors.Sdk.Tests/SharepointonlineClientTests.cs Updates imports and test class/client names for SharePointOnline refactor.
tests/Azure.Connectors.Sdk.Tests/OnedriveforbusinessClientTests.cs Updates imports and test class/client names for OneDriveForBusiness refactor.
tests/Azure.Connectors.Sdk.Tests/Office365usersClientTests.cs Adds Office365users .Models import for moved model types.
tests/Azure.Connectors.Sdk.Tests/Office365TriggerPayloadTests.cs Adds .Models import to align with model namespace move.
tests/Azure.Connectors.Sdk.Tests/Office365ClientTests.cs Adds .Models import to align with model namespace move.
tests/Azure.Connectors.Sdk.Tests/MsgraphgroupsanduserClientTests.cs Updates imports and test class/client names for MsGraphGroupsAndUsers refactor.
tests/Azure.Connectors.Sdk.Tests/MqClientTests.cs Adds Mq .Models import for moved model types.
tests/Azure.Connectors.Sdk.Tests/ModelFactoryTests.cs Updates imports and factory type names to new namespaces/PascalCase.
tests/Azure.Connectors.Sdk.Tests/MockingTests.cs Adds .Models imports for moved model types used in mocking tests.
tests/Azure.Connectors.Sdk.Tests/KustoClientTests.cs Adds Kusto .Models import for moved model types.
tests/Azure.Connectors.Sdk.Tests/DynamicSchemaTests.cs Adds Teams .Models import to align with moved model types.
tests/Azure.Connectors.Sdk.Tests/ConnectorConstantsTests.cs Updates ConnectorNames constant usage to PascalCase.
tests/Azure.Connectors.Sdk.Tests/AzuremonitorlogsClientTests.cs Adds Azuremonitorlogs .Models import for moved model types.
tests/Azure.Connectors.Sdk.Tests/AzureblobClientTests.cs Updates imports and test class/client names for AzureBlob refactor.
tests/Azure.Connectors.Sdk.Tests/ArmClientTests.cs Adds Arm .Models import for moved model types.
src/Azure.Connectors.Sdk/Generated/TeamsModelFactory.cs Moves Teams model factory into Azure.Connectors.Sdk.Teams.Models.
src/Azure.Connectors.Sdk/Generated/TeamsExtensions.cs Splits Teams models/client into .Models + root namespaces within one file.
src/Azure.Connectors.Sdk/Generated/SmtpModelFactory.cs Moves Smtp model factory into Azure.Connectors.Sdk.Smtp.Models.
src/Azure.Connectors.Sdk/Generated/SmtpExtensions.cs Splits Smtp models/client into .Models + root namespaces within one file.
src/Azure.Connectors.Sdk/Generated/SharepointonlineModelFactory.cs Moves/renames SharePointOnline model factory into .Models and PascalCase.
src/Azure.Connectors.Sdk/Generated/SharepointonlineExtensions.cs Splits SharePointOnline models/client; renames client and trigger registries to PascalCase.
src/Azure.Connectors.Sdk/Generated/OnedriveforbusinessModelFactory.cs Moves/renames OneDriveForBusiness model factory into .Models and PascalCase.
src/Azure.Connectors.Sdk/Generated/OnedriveforbusinessExtensions.cs Splits OneDriveForBusiness models/client; renames client and trigger registries to PascalCase.
src/Azure.Connectors.Sdk/Generated/Office365usersModelFactory.cs Moves Office365users model factory into Azure.Connectors.Sdk.Office365users.Models.
src/Azure.Connectors.Sdk/Generated/Office365usersExtensions.cs Splits Office365users models/client into .Models + root namespaces within one file.
src/Azure.Connectors.Sdk/Generated/Office365ModelFactory.cs Moves Office365 model factory into Azure.Connectors.Sdk.Office365.Models.
src/Azure.Connectors.Sdk/Generated/Office365Extensions.cs Splits Office365 models/client into .Models + root namespaces within one file.
src/Azure.Connectors.Sdk/Generated/MsgraphgroupsanduserModelFactory.cs Moves/renames MsGraphGroupsAndUsers model factory into .Models and PascalCase.
src/Azure.Connectors.Sdk/Generated/MsgraphgroupsanduserExtensions.cs Splits MsGraphGroupsAndUsers models/client; renames client to PascalCase.
src/Azure.Connectors.Sdk/Generated/MqModelFactory.cs Moves Mq model factory into Azure.Connectors.Sdk.Mq.Models.
src/Azure.Connectors.Sdk/Generated/MqExtensions.cs Splits Mq models/client into .Models + root namespaces within one file.
src/Azure.Connectors.Sdk/Generated/ManagedConnectors.cs Updates usage examples to new namespaces and PascalCase client names.
src/Azure.Connectors.Sdk/Generated/KustoModelFactory.cs Moves Kusto model factory into Azure.Connectors.Sdk.Kusto.Models.
src/Azure.Connectors.Sdk/Generated/KustoExtensions.cs Splits Kusto models/client into .Models + root namespaces within one file.
src/Azure.Connectors.Sdk/Generated/ConnectorNames.cs Renames connector name constants to PascalCase to match connector/client naming.
src/Azure.Connectors.Sdk/Generated/AzuremonitorlogsModelFactory.cs Moves Azuremonitorlogs model factory into Azure.Connectors.Sdk.Azuremonitorlogs.Models.
src/Azure.Connectors.Sdk/Generated/AzuremonitorlogsExtensions.cs Splits Azuremonitorlogs models/client into .Models + root namespaces within one file.
src/Azure.Connectors.Sdk/Generated/AzureblobModelFactory.cs Moves/renames AzureBlob model factory into .Models and PascalCase.
src/Azure.Connectors.Sdk/Generated/AzureblobExtensions.cs Splits AzureBlob models/client; renames client and trigger registries to PascalCase.
src/Azure.Connectors.Sdk/Generated/ArmModelFactory.cs Moves Arm model factory into Azure.Connectors.Sdk.Arm.Models.
src/Azure.Connectors.Sdk/Generated/ArmExtensions.cs Splits Arm models/client into .Models + root namespaces within one file.

daviburg added 2 commits May 7, 2026 11:58
dotnet format whitespace to indent content inside the block-scoped
Models and Client namespace declarations.
The editorconfig enforces csharp_using_directive_placement=outside_namespace.
Move the 'using .Models;' directive from inside the Client namespace block
to the top-level usings section.
Copilot AI review requested due to automatic review settings May 7, 2026 19:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 48 changed files in this pull request and generated 3 comments.

Comment on lines +245 to +264
/// Typed trigger payload for the OnUpdatedFiles trigger (Azureblob "When a blob is added or modified (properties only) (V2)", operationId: OnUpdatedFiles_V2).
/// Deserialize Connector Gateway callbacks directly: <c>JsonSerializer.Deserialize&lt;AzureblobOnUpdatedFilesTriggerPayload&gt;(body)</c>.
/// </summary>
public class AzureblobOnUpdatedFilesTriggerPayload : TriggerCallbackPayload<BlobMetadata>
{
}

/// <summary>
/// Static registry of available trigger operations for the Azureblob connector.
/// Maps operation names to their typed <see cref="TriggerCallbackPayload{T}"/> subtypes.
/// </summary>
public static class AzureBlobTriggers
{
/// <summary>
/// Available trigger operations for the Azureblob connector.
/// </summary>
public static IReadOnlyDictionary<string, Type> Operations { get; } = new ReadOnlyDictionary<string, Type>(
new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase)
{
["OnUpdatedFiles_V2"] = typeof(AzureblobOnUpdatedFilesTriggerPayload),
Comment on lines +118 to +146
/// Typed trigger payload for the OnNewFiles trigger (Onedriveforbusiness "When a file is created (properties only)", operationId: OnNewFilesV2).
/// Deserialize Connector Gateway callbacks directly: <c>JsonSerializer.Deserialize&lt;OnedriveforbusinessOnNewFilesTriggerPayload&gt;(body)</c>.
/// </summary>
public class OnedriveforbusinessOnNewFilesTriggerPayload : TriggerCallbackPayload<BlobMetadata>
{
}

/// <summary>
/// Typed trigger payload for the OnUpdatedFiles trigger (Onedriveforbusiness "When a file is modified (properties only)", operationId: OnUpdatedFilesV2).
/// Deserialize Connector Gateway callbacks directly: <c>JsonSerializer.Deserialize&lt;OnedriveforbusinessOnUpdatedFilesTriggerPayload&gt;(body)</c>.
/// </summary>
public class OnedriveforbusinessOnUpdatedFilesTriggerPayload : TriggerCallbackPayload<BlobMetadata>
{
}

/// <summary>
/// Static registry of available trigger operations for the Onedriveforbusiness connector.
/// Maps operation names to their typed <see cref="TriggerCallbackPayload{T}"/> subtypes.
/// </summary>
public static class OneDriveForBusinessTriggers
{
/// <summary>
/// Available trigger operations for the Onedriveforbusiness connector.
/// </summary>
public static IReadOnlyDictionary<string, Type> Operations { get; } = new ReadOnlyDictionary<string, Type>(
new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase)
{
["OnNewFilesV2"] = typeof(OnedriveforbusinessOnNewFilesTriggerPayload),
["OnUpdatedFilesV2"] = typeof(OnedriveforbusinessOnUpdatedFilesTriggerPayload),
Comment on lines +908 to +919
/// Typed trigger payload for the OnChangedItems trigger (Sharepointonline "When an item or a file is modified", operationId: GetOnChangedItems).
/// Deserialize Connector Gateway callbacks directly: <c>JsonSerializer.Deserialize&lt;SharepointonlineOnChangedItemsTriggerPayload&gt;(body)</c>.
/// </summary>
public class SharepointonlineOnChangedItemsTriggerPayload : TriggerCallbackPayload<Item>
{
}

/// <summary>
/// Typed trigger payload for the OnDeletedFileItems trigger (Sharepointonline "When a file is deleted", operationId: GetOnDeletedFileItems).
/// Deserialize Connector Gateway callbacks directly: <c>JsonSerializer.Deserialize&lt;SharepointonlineOnDeletedFileItemsTriggerPayload&gt;(body)</c>.
/// </summary>
public class SharepointonlineOnDeletedFileItemsTriggerPayload : TriggerCallbackPayload<DeletedItem>
daviburg added 2 commits May 7, 2026 12:48
- Update ManagedConnectors.cs navigator comments with .Models usings
- Fix ConnectorServiceCollectionExtensions merged from main with
  PascalCase client names and ConnectorNames constants
- Fix ConnectorServiceCollectionExtensionsTests with same renames
Copilot AI review requested due to automatic review settings May 7, 2026 19:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 50 changed files in this pull request and generated no new comments.

@daviburg daviburg merged commit 5629ceb into main May 7, 2026
14 checks passed
@daviburg daviburg deleted the feature/codegen-naming branch May 7, 2026 20:04
daviburg added a commit that referenced this pull request May 7, 2026
daviburg added a commit that referenced this pull request May 7, 2026
- Merged origin/main with #119 PascalCase renaming and .Models sub-namespace

- Regenerated extensible enums on top of main's generated files (surgical extraction)

- 24 extensible enum structs across 7 connectors, 274/274 tests pass

- Fixed conflicted Importance in Office365 (conflict detection reverts to string)

Co-authored-by: Dobby <dobby@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codegen naming: .Models sub-namespace + PascalCase client names (#16 + #17)

2 participants