Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk-generation-log/configurationwebhooks.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"service": "configurationwebhooks",
"project": "java",
"generatedAt": "2026-07-23T13:25:47Z",
"openapiCommitSha": "06d031500a5565d326553c6b0d14c3c79d13a1eb",
"automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397",
"libraryCommitSha": "7f01d8c3c98591abf7cf85a4db7b7ff76aa7e66b"
"generatedAt": "2026-10-28T13:13:01Z",
"openapiCommitSha": "aad1cc0bc1b27ad14146574de64a0f35eb9f3be9",
"automationCommitSha": "b78db5c1f857f1d7d8d45116ce61f6266043fa60",
"libraryCommitSha": "98728a5812faffb6044fb3f16b8529d4cffc3784"
}
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,29 @@ public Optional<ScoreNotificationRequest> getScoreNotificationRequest() {
return Optional.empty();
}

/**
* Attempts to deserialize the webhook payload into a SweepExecutionNotificationRequest
*
* @return an Optional containing the deserialized object, or empty if deserialization fails
*/
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();
}
Comment on lines +318 to +334

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.


/**
* Attempts to deserialize the webhook payload into a TopUpConfigurationEventRequest
*
Expand Down
Loading
Loading