Skip to content

Commit fe0fadb

Browse files
authored
Add Session Authentication API (#1435)
* Add SessionAuthentication models * Add SessionAuthentication service * Add unit test * Add missing attribute title
1 parent 4c397a0 commit fe0fadb

19 files changed

+2815
-20
lines changed

src/main/java/com/adyen/model/ApiError.java

Lines changed: 58 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
/*
2-
* Adyen Checkout API
2+
* ######
3+
* ######
4+
* ############ ####( ###### #####. ###### ############ ############
5+
* ############# #####( ###### #####. ###### ############# #############
6+
* ###### #####( ###### #####. ###### ##### ###### ##### ######
7+
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
8+
* ###### ###### #####( ###### #####. ###### ##### ##### ######
9+
* ############# ############# ############# ############# ##### ######
10+
* ############ ############ ############# ############ ##### ######
11+
* ######
12+
* #############
13+
* ############
314
*
4-
* The version of the OpenAPI document: 70
15+
* Adyen Java API Library
516
*
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.
17+
* Copyright (c) 2025 Adyen B.V.
18+
* See the LICENSE file for more info.
1019
*/
11-
12-
1320
package com.adyen.model;
1421

1522
import java.util.*;
@@ -19,9 +26,9 @@
1926
import io.swagger.annotations.ApiModelProperty;
2027
import com.fasterxml.jackson.core.JsonProcessingException;
2128

22-
2329
/**
24-
* ServiceError
30+
* Class that defines the API error model returned when an error (401. 403, 422, etc..) is returned by the API
31+
* Based on the RFC-7807 standard
2532
*/
2633
@JsonPropertyOrder({
2734
ApiError.JSON_PROPERTY_INVALID_FIELDS,
@@ -30,7 +37,8 @@
3037
ApiError.JSON_PROPERTY_ERROR_TYPE,
3138
ApiError.JSON_PROPERTY_MESSAGE,
3239
ApiError.JSON_PROPERTY_PSP_REFERENCE,
33-
ApiError.JSON_PROPERTY_STATUS
40+
ApiError.JSON_PROPERTY_STATUS,
41+
ApiError.JSON_PROPERTY_TITLE
3442
})
3543

3644
public class ApiError {
@@ -55,6 +63,9 @@ public class ApiError {
5563
public static final String JSON_PROPERTY_STATUS = "status";
5664
private Integer status;
5765

66+
public static final String JSON_PROPERTY_TITLE = "title";
67+
private String title;
68+
5869
public ApiError() {
5970
}
6071

@@ -188,20 +199,17 @@ public ApiError message(String message) {
188199
@JsonProperty(JSON_PROPERTY_MESSAGE)
189200
@JsonAlias("detail")
190201
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
191-
192202
public String getMessage() {
193203
return message;
194204
}
195205

196-
197206
@JsonProperty(JSON_PROPERTY_MESSAGE)
198207
@JsonAlias("detail")
199208
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
200209
public void setMessage(String message) {
201210
this.message = message;
202211
}
203212

204-
205213
public ApiError pspReference(String pspReference) {
206214
this.pspReference = pspReference;
207215
return this;
@@ -219,14 +227,12 @@ public String getPspReference() {
219227
return pspReference;
220228
}
221229

222-
223230
@JsonProperty(JSON_PROPERTY_PSP_REFERENCE)
224231
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
225232
public void setPspReference(String pspReference) {
226233
this.pspReference = pspReference;
227234
}
228235

229-
230236
public ApiError status(Integer status) {
231237
this.status = status;
232238
return this;
@@ -239,7 +245,6 @@ public ApiError status(Integer status) {
239245
@ApiModelProperty(value = "The HTTP response status.")
240246
@JsonProperty(JSON_PROPERTY_STATUS)
241247
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
242-
243248
public Integer getStatus() {
244249
return status;
245250
}
@@ -251,6 +256,37 @@ public void setStatus(Integer status) {
251256
this.status = status;
252257
}
253258

259+
/**
260+
* Set title and return the object
261+
* @param title
262+
* @return
263+
*/
264+
public ApiError title(String title) {
265+
this.title = title;
266+
return this;
267+
}
268+
269+
/**
270+
* The human-readable summary of the problem type
271+
* @return status
272+
**/
273+
@ApiModelProperty(value = "The HTTP response status.")
274+
@JsonProperty(JSON_PROPERTY_TITLE)
275+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
276+
public String getTitle() {
277+
return title;
278+
}
279+
280+
/**
281+
* Set title
282+
* @param title
283+
*/
284+
@JsonProperty(JSON_PROPERTY_TITLE)
285+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
286+
public void setTitle(String title) {
287+
this.title = title;
288+
}
289+
254290
/**
255291
* Return true if this ServiceError object is equal to o.
256292
*/
@@ -268,25 +304,27 @@ public boolean equals(Object o) {
268304
Objects.equals(this.errorType, apiError.errorType) &&
269305
Objects.equals(this.message, apiError.message) &&
270306
Objects.equals(this.pspReference, apiError.pspReference) &&
271-
Objects.equals(this.status, apiError.status);
307+
Objects.equals(this.status, apiError.status) &&
308+
Objects.equals(this.title, apiError.title);
272309
}
273310

274311
@Override
275312
public int hashCode() {
276-
return Objects.hash(additionalData, errorCode, errorType, message, pspReference, status);
313+
return Objects.hash(additionalData, errorCode, errorType, message, pspReference, status, title);
277314
}
278315

279316
@Override
280317
public String toString() {
281318
StringBuilder sb = new StringBuilder();
282-
sb.append("class ServiceError {\n");
319+
sb.append("class ApiError {\n");
283320
sb.append(" invalidFields: ").append(toIndentedString(invalidFields)).append("\n");
284321
sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n");
285322
sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n");
286323
sb.append(" errorType: ").append(toIndentedString(errorType)).append("\n");
287324
sb.append(" message: ").append(toIndentedString(message)).append("\n");
288325
sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n");
289326
sb.append(" status: ").append(toIndentedString(status)).append("\n");
327+
sb.append(" title: ").append(toIndentedString(title)).append("\n");
290328
sb.append("}");
291329
return sb.toString();
292330
}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
/*
2+
* Session authentication API
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.sessionauthentication;
14+
15+
import java.util.Objects;
16+
import java.util.Map;
17+
import jakarta.ws.rs.core.GenericType;
18+
19+
import com.fasterxml.jackson.annotation.JsonValue;
20+
21+
/**
22+
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
23+
*/
24+
25+
public abstract class AbstractOpenApiSchema {
26+
27+
// store the actual instance of the schema/object
28+
private Object instance;
29+
30+
// is nullable
31+
private Boolean isNullable;
32+
33+
// schema type (e.g. oneOf, anyOf)
34+
private final String schemaType;
35+
36+
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
37+
this.schemaType = schemaType;
38+
this.isNullable = isNullable;
39+
}
40+
41+
/**
42+
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
43+
*
44+
* @return an instance of the actual schema/object
45+
*/
46+
public abstract Map<String, GenericType<?>> getSchemas();
47+
48+
/**
49+
* Get the actual instance
50+
*
51+
* @return an instance of the actual schema/object
52+
*/
53+
@JsonValue
54+
public Object getActualInstance() {return instance;}
55+
56+
/**
57+
* Set the actual instance
58+
*
59+
* @param instance the actual instance of the schema/object
60+
*/
61+
public void setActualInstance(Object instance) {this.instance = instance;}
62+
63+
/**
64+
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
65+
*
66+
* @return an instance of the actual schema/object
67+
*/
68+
public Object getActualInstanceRecursively() {
69+
return getActualInstanceRecursively(this);
70+
}
71+
72+
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
73+
if (object.getActualInstance() == null) {
74+
return null;
75+
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
76+
return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
77+
} else {
78+
return object.getActualInstance();
79+
}
80+
}
81+
82+
/**
83+
* Get the schema type (e.g. anyOf, oneOf)
84+
*
85+
* @return the schema type
86+
*/
87+
public String getSchemaType() {
88+
return schemaType;
89+
}
90+
91+
@Override
92+
public String toString() {
93+
StringBuilder sb = new StringBuilder();
94+
sb.append("class ").append(getClass()).append(" {\n");
95+
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
96+
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
97+
sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n");
98+
sb.append("}");
99+
return sb.toString();
100+
}
101+
102+
/**
103+
* Convert the given object to string with each line indented by 4 spaces
104+
* (except the first line).
105+
*/
106+
private String toIndentedString(Object o) {
107+
if (o == null) {
108+
return "null";
109+
}
110+
return o.toString().replace("\n", "\n ");
111+
}
112+
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+
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
121+
return Objects.equals(this.instance, a.instance) &&
122+
Objects.equals(this.isNullable, a.isNullable) &&
123+
Objects.equals(this.schemaType, a.schemaType);
124+
}
125+
126+
@Override
127+
public int hashCode() {
128+
return Objects.hash(instance, isNullable, schemaType);
129+
}
130+
131+
/**
132+
* Is nullable
133+
*
134+
* @return true if it's nullable
135+
*/
136+
public Boolean isNullable() {
137+
if (Boolean.TRUE.equals(isNullable)) {
138+
return Boolean.TRUE;
139+
} else {
140+
return Boolean.FALSE;
141+
}
142+
}
143+
144+
145+
146+
}

0 commit comments

Comments
 (0)