Skip to content

Add OneDrive for Business connector client (Tier 1)#47

Merged
daviburg merged 3 commits into
mainfrom
feature/onedrive-for-business
Apr 9, 2026
Merged

Add OneDrive for Business connector client (Tier 1)#47
daviburg merged 3 commits into
mainfrom
feature/onedrive-for-business

Conversation

@daviburg
Copy link
Copy Markdown
Member

@daviburg daviburg commented Apr 9, 2026

Summary

Add the OneDrive for Business connector client to the SDK (Tier 1 priority).

Closes #39 (SDK portion). Samples repo work tracked in Azure/Connectors-NET-Samples#15.

Changes

Generated Code

  • OnedriveforbusinessExtensions.cs (~43KB) — 22 action operations + 4 trigger operations
    • File operations: get metadata, update, delete, create, get content
    • Path-based variants: get metadata by path, get content by path
    • Sharing: create share link (by ID and by path)
    • File management: copy, move, convert (by ID and by path)
    • Thumbnails: get file thumbnail
    • Folders: list root folder, list files in folder
    • Search: find files in folder (by ID and by path)
    • Archive: extract archive to folder
    • Triggers: OnNewFile, OnNewFiles, OnUpdatedFile, OnUpdatedFiles

SDK Registration

  • ConnectorNames.cs — Added Onedriveforbusiness constant
  • ManagedConnectors.cs — Added onedriveforbusiness to available connectors list + usage example

Tests

  • OnedriveforbusinessClientTests.cs — 15 tests covering:
    • Constructor validation (valid URL, null URL)
    • Dispose semantics (injected vs owned HttpClient)
    • Mocked API call (GetFileMetadataAsync success)
    • Error handling (404 throws OnedriveforbusinessConnectorException)
    • Exception properties verification
    • JSON round-trip serialization for: BlobMetadata, Thumbnail, SharingLink, BlobMetadataPage
    • JsonPropertyName behavior verification (NameNoExt, WebUrl)

Documentation

  • ROADMAP.md — Status updated, tier changed to Tier 1, change log entry added
  • connection-setup SKILL.md — Added onedriveforbusiness to supported connector list

Validation

  • Build: 0 warnings, 0 errors
  • Tests: 110/110 passed (including ConnectorNames_AllConstantsAreRegistered)
  • No generator bugs found — clean generation
  • No [DynamicSchema] types in this connector (no schema discovery operations)

- Generated OnedriveforbusinessExtensions.cs with 22 operations:
  file CRUD, metadata, content, sharing links, thumbnails,
  copy, move, convert, search, folder listing, archive extraction
- Added trigger payloads and operation constants for 4 triggers
- Updated ConnectorNames.cs with Onedriveforbusiness constant
- Updated ManagedConnectors.cs with onedriveforbusiness registration
- Added OnedriveforbusinessClientTests.cs with full test coverage
- Updated ROADMAP.md status and change log
- Updated connection-setup skill with new connector name

Closes #39 (SDK portion)
@daviburg daviburg requested a review from a team as a code owner April 9, 2026 20:06
Copilot AI review requested due to automatic review settings April 9, 2026 20:06
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

Adds the OneDrive for Business DirectClient connector to the SDK, wiring it into the connector registry and documenting availability, with a companion test suite to validate basic client behavior and model serialization.

Changes:

  • Added generated OneDrive for Business client (OnedriveforbusinessClient) + typed models and trigger payload types.
  • Registered the connector in ConnectorNames and DirectClientConnectors.AvailableConnectors.
  • Added unit tests for constructor/Dispose behavior, error handling, and JSON serialization round-trips; updated roadmap + connection setup skill docs.

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Microsoft.Azure.Connectors.Sdk.Tests/OnedriveforbusinessClientTests.cs Adds test coverage for the generated client (constructor/Dispose, mocked call, exception behavior, JSON serialization).
src/Microsoft.Azure.Connectors.Sdk/Generated/OnedriveforbusinessExtensions.cs Introduces the generated OneDrive for Business DirectClient implementation (actions, triggers, models, exception type).
src/Microsoft.Azure.Connectors.Sdk/Generated/ManagedConnectors.cs Registers onedriveforbusiness in the available connectors list and usage header comment.
src/Microsoft.Azure.Connectors.Sdk/Generated/ConnectorNames.cs Adds the Onedriveforbusiness connector name constant for compile-time usage.
ROADMAP.md Updates status/tier and logs the addition in the changelog.
.github/skills/connection-setup/SKILL.md Adds onedriveforbusiness to the supported connector names list for connection setup automation.
Comments suppressed due to low confidence (1)

.github/skills/connection-setup/SKILL.md:60

  • The “Supported SDK connector names” line was updated, but the example inline comment below still omits onedriveforbusiness (it only lists office365/sharepointonline/teams). Update the example list to include the new connector so readers don’t miss it.
Supported SDK connector names: `office365`, `onedriveforbusiness`, `sharepointonline`, `teams` (and any `Microsoft.Web/connections` connector name).

```powershell
$connectorName = "<connector-name>"      # e.g., "office365", "sharepointonline", "teams"
$connectionName = "<connection-name>"    # e.g., "office365-test", "sharepoint-test"

@daviburg daviburg self-assigned this Apr 9, 2026
daviburg added 2 commits April 9, 2026 13:12
- Add onedriveforbusiness to the example connector names in SKILL.md
- Add OneDrive for Business row to README validated connectors table
Address Copilot review: set StatusCode = HttpStatusCode.OK explicitly
in GetFileMetadataAsync success test for clarity.
Copilot AI review requested due to automatic review settings April 9, 2026 20:17
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 4 out of 7 changed files in this pull request and generated 1 comment.

@daviburg
Copy link
Copy Markdown
Member Author

daviburg commented Apr 9, 2026

By design. The 4 constants in OnedriveforbusinessTriggerOperations cover all valid trigger operation IDs (for [ConnectorTrigger] attribute usage). The Operations registry only maps the 2 with typed deserialization targets:

  • OnNewFileV2 / OnUpdatedFileV2 return file content as a binary stream - no structured JSON for a typed payload class.
  • OnNewFilesV2 / OnUpdatedFilesV2 return BlobMetadata arrays (properties only) - these get typed payload classes and registry entries.

The doc comments already distinguish them: constants with a Payload type: cross-reference have registry entries; those without do not. Any improvement to make this clearer would be a generator-side change per repo convention (fix in generator, not generated output).

@daviburg daviburg merged commit 775412f into main Apr 9, 2026
14 checks passed
@daviburg daviburg deleted the feature/onedrive-for-business branch April 9, 2026 20:48
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.

Add OneDrive for Business connector client (Tier 1)

2 participants