Skip to content

Commit c8dd7b4

Browse files
authored
ACS webhooks update: RelayedAuthenticationRequest event code (#1449)
* Update ACS webhook models * Add unit tests
1 parent 98910b5 commit c8dd7b4

18 files changed

+1175
-196
lines changed

src/main/java/com/adyen/model/acswebhooks/AbstractOpenApiSchema.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
package com.adyen.model.acswebhooks;
1414

1515
import java.util.Objects;
16-
import java.lang.reflect.Type;
1716
import java.util.Map;
1817
import jakarta.ws.rs.core.GenericType;
1918

@@ -44,7 +43,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
4443
*
4544
* @return an instance of the actual schema/object
4645
*/
47-
public abstract Map<String, GenericType> getSchemas();
46+
public abstract Map<String, GenericType<?>> getSchemas();
4847

4948
/**
5049
* Get the actual instance
@@ -144,4 +143,4 @@ public Boolean isNullable() {
144143

145144

146145

147-
}
146+
}

src/main/java/com/adyen/model/acswebhooks/Amount.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
1313
package com.adyen.model.acswebhooks;
1414

1515
import java.util.Objects;
16-
import java.util.Arrays;
1716
import java.util.Map;
1817
import java.util.HashMap;
1918
import com.fasterxml.jackson.annotation.JsonInclude;
2019
import com.fasterxml.jackson.annotation.JsonProperty;
2120
import com.fasterxml.jackson.annotation.JsonCreator;
2221
import com.fasterxml.jackson.annotation.JsonTypeName;
2322
import com.fasterxml.jackson.annotation.JsonValue;
24-
import io.swagger.annotations.ApiModel;
25-
import io.swagger.annotations.ApiModelProperty;
23+
import java.util.Arrays;
2624
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
2725
import com.fasterxml.jackson.core.JsonProcessingException;
2826

@@ -60,7 +58,6 @@ public Amount currency(String currency) {
6058
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
6159
* @return currency
6260
*/
63-
@ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).")
6461
@JsonProperty(JSON_PROPERTY_CURRENCY)
6562
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
6663
public String getCurrency() {
@@ -71,7 +68,7 @@ public String getCurrency() {
7168
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
7269
*
7370
* @param currency
74-
*/
71+
*/
7572
@JsonProperty(JSON_PROPERTY_CURRENCY)
7673
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
7774
public void setCurrency(String currency) {
@@ -93,7 +90,6 @@ public Amount value(Long value) {
9390
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
9491
* @return value
9592
*/
96-
@ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).")
9793
@JsonProperty(JSON_PROPERTY_VALUE)
9894
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
9995
public Long getValue() {
@@ -104,7 +100,7 @@ public Long getValue() {
104100
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
105101
*
106102
* @param value
107-
*/
103+
*/
108104
@JsonProperty(JSON_PROPERTY_VALUE)
109105
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
110106
public void setValue(Long value) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
/*
2+
* Authentication webhooks
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.acswebhooks;
14+
15+
import java.util.Objects;
16+
import java.util.Map;
17+
import java.util.HashMap;
18+
import com.fasterxml.jackson.annotation.JsonInclude;
19+
import com.fasterxml.jackson.annotation.JsonProperty;
20+
import com.fasterxml.jackson.annotation.JsonCreator;
21+
import com.fasterxml.jackson.annotation.JsonTypeName;
22+
import com.fasterxml.jackson.annotation.JsonValue;
23+
import java.util.Arrays;
24+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
25+
import com.fasterxml.jackson.core.JsonProcessingException;
26+
27+
28+
/**
29+
* AuthenticationDecision
30+
*/
31+
@JsonPropertyOrder({
32+
AuthenticationDecision.JSON_PROPERTY_STATUS
33+
})
34+
35+
public class AuthenticationDecision {
36+
/**
37+
* The status of the authentication. Possible values: * **refused** * **proceed** For more information, refer to [Authenticate cardholders using the Authentication SDK](https://docs.adyen.com/issuing/3d-secure/oob-auth-sdk/authenticate-cardholders/).
38+
*/
39+
public enum StatusEnum {
40+
PROCEED(String.valueOf("proceed")),
41+
42+
REFUSED(String.valueOf("refused"));
43+
44+
private String value;
45+
46+
StatusEnum(String value) {
47+
this.value = value;
48+
}
49+
50+
@JsonValue
51+
public String getValue() {
52+
return value;
53+
}
54+
55+
@Override
56+
public String toString() {
57+
return String.valueOf(value);
58+
}
59+
60+
@JsonCreator
61+
public static StatusEnum fromValue(String value) {
62+
for (StatusEnum b : StatusEnum.values()) {
63+
if (b.value.equals(value)) {
64+
return b;
65+
}
66+
}
67+
throw new IllegalArgumentException("Unexpected value '" + value + "'");
68+
}
69+
}
70+
71+
public static final String JSON_PROPERTY_STATUS = "status";
72+
private StatusEnum status;
73+
74+
public AuthenticationDecision() {
75+
}
76+
77+
/**
78+
* The status of the authentication. Possible values: * **refused** * **proceed** For more information, refer to [Authenticate cardholders using the Authentication SDK](https://docs.adyen.com/issuing/3d-secure/oob-auth-sdk/authenticate-cardholders/).
79+
*
80+
* @param status
81+
* @return the current {@code AuthenticationDecision} instance, allowing for method chaining
82+
*/
83+
public AuthenticationDecision status(StatusEnum status) {
84+
this.status = status;
85+
return this;
86+
}
87+
88+
/**
89+
* The status of the authentication. Possible values: * **refused** * **proceed** For more information, refer to [Authenticate cardholders using the Authentication SDK](https://docs.adyen.com/issuing/3d-secure/oob-auth-sdk/authenticate-cardholders/).
90+
* @return status
91+
*/
92+
@JsonProperty(JSON_PROPERTY_STATUS)
93+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
94+
public StatusEnum getStatus() {
95+
return status;
96+
}
97+
98+
/**
99+
* The status of the authentication. Possible values: * **refused** * **proceed** For more information, refer to [Authenticate cardholders using the Authentication SDK](https://docs.adyen.com/issuing/3d-secure/oob-auth-sdk/authenticate-cardholders/).
100+
*
101+
* @param status
102+
*/
103+
@JsonProperty(JSON_PROPERTY_STATUS)
104+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
105+
public void setStatus(StatusEnum status) {
106+
this.status = status;
107+
}
108+
109+
/**
110+
* Return true if this AuthenticationDecision object is equal to o.
111+
*/
112+
@Override
113+
public boolean equals(Object o) {
114+
if (this == o) {
115+
return true;
116+
}
117+
if (o == null || getClass() != o.getClass()) {
118+
return false;
119+
}
120+
AuthenticationDecision authenticationDecision = (AuthenticationDecision) o;
121+
return Objects.equals(this.status, authenticationDecision.status);
122+
}
123+
124+
@Override
125+
public int hashCode() {
126+
return Objects.hash(status);
127+
}
128+
129+
@Override
130+
public String toString() {
131+
StringBuilder sb = new StringBuilder();
132+
sb.append("class AuthenticationDecision {\n");
133+
sb.append(" status: ").append(toIndentedString(status)).append("\n");
134+
sb.append("}");
135+
return sb.toString();
136+
}
137+
138+
/**
139+
* Convert the given object to string with each line indented by 4 spaces
140+
* (except the first line).
141+
*/
142+
private String toIndentedString(Object o) {
143+
if (o == null) {
144+
return "null";
145+
}
146+
return o.toString().replace("\n", "\n ");
147+
}
148+
149+
/**
150+
* Create an instance of AuthenticationDecision given an JSON string
151+
*
152+
* @param jsonString JSON string
153+
* @return An instance of AuthenticationDecision
154+
* @throws JsonProcessingException if the JSON string is invalid with respect to AuthenticationDecision
155+
*/
156+
public static AuthenticationDecision fromJson(String jsonString) throws JsonProcessingException {
157+
return JSON.getMapper().readValue(jsonString, AuthenticationDecision.class);
158+
}
159+
/**
160+
* Convert an instance of AuthenticationDecision to an JSON string
161+
*
162+
* @return JSON string
163+
*/
164+
public String toJson() throws JsonProcessingException {
165+
return JSON.getMapper().writeValueAsString(this);
166+
}
167+
}

0 commit comments

Comments
 (0)