Skip to content

Commit f884f5d

Browse files
Code generation: update services and models (#1423)
* false[adyen-sdk-automation] automated change * Add NegativeBalanceCompensationWarningNotificationRequest handler, improve logging * Add and refactor unit tests for NegativeBalanceWarning webhooks * Add NegativeBalanceWarning webhooks in README --------- Co-authored-by: gcatanese <[email protected]>
1 parent b49b20f commit f884f5d

19 files changed

+2244
-85
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ The library supports all webhooks under the following model directories:
4444
| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/2/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [configurationwebhooks](src/main/java/com/adyen/model/configurationwebhooks) | **v2** |
4545
| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [transferwebhooks](src/main/java/com/adyen/model/transferwebhooks) | **v4** |
4646
| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [reportwebhooks](src/main/java/com/adyen/model/reportwebhooks) | **v1** |
47+
| [Negative Balance Warning Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen sends this webhook to inform you about a balance account whose balance has been negative for a given number of days. | [negativebalancewarningwebhooks](src/main/java/com/adyen/model/negativebalancewarningwebhooks) | **v1** |
4748
| [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [notification](src/main/java/com/adyen/model/notification) | **v1** |
4849
| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API | [managementwebhooks](src/main/java/com/adyen/model/managementwebhooks) | **v3** |
4950
| [Classic Platform Webhooks](https://docs.adyen.com/api-explorer/Notification/6/overview#retry) | The Notification API sends notifications to the endpoints specified in a given subscription. Subscriptions are managed through the Notification Configuration API. The API specifications listed here detail the format of each notification. | [marketpaywebhooks](src/main/java/com/adyen/model/marketpaywebhooks) | **v6** |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
/*
2+
* Negative balance compensation warning
3+
*
4+
* The version of the OpenAPI document: 1
5+
*
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
13+
package com.adyen.model.negativebalancewarningwebhooks;
14+
15+
import java.util.Objects;
16+
import java.lang.reflect.Type;
17+
import java.util.Map;
18+
import jakarta.ws.rs.core.GenericType;
19+
20+
import com.fasterxml.jackson.annotation.JsonValue;
21+
22+
/**
23+
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
24+
*/
25+
26+
public abstract class AbstractOpenApiSchema {
27+
28+
// store the actual instance of the schema/object
29+
private Object instance;
30+
31+
// is nullable
32+
private Boolean isNullable;
33+
34+
// schema type (e.g. oneOf, anyOf)
35+
private final String schemaType;
36+
37+
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
38+
this.schemaType = schemaType;
39+
this.isNullable = isNullable;
40+
}
41+
42+
/**
43+
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
44+
*
45+
* @return an instance of the actual schema/object
46+
*/
47+
public abstract Map<String, GenericType> getSchemas();
48+
49+
/**
50+
* Get the actual instance
51+
*
52+
* @return an instance of the actual schema/object
53+
*/
54+
@JsonValue
55+
public Object getActualInstance() {return instance;}
56+
57+
/**
58+
* Set the actual instance
59+
*
60+
* @param instance the actual instance of the schema/object
61+
*/
62+
public void setActualInstance(Object instance) {this.instance = instance;}
63+
64+
/**
65+
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
66+
*
67+
* @return an instance of the actual schema/object
68+
*/
69+
public Object getActualInstanceRecursively() {
70+
return getActualInstanceRecursively(this);
71+
}
72+
73+
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
74+
if (object.getActualInstance() == null) {
75+
return null;
76+
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
77+
return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
78+
} else {
79+
return object.getActualInstance();
80+
}
81+
}
82+
83+
/**
84+
* Get the schema type (e.g. anyOf, oneOf)
85+
*
86+
* @return the schema type
87+
*/
88+
public String getSchemaType() {
89+
return schemaType;
90+
}
91+
92+
@Override
93+
public String toString() {
94+
StringBuilder sb = new StringBuilder();
95+
sb.append("class ").append(getClass()).append(" {\n");
96+
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
97+
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
98+
sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n");
99+
sb.append("}");
100+
return sb.toString();
101+
}
102+
103+
/**
104+
* Convert the given object to string with each line indented by 4 spaces
105+
* (except the first line).
106+
*/
107+
private String toIndentedString(Object o) {
108+
if (o == null) {
109+
return "null";
110+
}
111+
return o.toString().replace("\n", "\n ");
112+
}
113+
114+
public boolean equals(Object o) {
115+
if (this == o) {
116+
return true;
117+
}
118+
if (o == null || getClass() != o.getClass()) {
119+
return false;
120+
}
121+
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
122+
return Objects.equals(this.instance, a.instance) &&
123+
Objects.equals(this.isNullable, a.isNullable) &&
124+
Objects.equals(this.schemaType, a.schemaType);
125+
}
126+
127+
@Override
128+
public int hashCode() {
129+
return Objects.hash(instance, isNullable, schemaType);
130+
}
131+
132+
/**
133+
* Is nullable
134+
*
135+
* @return true if it's nullable
136+
*/
137+
public Boolean isNullable() {
138+
if (Boolean.TRUE.equals(isNullable)) {
139+
return Boolean.TRUE;
140+
} else {
141+
return Boolean.FALSE;
142+
}
143+
}
144+
145+
146+
147+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
/*
2+
* Negative balance compensation warning
3+
*
4+
* The version of the OpenAPI document: 1
5+
*
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
13+
package com.adyen.model.negativebalancewarningwebhooks;
14+
15+
import java.util.Objects;
16+
import java.util.Arrays;
17+
import java.util.Map;
18+
import java.util.HashMap;
19+
import com.fasterxml.jackson.annotation.JsonInclude;
20+
import com.fasterxml.jackson.annotation.JsonProperty;
21+
import com.fasterxml.jackson.annotation.JsonCreator;
22+
import com.fasterxml.jackson.annotation.JsonTypeName;
23+
import com.fasterxml.jackson.annotation.JsonValue;
24+
import io.swagger.annotations.ApiModel;
25+
import io.swagger.annotations.ApiModelProperty;
26+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
27+
import com.fasterxml.jackson.core.JsonProcessingException;
28+
29+
30+
/**
31+
* Amount
32+
*/
33+
@JsonPropertyOrder({
34+
Amount.JSON_PROPERTY_CURRENCY,
35+
Amount.JSON_PROPERTY_VALUE
36+
})
37+
38+
public class Amount {
39+
public static final String JSON_PROPERTY_CURRENCY = "currency";
40+
private String currency;
41+
42+
public static final String JSON_PROPERTY_VALUE = "value";
43+
private Long value;
44+
45+
public Amount() {
46+
}
47+
48+
/**
49+
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
50+
*
51+
* @param currency
52+
* @return the current {@code Amount} instance, allowing for method chaining
53+
*/
54+
public Amount currency(String currency) {
55+
this.currency = currency;
56+
return this;
57+
}
58+
59+
/**
60+
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
61+
* @return currency
62+
*/
63+
@ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).")
64+
@JsonProperty(JSON_PROPERTY_CURRENCY)
65+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
66+
public String getCurrency() {
67+
return currency;
68+
}
69+
70+
/**
71+
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
72+
*
73+
* @param currency
74+
*/
75+
@JsonProperty(JSON_PROPERTY_CURRENCY)
76+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
77+
public void setCurrency(String currency) {
78+
this.currency = currency;
79+
}
80+
81+
/**
82+
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
83+
*
84+
* @param value
85+
* @return the current {@code Amount} instance, allowing for method chaining
86+
*/
87+
public Amount value(Long value) {
88+
this.value = value;
89+
return this;
90+
}
91+
92+
/**
93+
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
94+
* @return value
95+
*/
96+
@ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).")
97+
@JsonProperty(JSON_PROPERTY_VALUE)
98+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
99+
public Long getValue() {
100+
return value;
101+
}
102+
103+
/**
104+
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
105+
*
106+
* @param value
107+
*/
108+
@JsonProperty(JSON_PROPERTY_VALUE)
109+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
110+
public void setValue(Long value) {
111+
this.value = value;
112+
}
113+
114+
/**
115+
* Return true if this Amount object is equal to o.
116+
*/
117+
@Override
118+
public boolean equals(Object o) {
119+
if (this == o) {
120+
return true;
121+
}
122+
if (o == null || getClass() != o.getClass()) {
123+
return false;
124+
}
125+
Amount amount = (Amount) o;
126+
return Objects.equals(this.currency, amount.currency) &&
127+
Objects.equals(this.value, amount.value);
128+
}
129+
130+
@Override
131+
public int hashCode() {
132+
return Objects.hash(currency, value);
133+
}
134+
135+
@Override
136+
public String toString() {
137+
StringBuilder sb = new StringBuilder();
138+
sb.append("class Amount {\n");
139+
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
140+
sb.append(" value: ").append(toIndentedString(value)).append("\n");
141+
sb.append("}");
142+
return sb.toString();
143+
}
144+
145+
/**
146+
* Convert the given object to string with each line indented by 4 spaces
147+
* (except the first line).
148+
*/
149+
private String toIndentedString(Object o) {
150+
if (o == null) {
151+
return "null";
152+
}
153+
return o.toString().replace("\n", "\n ");
154+
}
155+
156+
/**
157+
* Create an instance of Amount given an JSON string
158+
*
159+
* @param jsonString JSON string
160+
* @return An instance of Amount
161+
* @throws JsonProcessingException if the JSON string is invalid with respect to Amount
162+
*/
163+
public static Amount fromJson(String jsonString) throws JsonProcessingException {
164+
return JSON.getMapper().readValue(jsonString, Amount.class);
165+
}
166+
/**
167+
* Convert an instance of Amount to an JSON string
168+
*
169+
* @return JSON string
170+
*/
171+
public String toJson() throws JsonProcessingException {
172+
return JSON.getMapper().writeValueAsString(this);
173+
}
174+
}

0 commit comments

Comments
 (0)