Skip to content

Conversation

@gcatanese
Copy link
Contributor

PR to generate the Transfers API and TransferWebhooks models.

Transfers API

  • In UltimatePartyIdentification add fundingInstrument attribute
  • In BankAccountV3 add storedPaymentMethodId attribute
  • In Transfer and TransferData add add enum ReasonEnum.SCHEMEADVICE

Transfer Webhooks

  • In BankAccountV3 add storedPaymentMethodId attribute
  • In Transfer, TransferData and TransferEvent add add enum ReasonEnum.SCHEMEADVICE

All models have been updated to handle the nullable value (Mustache templates have been updated as part of #1603)

@gcatanese gcatanese requested review from a team as code owners December 5, 2025 14:19
@gcatanese gcatanese added Enhancement Indicates new feature requests Feature Indicates a new feature addition and removed Enhancement Indicates new feature requests labels Dec 5, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gcatanese, 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 significantly enhances the data models for the Transfers API and Transfer Webhooks. It introduces a new FundingInstrument model and integrates it into UltimatePartyIdentification, while also adding storedPaymentMethodId to BankAccountV3. Furthermore, it expands the ReasonEnum for transfer-related models with a new SCHEMEADVICE option. A broad underlying change is the implementation of explicit null serialization across many models, which improves the robustness and predictability of API interactions by clearly indicating when optional fields are intentionally set to null.

Highlights

  • New FundingInstrument Model: A new FundingInstrument model has been introduced to represent the source of funds for transfers, including details like card identification, network payment reference, and source of funds type.
  • Enhanced UltimatePartyIdentification: The UltimatePartyIdentification model now includes a fundingInstrument attribute, allowing for more detailed specification of the ultimate party's funding source.
  • BankAccountV3 Update: The BankAccountV3 model has been updated to include a storedPaymentMethodId attribute, providing a unique token for identifying stored bank account details for payouts.
  • Expanded Transfer Reasons: The ReasonEnum within the Transfer, TransferData, and TransferEvent models has been extended with a new value: SCHEMEADVICE, to cover additional transfer scenarios.
  • Explicit Null Serialization: Numerous models across both the Transfers API and Transfer Webhooks have been updated to explicitly handle null values during JSON serialization. This involves adding isSet flags for each attribute and a getExplicitNulls() method, ensuring consistent API behavior when dealing with optional fields.
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 a mechanism for handling nullable fields during JSON serialization across a large number of model classes, which is essential for PATCH-like API operations. This is achieved by adding isSet... flags for each property and a getExplicitNulls() method that leverages Jackson's @JsonAnyGetter. The changes are consistent and appear to be auto-generated, which is appropriate for this kind of widespread modification. The overall approach is sound. I've included a few minor suggestions to improve efficiency by pre-sizing HashMap instances in the generated getExplicitNulls() methods, which could be beneficial if these objects are instantiated frequently.

@gcatanese gcatanese requested a review from galesky-a December 5, 2025 14:53
* Sets whether attributes with null values should be explicitly included in the JSON payload.
* Default is false.
*/
@JsonIgnore private boolean includeNullValues = false;

Choose a reason for hiding this comment

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

Would it be easy to not add this to webhooks actually ? They don't make a lot of sense since the SDK would be in the receiving end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. The advantage now is consistent generation across all models, but we can customise it to target only the API models. It introduces a custom behavior, but this code is typically easy to understand and we can add tests to check the generated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Indicates a new feature addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants