Skip to content

Conversation

@AdyenAutomationBot
Copy link
Collaborator

This PR contains the automated changes for the relayedauthorizationwebhooks service.

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

@AdyenAutomationBot AdyenAutomationBot requested review from a team as code owners January 26, 2026 09:42
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AdyenAutomationBot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the relayedauthorizationwebhooks service by integrating newly generated code. The primary goal is to provide up-to-date data structures and a dedicated handler for processing authorization webhook events, enhancing the system's ability to consume and react to these notifications effectively.

Highlights

  • New Webhook Models: Introduced a comprehensive suite of new Java models for the relayedauthorizationwebhooks service, covering various entities such as Amount, Card, PaymentInstrument, MerchantData, and more.
  • Webhook Handler: Added a RelayedAuthorizationWebhooksHandler class to facilitate the deserialization and processing of incoming RelayedAuthorisationRequest webhook events.
  • Automated Code Generation: All changes are a result of automated code generation, ensuring the client library is synchronized with the latest OpenAPI specification for authorization webhooks.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 introduces new models and a webhook handler for relayed authorization webhooks. The changes appear to be automatically generated, likely from an OpenAPI specification. The overall structure and implementation follow standard patterns for data models and webhook processing. However, there are a few areas that could be improved for robustness and clarity, particularly concerning enum handling and exception management.

Comment on lines +76 to +81
LOG.warning(
"AmountAdjustmentTypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(AmountAdjustmentTypeEnum.values()));
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for AmountAdjustmentTypeEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +68 to +73
// handling unexpected value
LOG.warning(
"StatusEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(StatusEnum.values()));
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for StatusEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +103 to +108
LOG.warning(
"FormFactorEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(FormFactorEnum.values()));
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for FormFactorEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +63 to +68
LOG.warning(
"TypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(TypeEnum.values()));
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for TypeEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +125 to +130
// handling unexpected value
LOG.warning(
"StatusEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(StatusEnum.values()));
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for StatusEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +191 to +196
// handling unexpected value
LOG.warning(
"StatusReasonEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(StatusReasonEnum.values()));
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for StatusReasonEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +236 to +241
LOG.warning(
"TypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(TypeEnum.values()));
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for TypeEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +62 to +67
LOG.warning(
"TypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(TypeEnum.values()));
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for TypeEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +154 to +159
// handling unexpected value
LOG.warning(
"TypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(TypeEnum.values()));
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The fromValue method for TypeEnum returns null when an unexpected value is encountered. This can lead to NullPointerExceptions if the calling code does not explicitly check for null. It's generally safer to throw an IllegalArgumentException for invalid input or define an UNKNOWN enum value to handle such cases gracefully.

      // handling unexpected value
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

Comment on lines +70 to +76
T val = JSON.getMapper().readValue(payload, clazz);
return Optional.ofNullable(val);
} catch (Exception e) {
// an error has occurred during deserialization (object not found, deserialization error)
LOG.warning("Object not found or unexpected error trying to access: " + clazz.getName());
LOG.warning("Deserialization error: " + e.getMessage());
return Optional.empty();
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Catching a general Exception is too broad and can mask other issues. It's better to catch specific exceptions like JsonProcessingException for deserialization errors. This improves error handling clarity and prevents unintended suppression of other runtime exceptions.

    try {
      T val = JSON.getMapper().readValue(payload, clazz);
      return Optional.ofNullable(val);
    } catch (JsonProcessingException e) {
      LOG.warning("Deserialization error for " + clazz.getName() + ": " + e.getMessage());
      return Optional.empty();
    } catch (Exception e) {
      // Handle other unexpected exceptions
      LOG.warning("Unexpected error trying to access: " + clazz.getName() + ": " + e.getMessage());
      return Optional.empty();
    }

@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/relayedauthorizationwebhooks branch from 9e844c4 to 05d726c Compare January 27, 2026 14:35
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