Remove unused imports and add WithingsApiException#30
Merged
Conversation
…Exception Cleans up unused using directives (System.Collections.Generic, System.IO) and introduces a typed WithingsApiException to replace generic Exception throws in Authenticator, improving error handling specificity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removes all third-party NuGet dependencies (Flurl.Http, Microsoft.CSharp, System.Text.Json) by replacing Flurl with standard HttpClient and targeting net8.0 only. Updates tests to use FakeHandler instead of Flurl.Http.Testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- WithingsClientTests: URL building and bearer token for all 8 API methods - AuthenticatorSuccessTests: success paths, form data, and auth URL params - WithingsApiExceptionTests: constructors, status code, and inner exception - ExpandoObjectConverterTests: nested objects, arrays, nulls, and Write() - DateTimeExtensionsTests: DST gap invalid local time edge case - Add .env to .gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update CI workflow to install all three SDK versions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Withings API returns userid as a number, but OAuthToken.UserId is typed as string. Add UserIdConverter to handle both. Update AuthenticatorTests to expect WithingsApiException and use E2E category with .env vars. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- E2EFixture: shared setup that refreshes token once and saves new refresh token back to .env (Withings tokens are single-use) - EnvLoader: loads .env from solution root without extra dependencies - bootstrap-token.sh: local server captures OAuth callback automatically - E2E tests for all WithingsClient and Authenticator endpoints Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Heart: GetHeartList(), GetHeartRecording() - User: GetDevices(), GetGoals() - Nudge: Subscribe(), RevokeSubscription(), GetSubscription(), ListSubscriptions() Includes unit tests for all 8 new methods and E2E tests for 4 of them. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- README: rewrite with OAuth 2.0 usage, all endpoints, E2E instructions - withings-doc: full API reference with Heart, User, and Nudge docs - Example project: use new WITHINGS_* env var names - Dockerfile: target .NET 10, exclude E2E tests - docker-compose: load .env, remove deprecated version key - Add .env.example with required variable template Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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
using System.Collections.GenericfromWithings.Example/Program.csusing System.IOfromWithings.NET/Client/Authenticator.csWithingsApiExceptioncustom exception class withStatusCodepropertythrow new Exception()withthrow new WithingsApiException()inAuthenticator.GetAccessTokenandRefreshAccessTokenTest plan
Exceptionfrom Authenticator are updated if needed🤖 Generated with Claude Code