Skip to content

[sessionauthentication] Code generation: update services and models#1943

Open
AdyenAutomationBot wants to merge 1 commit intomainfrom
sdk-automation/sessionauthentication
Open

[sessionauthentication] Code generation: update services and models#1943
AdyenAutomationBot wants to merge 1 commit intomainfrom
sdk-automation/sessionauthentication

Conversation

@AdyenAutomationBot
Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the sessionauthentication 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 April 20, 2026 10:47
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 introduces SDK generation metadata and modifies the fromValue methods in ProductType and ResourceType enums to return null and log a warning instead of throwing an IllegalArgumentException. It also includes minor code cleanup and formatting in the clouddevice service. The review feedback points out that returning null is a breaking change that could lead to NullPointerException in client code and suggests adding a check to handle null inputs silently to avoid excessive log noise.

Comment on lines +52 to +58
// handling unexpected value
LOG.warning(
"ProductType: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(ProductType.values()));
return null;
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 change from throwing an IllegalArgumentException to returning null when an unexpected value is encountered is a breaking change. While this aids in forward compatibility (allowing the SDK to handle new API values without crashing), it may lead to NullPointerException in client code if the result is not checked.

Additionally, the method will log a warning for null inputs. If this enum is used for an optional field, a missing value in the JSON will trigger this warning, potentially causing excessive log noise. Consider adding a null check to return null silently when the input is null.

    if (value == null) {
      return null;
    }
    // handling unexpected value
    LOG.warning(
        "ProductType: unexpected enum value '"
            + value
            + "' - Supported values are "
            + Arrays.toString(ProductType.values()));
    return null;

Comment on lines +56 to +62
// handling unexpected value
LOG.warning(
"ResourceType: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(ResourceType.values()));
return null;
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 change from throwing an IllegalArgumentException to returning null when an unexpected value is encountered is a breaking change. While this aids in forward compatibility (allowing the SDK to handle new API values without crashing), it may lead to NullPointerException in client code if the result is not checked.

Additionally, the method will log a warning for null inputs. If this enum is used for an optional field, a missing value in the JSON will trigger this warning, potentially causing excessive log noise. Consider adding a null check to return null silently when the input is null.

    if (value == null) {
      return null;
    }
    // handling unexpected value
    LOG.warning(
        "ResourceType: unexpected enum value '"
            + value
            + "' - Supported values are "
            + Arrays.toString(ResourceType.values()));
    return null;

@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/sessionauthentication branch from 7c619d5 to 6a514a8 Compare April 23, 2026 11:37
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.

1 participant