Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 26, 2025

Description

Refs: Slack request from @tjb9dc

Adds the ability to access raw HTTP response data (status code, headers) when making API calls in the C# SDK, similar to the TypeScript implementation.

Link to Devin run: https://app.devin.ai/sessions/10231e3101304c52917326b69a8fdab9
Requested by: [email protected] (@tjb9dc)

Changes Made

  • Added RawResponse<T> template class with Body, StatusCode, and Headers properties
  • Created RawSubPackageClientGenerator and RawRootClientGenerator for generating raw client classes
  • Added WithRawResponse property to client classes that returns the raw client instance
  • Modified HttpEndpointGenerator to generate raw response methods when generateRawResponse: true
  • Registered RawResponse in AsIs.ts and added type references in generation-info.ts
  • Added changelog entry for version 2.10.0
  • Updated README.md generator (if applicable) - N/A

Updates Since Last Revision

  • Fixed compile errors: replaced this.System.NotSupportedException with this.Types.BaseException for unsupported endpoint types
  • Fixed generateRawResponse parameter propagation through EndpointGenerator.ts
  • Added changelog entry to versions.yml (version 2.10.0 - minor bump required for feat type)
  • Fixed HEAD endpoint handling: HEAD requests now correctly return RawResponse<HttpResponseHeaders> instead of RawResponse<object> (caught by http-head seed test)

Testing

  • Unit tests added/updated
  • Manual testing completed (lint checks pass locally)
  • All CI checks passing

Human Review Checklist

⚠️ Important items for reviewer:

  1. Seed tests not updated - No seed test fixtures were updated to validate the generated C# code compiles. CI passed using existing fixtures.

  2. Streaming endpoints throw BaseException - Raw response wrapper is not supported for streaming, streamParameter, and bytes endpoints. These will throw BaseException at runtime. Is this acceptable?

  3. Pagination not supported - Raw response methods use unpaged endpoint signature, so paginated endpoints may not work correctly with WithRawResponse.

  4. Template design - Review RawResponse.Template.cs - uses int for StatusCode (not HttpStatusCode enum) and HttpResponseHeaders for headers.

This adds the ability to access raw HTTP response data (status code, headers)
when making API calls in the C# SDK.

Changes:
- Add RawResponse<T> template class with Body, StatusCode, and Headers properties
- Create RawSubPackageClientGenerator and RawRootClientGenerator for raw client classes
- Add WithRawResponse property to client classes that returns raw client instance
- Modify HttpEndpointGenerator to generate raw response methods
- Register RawResponse in AsIs.ts and add type references in generation-info.ts

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 13 commits November 26, 2025 18:20
Main client methods now delegate to raw client and call .Body,
matching the Java pattern where rawClient has the HTTP implementation
and main client is a thin wrapper.

Co-Authored-By: [email protected] <[email protected]>
For endpoints without a response body, don't try to access .Body
since it doesn't exist. Just await the raw call without returning.

Co-Authored-By: [email protected] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant