-
Notifications
You must be signed in to change notification settings - Fork 147
[transferwebhooks] Code generation: update services and models #1726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AdyenAutomationBot
wants to merge
1
commit into
main
Choose a base branch
from
sdk-automation/transferwebhooks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
263 changes: 263 additions & 0 deletions
263
src/main/java/com/adyen/model/transferwebhooks/InterchangeData.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,263 @@ | ||
| /* | ||
| * Transfer webhooks | ||
| * | ||
| * The version of the OpenAPI document: 4 | ||
| * | ||
| * | ||
| * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
| * https://openapi-generator.tech | ||
| * Do not edit the class manually. | ||
| */ | ||
|
|
||
| package com.adyen.model.transferwebhooks; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import com.fasterxml.jackson.annotation.JsonValue; | ||
| import com.fasterxml.jackson.core.JsonProcessingException; | ||
| import java.util.*; | ||
| import java.util.Arrays; | ||
| import java.util.logging.Logger; | ||
|
|
||
| /** InterchangeData */ | ||
| @JsonPropertyOrder({ | ||
| InterchangeData.JSON_PROPERTY_INTERCHANGE_AMOUNT, | ||
| InterchangeData.JSON_PROPERTY_INTERCHANGE_RATE_INDICATOR, | ||
| InterchangeData.JSON_PROPERTY_TYPE | ||
| }) | ||
| public class InterchangeData { | ||
| public static final String JSON_PROPERTY_INTERCHANGE_AMOUNT = "interchangeAmount"; | ||
| private Amount interchangeAmount; | ||
|
|
||
| public static final String JSON_PROPERTY_INTERCHANGE_RATE_INDICATOR = "interchangeRateIndicator"; | ||
| private String interchangeRateIndicator; | ||
|
|
||
| /** | ||
| * The type of events data. Possible values: - **interchangeData**: information about the | ||
| * interchange fee applied to a transaction. | ||
| */ | ||
| public enum TypeEnum { | ||
| INTERCHANGEDATA(String.valueOf("interchangeData")); | ||
|
|
||
| private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); | ||
|
|
||
| private String value; | ||
|
|
||
| TypeEnum(String value) { | ||
| this.value = value; | ||
| } | ||
|
|
||
| @JsonValue | ||
| public String getValue() { | ||
| return value; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return String.valueOf(value); | ||
| } | ||
|
|
||
| @JsonCreator | ||
| public static TypeEnum fromValue(String value) { | ||
| for (TypeEnum b : TypeEnum.values()) { | ||
| if (b.value.equals(value)) { | ||
| return b; | ||
| } | ||
| } | ||
| // handling unexpected value | ||
| LOG.warning( | ||
| "TypeEnum: unexpected enum value '" | ||
| + value | ||
| + "' - Supported values are " | ||
| + Arrays.toString(TypeEnum.values())); | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| public static final String JSON_PROPERTY_TYPE = "type"; | ||
| private TypeEnum type; | ||
|
|
||
| public InterchangeData() {} | ||
|
|
||
| /** | ||
| * interchangeAmount | ||
| * | ||
| * @param interchangeAmount | ||
| * @return the current {@code InterchangeData} instance, allowing for method chaining | ||
| */ | ||
| public InterchangeData interchangeAmount(Amount interchangeAmount) { | ||
| this.interchangeAmount = interchangeAmount; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Get interchangeAmount | ||
| * | ||
| * @return interchangeAmount | ||
| */ | ||
| @JsonProperty(JSON_PROPERTY_INTERCHANGE_AMOUNT) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public Amount getInterchangeAmount() { | ||
| return interchangeAmount; | ||
| } | ||
|
|
||
| /** | ||
| * interchangeAmount | ||
| * | ||
| * @param interchangeAmount | ||
| */ | ||
| @JsonProperty(JSON_PROPERTY_INTERCHANGE_AMOUNT) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public void setInterchangeAmount(Amount interchangeAmount) { | ||
| this.interchangeAmount = interchangeAmount; | ||
| } | ||
|
|
||
| /** | ||
| * A 3-character alphanumeric code assigned by Visa that identifies the specific interchange | ||
| * reimbursement program a transaction qualified for. The code is assigned based on the card type, | ||
| * entry mode, and security data provided. | ||
| * | ||
| * @param interchangeRateIndicator A 3-character alphanumeric code assigned by Visa that | ||
| * identifies the specific interchange reimbursement program a transaction qualified for. The | ||
| * code is assigned based on the card type, entry mode, and security data provided. | ||
| * @return the current {@code InterchangeData} instance, allowing for method chaining | ||
| */ | ||
| public InterchangeData interchangeRateIndicator(String interchangeRateIndicator) { | ||
| this.interchangeRateIndicator = interchangeRateIndicator; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * A 3-character alphanumeric code assigned by Visa that identifies the specific interchange | ||
| * reimbursement program a transaction qualified for. The code is assigned based on the card type, | ||
| * entry mode, and security data provided. | ||
| * | ||
| * @return interchangeRateIndicator A 3-character alphanumeric code assigned by Visa that | ||
| * identifies the specific interchange reimbursement program a transaction qualified for. The | ||
| * code is assigned based on the card type, entry mode, and security data provided. | ||
| */ | ||
| @JsonProperty(JSON_PROPERTY_INTERCHANGE_RATE_INDICATOR) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public String getInterchangeRateIndicator() { | ||
| return interchangeRateIndicator; | ||
| } | ||
|
|
||
| /** | ||
| * A 3-character alphanumeric code assigned by Visa that identifies the specific interchange | ||
| * reimbursement program a transaction qualified for. The code is assigned based on the card type, | ||
| * entry mode, and security data provided. | ||
| * | ||
| * @param interchangeRateIndicator A 3-character alphanumeric code assigned by Visa that | ||
| * identifies the specific interchange reimbursement program a transaction qualified for. The | ||
| * code is assigned based on the card type, entry mode, and security data provided. | ||
| */ | ||
| @JsonProperty(JSON_PROPERTY_INTERCHANGE_RATE_INDICATOR) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public void setInterchangeRateIndicator(String interchangeRateIndicator) { | ||
| this.interchangeRateIndicator = interchangeRateIndicator; | ||
| } | ||
|
|
||
| /** | ||
| * The type of events data. Possible values: - **interchangeData**: information about the | ||
| * interchange fee applied to a transaction. | ||
| * | ||
| * @param type The type of events data. Possible values: - **interchangeData**: information about | ||
| * the interchange fee applied to a transaction. | ||
| * @return the current {@code InterchangeData} instance, allowing for method chaining | ||
| */ | ||
| public InterchangeData type(TypeEnum type) { | ||
| this.type = type; | ||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * The type of events data. Possible values: - **interchangeData**: information about the | ||
| * interchange fee applied to a transaction. | ||
| * | ||
| * @return type The type of events data. Possible values: - **interchangeData**: information about | ||
| * the interchange fee applied to a transaction. | ||
| */ | ||
| @JsonProperty(JSON_PROPERTY_TYPE) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public TypeEnum getType() { | ||
| return type; | ||
| } | ||
|
|
||
| /** | ||
| * The type of events data. Possible values: - **interchangeData**: information about the | ||
| * interchange fee applied to a transaction. | ||
| * | ||
| * @param type The type of events data. Possible values: - **interchangeData**: information about | ||
| * the interchange fee applied to a transaction. | ||
| */ | ||
| @JsonProperty(JSON_PROPERTY_TYPE) | ||
| @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) | ||
| public void setType(TypeEnum type) { | ||
| this.type = type; | ||
| } | ||
|
|
||
| /** Return true if this InterchangeData object is equal to o. */ | ||
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) { | ||
| return true; | ||
| } | ||
| if (o == null || getClass() != o.getClass()) { | ||
| return false; | ||
| } | ||
| InterchangeData interchangeData = (InterchangeData) o; | ||
| return Objects.equals(this.interchangeAmount, interchangeData.interchangeAmount) | ||
| && Objects.equals(this.interchangeRateIndicator, interchangeData.interchangeRateIndicator) | ||
| && Objects.equals(this.type, interchangeData.type); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hash(interchangeAmount, interchangeRateIndicator, type); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| StringBuilder sb = new StringBuilder(); | ||
| sb.append("class InterchangeData {\n"); | ||
| sb.append(" interchangeAmount: ").append(toIndentedString(interchangeAmount)).append("\n"); | ||
| sb.append(" interchangeRateIndicator: ") | ||
| .append(toIndentedString(interchangeRateIndicator)) | ||
| .append("\n"); | ||
| sb.append(" type: ").append(toIndentedString(type)).append("\n"); | ||
| sb.append("}"); | ||
| return sb.toString(); | ||
| } | ||
|
|
||
| /** | ||
| * Convert the given object to string with each line indented by 4 spaces (except the first line). | ||
| */ | ||
| private String toIndentedString(Object o) { | ||
| if (o == null) { | ||
| return "null"; | ||
| } | ||
| return o.toString().replace("\n", "\n "); | ||
| } | ||
|
|
||
| /** | ||
| * Create an instance of InterchangeData given an JSON string | ||
| * | ||
| * @param jsonString JSON string | ||
| * @return An instance of InterchangeData | ||
| * @throws JsonProcessingException if the JSON string is invalid with respect to InterchangeData | ||
| */ | ||
| public static InterchangeData fromJson(String jsonString) throws JsonProcessingException { | ||
| return JSON.getMapper().readValue(jsonString, InterchangeData.class); | ||
| } | ||
|
|
||
| /** | ||
| * Convert an instance of InterchangeData to an JSON string | ||
| * | ||
| * @return JSON string | ||
| */ | ||
| public String toJson() throws JsonProcessingException { | ||
| return JSON.getMapper().writeValueAsString(this); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -362,6 +362,8 @@ public enum StatusEnum { | |
|
|
||
| FEEPENDING(String.valueOf("feePending")), | ||
|
|
||
| INTERCHANGEADJUSTED(String.valueOf("interchangeAdjusted")), | ||
|
|
||
| INTERNALTRANSFER(String.valueOf("internalTransfer")), | ||
|
|
||
| INTERNALTRANSFERPENDING(String.valueOf("internalTransferPending")), | ||
|
|
@@ -474,6 +476,8 @@ public static StatusEnum fromValue(String value) { | |
| public enum TypeEnum { | ||
| ACCOUNTING(String.valueOf("accounting")), | ||
|
|
||
| TRACING(String.valueOf("tracing")), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the addition of the Suggested Javadoc: /** The type of the transfer event. Possible values: **accounting**, **tracing**, **tracking**. */ |
||
|
|
||
| TRACKING(String.valueOf("tracking")); | ||
|
|
||
| private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning
nullfor an unknown enum value can lead toNullPointerExceptions in consuming code if not handled carefully. It's generally safer to fail fast by throwing an exception for unknown values. Consider throwing anIllegalArgumentExceptioninstead.