refactor!: .Models sub-namespace + PascalCase client names (#114)#119
Merged
refactor!: .Models sub-namespace + PascalCase client names (#114)#119
Conversation
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
There was a problem hiding this comment.
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
*ModelFactoryclasses under{Connector}.Modelsnamespaces. - 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. |
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.
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<AzureblobOnUpdatedFilesTriggerPayload>(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<OnedriveforbusinessOnNewFilesTriggerPayload>(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<OnedriveforbusinessOnUpdatedFilesTriggerPayload>(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<SharepointonlineOnChangedItemsTriggerPayload>(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<SharepointonlineOnDeletedFileItemsTriggerPayload>(body)</c>. | ||
| /// </summary> | ||
| public class SharepointonlineOnDeletedFileItemsTriggerPayload : TriggerCallbackPayload<DeletedItem> |
- 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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two codegen naming improvements (issue #114):
1.
.ModelsSub-namespace (#16)Move model types from the connector root namespace to a
.Modelssub-namespace:2. PascalCase Client Names (#17)
AzureblobClientAzureBlobClientMsgraphgroupsanduserClientMsGraphGroupsAndUsersClientOnedriveforbusinessClientOneDriveForBusinessClientSharepointonlineClientSharePointOnlineClientBreaking Changes
using {Connector}.Models;.ModelsnamespaceValidation
dotnet build- 0 errors, 0 warningsdotnet test- 259 passed, 0 failedGenerator Changes
BPM CodefulSdkGenerator updated in parallel (internal ADO PR) to emit these naming changes for future regeneration.
Closes #114