Skip to content

Commit bf1be30

Browse files
false[adyen-sdk-automation] automated change
1 parent 46d0a7c commit bf1be30

File tree

1,301 files changed

+99202
-138480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,301 files changed

+99202
-138480
lines changed

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

Lines changed: 128 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -2,145 +2,149 @@
22
* Authentication webhooks
33
*
44
* The version of the OpenAPI document: 1
5-
*
5+
*
66
*
77
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
88
* https://openapi-generator.tech
99
* Do not edit the class manually.
1010
*/
1111

12+
1213
package com.adyen.model.acswebhooks;
1314

14-
import com.fasterxml.jackson.annotation.JsonValue;
15-
import jakarta.ws.rs.core.GenericType;
16-
import java.util.Map;
1715
import java.util.Objects;
16+
import java.util.Map;
17+
import jakarta.ws.rs.core.GenericType;
1818

19-
/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */
19+
import com.fasterxml.jackson.annotation.JsonValue;
20+
21+
/**
22+
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
23+
*/
2024
public abstract class AbstractOpenApiSchema {
2125

22-
// store the actual instance of the schema/object
23-
private Object instance;
24-
25-
// is nullable
26-
private Boolean isNullable;
27-
28-
// schema type (e.g. oneOf, anyOf)
29-
private final String schemaType;
30-
31-
/**
32-
* @param schemaType the schema type
33-
* @param isNullable whether the instance is nullable
34-
*/
35-
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
36-
this.schemaType = schemaType;
37-
this.isNullable = isNullable;
38-
}
39-
40-
/**
41-
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
42-
*
43-
* @return an instance of the actual schema/object
44-
*/
45-
public abstract Map<String, GenericType<?>> getSchemas();
46-
47-
/**
48-
* Get the actual instance
49-
*
50-
* @return an instance of the actual schema/object
51-
*/
52-
@JsonValue
53-
public Object getActualInstance() {
54-
return instance;
55-
}
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) {
63-
this.instance = instance;
64-
}
65-
66-
/**
67-
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf
68-
* schema as well
69-
*
70-
* @return an instance of the actual schema/object
71-
*/
72-
public Object getActualInstanceRecursively() {
73-
return getActualInstanceRecursively(this);
74-
}
75-
76-
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
77-
if (object.getActualInstance() == null) {
78-
return null;
79-
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
80-
return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance());
81-
} else {
82-
return object.getActualInstance();
26+
// store the actual instance of the schema/object
27+
private Object instance;
28+
29+
// is nullable
30+
private Boolean isNullable;
31+
32+
// schema type (e.g. oneOf, anyOf)
33+
private final String schemaType;
34+
35+
/**
36+
*
37+
* @param schemaType the schema type
38+
* @param isNullable whether the instance is nullable
39+
*/
40+
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
41+
this.schemaType = schemaType;
42+
this.isNullable = isNullable;
8343
}
84-
}
85-
86-
/**
87-
* Get the schema type (e.g. anyOf, oneOf)
88-
*
89-
* @return the schema type
90-
*/
91-
public String getSchemaType() {
92-
return schemaType;
93-
}
94-
95-
@Override
96-
public String toString() {
97-
StringBuilder sb = new StringBuilder();
98-
sb.append("class ").append(getClass()).append(" {\n");
99-
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
100-
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
101-
sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n");
102-
sb.append("}");
103-
return sb.toString();
104-
}
105-
106-
/**
107-
* Convert the given object to string with each line indented by 4 spaces (except the first line).
108-
*/
109-
private String toIndentedString(Object o) {
110-
if (o == null) {
111-
return "null";
44+
45+
/**
46+
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
47+
*
48+
* @return an instance of the actual schema/object
49+
*/
50+
public abstract Map<String, GenericType<?>> getSchemas();
51+
52+
/**
53+
* Get the actual instance
54+
*
55+
* @return an instance of the actual schema/object
56+
*/
57+
@JsonValue
58+
public Object getActualInstance() {return instance;}
59+
60+
/**
61+
* Set the actual instance
62+
*
63+
* @param instance the actual instance of the schema/object
64+
*/
65+
public void setActualInstance(Object instance) {this.instance = instance;}
66+
67+
/**
68+
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
69+
*
70+
* @return an instance of the actual schema/object
71+
*/
72+
public Object getActualInstanceRecursively() {
73+
return getActualInstanceRecursively(this);
11274
}
113-
return o.toString().replace("\n", "\n ");
114-
}
11575

116-
public boolean equals(Object o) {
117-
if (this == o) {
118-
return true;
76+
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
77+
if (object.getActualInstance() == null) {
78+
return null;
79+
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
80+
return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
81+
} else {
82+
return object.getActualInstance();
83+
}
11984
}
120-
if (o == null || getClass() != o.getClass()) {
121-
return false;
85+
86+
/**
87+
* Get the schema type (e.g. anyOf, oneOf)
88+
*
89+
* @return the schema type
90+
*/
91+
public String getSchemaType() {
92+
return schemaType;
93+
}
94+
95+
@Override
96+
public String toString() {
97+
StringBuilder sb = new StringBuilder();
98+
sb.append("class ").append(getClass()).append(" {\n");
99+
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
100+
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
101+
sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n");
102+
sb.append("}");
103+
return sb.toString();
122104
}
123-
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
124-
return Objects.equals(this.instance, a.instance)
125-
&& Objects.equals(this.isNullable, a.isNullable)
126-
&& Objects.equals(this.schemaType, a.schemaType);
127-
}
128-
129-
@Override
130-
public int hashCode() {
131-
return Objects.hash(instance, isNullable, schemaType);
132-
}
133-
134-
/**
135-
* Is nullable
136-
*
137-
* @return true if it's nullable
138-
*/
139-
public Boolean isNullable() {
140-
if (Boolean.TRUE.equals(isNullable)) {
141-
return Boolean.TRUE;
142-
} else {
143-
return Boolean.FALSE;
105+
106+
/**
107+
* Convert the given object to string with each line indented by 4 spaces
108+
* (except the first line).
109+
*/
110+
private String toIndentedString(Object o) {
111+
if (o == null) {
112+
return "null";
113+
}
114+
return o.toString().replace("\n", "\n ");
144115
}
145-
}
146-
}
116+
117+
public boolean equals(Object o) {
118+
if (this == o) {
119+
return true;
120+
}
121+
if (o == null || getClass() != o.getClass()) {
122+
return false;
123+
}
124+
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
125+
return Objects.equals(this.instance, a.instance) &&
126+
Objects.equals(this.isNullable, a.isNullable) &&
127+
Objects.equals(this.schemaType, a.schemaType);
128+
}
129+
130+
@Override
131+
public int hashCode() {
132+
return Objects.hash(instance, isNullable, schemaType);
133+
}
134+
135+
/**
136+
* Is nullable
137+
*
138+
* @return true if it's nullable
139+
*/
140+
public Boolean isNullable() {
141+
if (Boolean.TRUE.equals(isNullable)) {
142+
return Boolean.TRUE;
143+
} else {
144+
return Boolean.FALSE;
145+
}
146+
}
147+
148+
149+
150+
}

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

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Authentication webhooks
33
*
44
* The version of the OpenAPI document: 1
5-
*
5+
*
66
*
77
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
88
* https://openapi-generator.tech
@@ -16,58 +16,59 @@
1616

1717
/**
1818
* Handler for processing AcsWebhooks.
19-
*
20-
* <p>This class provides functionality to deserialize the payload of AcsWebhooks events.
19+
* <p>
20+
* This class provides functionality to deserialize the payload of AcsWebhooks events.
2121
*/
2222
public class AcsWebhooksHandler {
2323

24-
private static final Logger LOG = Logger.getLogger(AcsWebhooksHandler.class.getName());
24+
private static final Logger LOG = Logger.getLogger(AcsWebhooksHandler.class.getName());
2525

26-
private final String payload;
26+
private final String payload;
2727

28-
/**
29-
* Constructs a new handler for the given webhook payload
30-
*
31-
* @param payload the raw JSON payload from the webhook
32-
*/
33-
public AcsWebhooksHandler(String payload) {
34-
this.payload = payload;
35-
}
28+
/**
29+
* Constructs a new handler for the given webhook payload
30+
*
31+
* @param payload the raw JSON payload from the webhook
32+
*/
33+
public AcsWebhooksHandler(String payload) {
34+
this.payload = payload;
35+
}
3636

37-
/**
38-
* Attempts to deserialize the webhook payload into a AuthenticationNotificationRequest
39-
*
40-
* @return an Optional containing the deserialized object, or empty if deserialization fails
41-
*/
42-
public Optional<AuthenticationNotificationRequest> getAuthenticationNotificationRequest() {
43-
return getOptionalField(AuthenticationNotificationRequest.class);
44-
}
37+
/**
38+
* Attempts to deserialize the webhook payload into a AuthenticationNotificationRequest
39+
*
40+
* @return an Optional containing the deserialized object, or empty if deserialization fails
41+
*/
42+
public Optional<AuthenticationNotificationRequest> getAuthenticationNotificationRequest() {
43+
return getOptionalField(AuthenticationNotificationRequest.class);
44+
}
4545

46-
/**
47-
* Attempts to deserialize the webhook payload into a RelayedAuthenticationRequest
48-
*
49-
* @return an Optional containing the deserialized object, or empty if deserialization fails
50-
*/
51-
public Optional<RelayedAuthenticationRequest> getRelayedAuthenticationRequest() {
52-
return getOptionalField(RelayedAuthenticationRequest.class);
53-
}
46+
/**
47+
* Attempts to deserialize the webhook payload into a RelayedAuthenticationRequest
48+
*
49+
* @return an Optional containing the deserialized object, or empty if deserialization fails
50+
*/
51+
public Optional<RelayedAuthenticationRequest> getRelayedAuthenticationRequest() {
52+
return getOptionalField(RelayedAuthenticationRequest.class);
53+
}
5454

55-
/**
56-
* Deserializes the payload into the specified class type.
57-
*
58-
* @param clazz the class to deserialize into
59-
* @param <T> the type of the class
60-
* @return an Optional containing the deserialized object, or empty if an error occurs
61-
*/
62-
private <T> Optional<T> getOptionalField(Class<T> clazz) {
63-
try {
64-
T val = JSON.getMapper().readValue(payload, clazz);
65-
return Optional.ofNullable(val);
66-
} catch (Exception e) {
67-
// an error has occurred during deserialization (object not found, deserialization error)
68-
LOG.warning("Object not found or unexpected error trying to access: " + clazz.getName());
69-
LOG.warning("Deserialization error: " + e.getMessage());
70-
return Optional.empty();
55+
/**
56+
* Deserializes the payload into the specified class type.
57+
*
58+
* @param clazz the class to deserialize into
59+
* @param <T> the type of the class
60+
* @return an Optional containing the deserialized object, or empty if an error occurs
61+
*/
62+
private <T> Optional<T> getOptionalField(Class<T> clazz) {
63+
try {
64+
T val = JSON.getMapper().readValue(payload, clazz);
65+
return Optional.ofNullable(val);
66+
} catch (Exception e) {
67+
// an error has occurred during deserialization (object not found, deserialization error)
68+
LOG.warning("Object not found or unexpected error trying to access: " + clazz.getName());
69+
LOG.warning("Deserialization error: " + e.getMessage());
70+
return Optional.empty();
71+
}
7172
}
72-
}
73-
}
73+
74+
}

0 commit comments

Comments
 (0)