Skip to content

[transfers] Code generation: update services and models#1634

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

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

Conversation

@AdyenAutomationBot
Copy link
Collaborator

This PR contains the automated changes for the transfers 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 February 16, 2026 13:06
@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 provides an automated update to the transfers service models, primarily focusing on refining counterparty representations and introducing new data structures for interchange information. These changes enhance the clarity and specificity of counterparty types within capital grant contexts and expand event data capabilities to include interchange details, ensuring the API client remains synchronized with the latest API specification.

Highlights

  • Model Renaming and Introduction: The Counterparty model was renamed to GrantCounterparty, and a new GrantInfoCounterparty model was introduced to provide more specific counterparty details for grant information. Additionally, a new InterchangeData model was added to capture interchange fee details.
  • Type Updates in Capital Grant Models: The CapitalGrant and CapitalGrantInfo models were updated to correctly reference the newly defined GrantCounterparty and GrantInfoCounterparty types for their counterparty properties.
  • New Transfer Status and Event Types: The InterchangeAdjusted status was added to several transfer-related enums, including Modification.StatusEnum, Transfer.StatusEnum, TransferData.StatusEnum, and TransferEvent.StatusEnum. A new Tracing type was also added to TransferEvent.TypeEnum.
  • Expanded Transfer Event Data: The TransferEventEventsDataInner union type was expanded to include the new InterchangeData model, allowing transfer events to carry interchange-related information.
  • Serialization and Export Updates: The models.ts and objectSerializer.ts files were updated to reflect all model renamings, additions, and enum changes, ensuring proper export, import, and serialization within the transfers service.

🧠 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.

Changelog
  • src/typings/transfers/capitalGrant.ts
    • Updated the type of the counterparty property from Counterparty to GrantCounterparty.
    • Modified the import statement for counterparty to GrantCounterparty.
  • src/typings/transfers/capitalGrantInfo.ts
    • Updated the type of the counterparty property from Counterparty to GrantInfoCounterparty.
    • Modified the import statement for counterparty to GrantInfoCounterparty.
  • src/typings/transfers/counterparty.ts
    • Renamed the file to grantCounterparty.ts.
    • Renamed the Counterparty class to GrantCounterparty.
    • Updated the JSDoc description for the accountHolderId property.
  • src/typings/transfers/grantCounterparty.ts
    • Renamed from counterparty.ts.
    • Renamed the Counterparty class to GrantCounterparty.
    • Updated the JSDoc description for the accountHolderId property.
  • src/typings/transfers/grantInfoCounterparty.ts
    • Added a new file defining the GrantInfoCounterparty class, including balanceAccountId and transferInstrumentId properties.
  • src/typings/transfers/interchangeData.ts
    • Added a new file defining the InterchangeData class, including interchangeAmount, interchangeRateIndicator, and type properties, along with its TypeEnum.
  • src/typings/transfers/models.ts
    • Removed the export for counterparty.
    • Added exports for grantCounterparty, grantInfoCounterparty, and interchangeData.
  • src/typings/transfers/modification.ts
    • Added InterchangeAdjusted to the Modification.StatusEnum.
  • src/typings/transfers/objectSerializer.ts
    • Removed the import and type mapping for Counterparty.
    • Added imports and type mappings for GrantCounterparty, GrantInfoCounterparty, and InterchangeData.
    • Added InterchangeData.TypeEnum to the enumsMap.
  • src/typings/transfers/transfer.ts
    • Added InterchangeAdjusted to the Transfer.StatusEnum.
  • src/typings/transfers/transferData.ts
    • Added InterchangeAdjusted to the TransferData.StatusEnum.
  • src/typings/transfers/transferEvent.ts
    • Added InterchangeAdjusted to the TransferEvent.StatusEnum.
    • Added Tracing to the TransferEvent.TypeEnum.
  • src/typings/transfers/transferEventEventsDataInner.ts
    • Imported InterchangeData.
    • Updated the TransferEventEventsDataInner type to include InterchangeData.
Activity
  • The pull request was automatically generated by AdyenAutomationBot.
  • The changes reflect applied adyen-openapi commits, indicating an update based on API specification changes.
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 updates services and models for the transfers service, apparently from an automated code generation process. The changes include refactoring the Counterparty model into more specific GrantCounterparty and GrantInfoCounterparty types, adding a new InterchangeData model, and updating various enums.

While the changes are mostly consistent, I've identified a critical issue in how discriminated unions are handled. The ObjectSerializer will fail to deserialize types like TransferEventEventsDataInner because the necessary mapping from discriminator values to type names is missing. This appears to be a bug in the code generator that affects all discriminated unions and will lead to runtime errors. Please see the specific comment for details on the issue and how to fix it.

* @export
*/
export type TransferEventEventsDataInner = IssuingTransactionData | MerchantPurchaseData;
export type TransferEventEventsDataInner = InterchangeData | IssuingTransactionData | MerchantPurchaseData;
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The discriminated union TransferEventEventsDataInner will not be deserialized correctly because the mapping in TransferEventEventsDataInnerClass is missing. The ObjectSerializer relies on this mapping to resolve the correct type based on the type discriminator property.

Without the mapping, the serializer will fail to find the concrete class for values like 'interchangeData', 'issuingTransactionData', or 'merchantPurchaseData' because these values don't match the class names (InterchangeData, IssuingTransactionData, MerchantPurchaseData) in the typeMap.

This seems to be a general issue with the code generator for all discriminated unions.

To fix this, TransferEventEventsDataInnerClass should have a mapping property defined, like this:

export class TransferEventEventsDataInnerClass {
    
    static readonly discriminator: string = "type";

    static readonly mapping: {[index: string]: string} | undefined = {
        "interchangeData": "InterchangeData",
        "issuingTransactionData": "IssuingTransactionData",
        "merchantPurchaseData": "MerchantPurchaseData",
    };
}

This is a critical issue that will cause runtime errors during deserialization.

@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/transfers branch from af884cb to 7f55164 Compare March 6, 2026 10:16
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