Skip to content

[configurationwebhooks] Code generation: update services and models - #2094

Merged
ashwaniarya-adyen merged 3 commits into
mainfrom
sdk-automation/configurationwebhooks
Oct 29, 2026
Merged

ashwaniarya-adyen merged 3 commits into
mainfrom
sdk-automation/configurationwebhooks

Conversation

@AdyenAutomationBot

@AdyenAutomationBot AdyenAutomationBot commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the configurationwebhooks service.

Adyen/adyen-openapi@aad1cc0

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

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

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.

Code Review

This pull request introduces support for sweep execution notifications within the configuration webhooks. It adds new model classes (SweepExecutionNotificationData, SweepExecutionNotificationRequest, and SweepResultDetails) and updates the ConfigurationWebhooksHandler with a new method to deserialize these notifications. The review feedback suggests simplifying the getSweepExecutionNotificationRequest method by removing redundant enum verification loops and defensive null checks, as the deserialized request already contains the mapped enum type.

Comment on lines +318 to +334
public Optional<SweepExecutionNotificationRequest> getSweepExecutionNotificationRequest() {

var optionalSweepExecutionNotificationRequest =
getOptionalField(SweepExecutionNotificationRequest.class);

if (optionalSweepExecutionNotificationRequest.isPresent()) {
// verify event type
for (var value : SweepExecutionNotificationRequest.TypeEnum.values()) {
if (value.equals(optionalSweepExecutionNotificationRequest.get().getType())) {
// found matching event type
return optionalSweepExecutionNotificationRequest;
}
}
}

return Optional.empty();
}

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

The deserialization and event type verification can be simplified significantly. Since getType() already returns a TypeEnum, looping through all enum values is redundant. Additionally, we should avoid adding defensive null checks (such as filtering for a non-null type) that silently ignore null values, as an immediate NullPointerException is a clearer failure signal than silently ignoring the null value which could lead to obscure downstream errors.

  public Optional<SweepExecutionNotificationRequest> getSweepExecutionNotificationRequest() {
    return getOptionalField(SweepExecutionNotificationRequest.class);
  }
References
  1. Avoid adding defensive null checks if a parameter is guaranteed to be non-null by design, and where an immediate NullPointerException is a clearer failure signal than silently ignoring the null value, which could lead to obscure downstream errors like an opaque server rejection.

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/configurationwebhooks branch 3 times, most recently from 39a4bdb to 5874c0e Compare October 28, 2026 13:13
@ashwaniarya-adyen
ashwaniarya-adyen added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 29, 2026
@ashwaniarya-adyen
ashwaniarya-adyen added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 29, 2026
@ashwaniarya-adyen
ashwaniarya-adyen force-pushed the sdk-automation/configurationwebhooks branch from 2822e71 to dedfcbc Compare October 29, 2026 09:41
@sonarqubecloud

Copy link
Copy Markdown

@ashwaniarya-adyen
ashwaniarya-adyen added this pull request to the merge queue Oct 29, 2026
@ashwaniarya-adyen ashwaniarya-adyen added the Feature Indicates a new feature addition label Oct 29, 2026
Merged via the queue into main with commit 441f1be Oct 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Indicates a new feature addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants