[transfers] Code generation: update services and models#1978
[transfers] Code generation: update services and models#1978AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the CashOut feature to the Transfers API, adding several new model classes (such as CashOut, CashOutInfo, and CashOutTransfer), a standardized error response model, and a new CashOutApi service to initiate cashouts. Additionally, the CapitalApi service has been renamed to CapitalDeprecatedApi, and some Javadoc descriptions in Transfer and TransferData were updated. Feedback on these changes highlights two key issues: first, renaming CapitalApi to CapitalDeprecatedApi introduces a breaking change for existing integrations, so it is recommended to retain the original class name and mark it as @deprecated instead; second, a null check should be added to CashOutApi.initiateCashout for the required cashOutInfo parameter to prevent a potential NullPointerException.
| public CashOut initiateCashout(CashOutInfo cashOutInfo, RequestOptions requestOptions) | ||
| throws ApiException, IOException { | ||
| String requestBody = cashOutInfo.toJson(); |
There was a problem hiding this comment.
The cashOutInfo parameter is marked as required, but there is no null check before calling cashOutInfo.toJson(). If a caller passes null, this will throw a NullPointerException. It is safer to validate the input and throw an IllegalArgumentException with a clear error message.
| public CashOut initiateCashout(CashOutInfo cashOutInfo, RequestOptions requestOptions) | |
| throws ApiException, IOException { | |
| String requestBody = cashOutInfo.toJson(); | |
| public CashOut initiateCashout(CashOutInfo cashOutInfo, RequestOptions requestOptions) | |
| throws ApiException, IOException { | |
| if (cashOutInfo == null) { | |
| throw new IllegalArgumentException("Please provide the cashOutInfo parameter"); | |
| } | |
| String requestBody = cashOutInfo.toJson(); |
| import java.util.Map; | ||
|
|
||
| public class CapitalApi extends Service { | ||
| public class CapitalDeprecatedApi extends Service { |
There was a problem hiding this comment.
This PR contains the automated changes for the
transfersservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.