Skip to content

[management] Code generation: update services and models - #2067

Open
AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/management
Open

AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/management

Conversation

@AdyenAutomationBot

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the management 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 September 23, 2026 12:28

@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 several new models and API services to support terminal theme management and client certificate generation, while also updating existing payment method models with new fields and documentation. I have identified a high-severity issue regarding incorrect equality and hash code implementation for the List<byte[]> field in ClientCertificateWithChain and a medium-severity inconsistency where the name field in ThemeUpdateRequest is typed as Object instead of String. Please address these concerns to ensure correct object comparison and type consistency across the SDK.

Comment on lines +288 to +322
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ClientCertificateWithChain clientCertificateWithChain = (ClientCertificateWithChain) o;
return Objects.equals(this.caChain, clientCertificateWithChain.caChain)
&& Objects.equals(this.isSetCaChain, clientCertificateWithChain.isSetCaChain)
&& Objects.equals(this.id, clientCertificateWithChain.id)
&& Objects.equals(this.isSetId, clientCertificateWithChain.isSetId)
&& Arrays.equals(this.leaf, clientCertificateWithChain.leaf)
&& Objects.equals(this.isSetLeaf, clientCertificateWithChain.isSetLeaf)
&& Objects.equals(this.serialNumber, clientCertificateWithChain.serialNumber)
&& Objects.equals(this.isSetSerialNumber, clientCertificateWithChain.isSetSerialNumber)
&& Objects.equals(this.subjectDN, clientCertificateWithChain.subjectDN)
&& Objects.equals(this.isSetSubjectDN, clientCertificateWithChain.isSetSubjectDN);
}

@Override
public int hashCode() {
return Objects.hash(
caChain,
isSetCaChain,
id,
isSetId,
Arrays.hashCode(leaf),
isSetLeaf,
serialNumber,
isSetSerialNumber,
subjectDN,
isSetSubjectDN);
}

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.

high

The caChain field is of type List<byte[]>. In Java, calling Objects.equals() on a List compares its elements using their equals() method. For byte[] arrays, equals() performs reference equality (==) rather than content equality. This means two ClientCertificateWithChain instances with identical certificate chains (same byte values but different array instances) will be considered unequal.

Similarly, Objects.hash(caChain) computes the hash code using the default identity hash codes of the byte[] elements, leading to inconsistent hash codes for identical content.

To fix this, we should implement custom helper methods to compare and hash the list of byte arrays by content.

  private boolean equalCaChains(List<byte[]> list1, List<byte[]> list2) {
    if (list1 == list2) {
      return true;
    }
    if (list1 == null || list2 == null) {
      return false;
    }
    if (list1.size() != list2.size()) {
      return false;
    }
    for (int i = 0; i < list1.size(); i++) {
      if (!Arrays.equals(list1.get(i), list2.get(i))) {
        return false;
      }
    }
    return true;
  }

  private int hashCodeCaChain(List<byte[]> list) {
    if (list == null) {
      return 0;
    }
    int result = 1;
    for (byte[] element : list) {
      result = 31 * result + Arrays.hashCode(element);
    }
    return result;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ClientCertificateWithChain clientCertificateWithChain = (ClientCertificateWithChain) o;
    return equalCaChains(this.caChain, clientCertificateWithChain.caChain)
        && Objects.equals(this.isSetCaChain, clientCertificateWithChain.isSetCaChain)
        && Objects.equals(this.id, clientCertificateWithChain.id)
        && Objects.equals(this.isSetId, clientCertificateWithChain.isSetId)
        && Arrays.equals(this.leaf, clientCertificateWithChain.leaf)
        && Objects.equals(this.isSetLeaf, clientCertificateWithChain.isSetLeaf)
        && Objects.equals(this.serialNumber, clientCertificateWithChain.serialNumber)
        && Objects.equals(this.isSetSerialNumber, clientCertificateWithChain.isSetSerialNumber)
        && Objects.equals(this.subjectDN, clientCertificateWithChain.subjectDN)
        && Objects.equals(this.isSetSubjectDN, clientCertificateWithChain.isSetSubjectDN);
  }

  @Override
  public int hashCode() {
    return Objects.hash(
        hashCodeCaChain(caChain),
        isSetCaChain,
        id,
        isSetId,
        Arrays.hashCode(leaf),
        isSetLeaf,
        serialNumber,
        isSetSerialNumber,
        subjectDN,
        isSetSubjectDN);
  }

Comment on lines +76 to +77
public static final String JSON_PROPERTY_NAME = "name";
private Object name;

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 name field in ThemeUpdateRequest is defined as Object, whereas in all other theme-related models (CreateThemeRequest, ThemeSummary, ThemeWithAssetDetails, UpdateThemeResponse), it is typed as String. This inconsistency reduces type safety and makes the SDK harder to use. Consider updating the OpenAPI specification or generator configuration to ensure name is consistently typed as String.

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 2 times, most recently from 550d186 to 4660358 Compare September 23, 2026 15:26
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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