Skip to content

[balancewebhooks] Code generation: update services and models#1707

Merged
gcatanese merged 1 commit into
mainfrom
sdk-automation/balancewebhooks
May 21, 2026
Merged

[balancewebhooks] Code generation: update services and models#1707
gcatanese merged 1 commit into
mainfrom
sdk-automation/balancewebhooks

Conversation

@AdyenAutomationBot
Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the balancewebhooks service.

The commit history of this PR reflects the adyen-openapi commits that have been applied.

@AdyenAutomationBot AdyenAutomationBot requested a review from a team as a code owner May 21, 2026 12:55
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the BalanceAccountBalanceNotificationRequest and ReleasedBlockedBalanceNotificationRequest models to improve the handling of notification types during deserialization, alongside updating the SDK generation logs. The reviewer identified a potential NullReferenceException risk when assigning the Type property if the source value is null and suggested implementing an explicit null check with an exception. Additionally, a compiler warning was noted regarding a string type mismatch in the FromStringOrDefault method call.

balanceAccountBalanceNotificationRequest.Data = data.Value!;
balanceAccountBalanceNotificationRequest.Environment = environment.Value!;
balanceAccountBalanceNotificationRequest.Type = type.Value!.Value;
balanceAccountBalanceNotificationRequest.Type = type.Value!;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Assigning type.Value! to the non-nullable Type property is risky if the JSON contains an explicit null value for the type field. In such cases, type.Value will be null, and assigning it to a non-nullable property will bypass compiler checks but may cause a NullReferenceException at runtime (e.g., in ToString()). Since this is a required field, it is safer to throw an exception if the value is null. Additionally, note that at line 267, typeRawValue (which is string?) is passed to FromStringOrDefault (which expects string), triggering a compiler warning.

            balanceAccountBalanceNotificationRequest.Type = type.Value ?? throw new ArgumentException("Property 'type' cannot be null.", nameof(type));

releasedBlockedBalanceNotificationRequest.Data = data.Value!;
releasedBlockedBalanceNotificationRequest.Environment = environment.Value!;
releasedBlockedBalanceNotificationRequest.Type = type.Value!.Value;
releasedBlockedBalanceNotificationRequest.Type = type.Value!;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Assigning type.Value! to the non-nullable Type property is risky if the JSON contains an explicit null value for the type field. In such cases, type.Value will be null, and assigning it to a non-nullable property will bypass compiler checks but may cause a NullReferenceException at runtime. Since this is a required field, it is safer to throw an exception if the value is null. Additionally, note that at line 267, typeRawValue (which is string?) is passed to FromStringOrDefault (which expects string), triggering a compiler warning.

            releasedBlockedBalanceNotificationRequest.Type = type.Value ?? throw new ArgumentException("Property 'type' cannot be null.", nameof(type));

@gcatanese gcatanese added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 84c5794 May 21, 2026
2 checks passed
@gcatanese gcatanese deleted the sdk-automation/balancewebhooks branch May 21, 2026 13:07
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.

2 participants