1- /*
2- * Copyright (c) 2025 shift7 GmbH. All rights reserved.
3- */
4-
51/*
62 * hub-backend API
73 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
84 *
9- * The version of the OpenAPI document: 1.4 .0-SNAPSHOT
10- *
5+ * The version of the OpenAPI document: 1.5 .0-SNAPSHOT
6+ *
117 *
128 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
139 * https://openapi-generator.tech
5248import java .nio .file .Paths ;
5349import java .nio .file .StandardCopyOption ;
5450import org .glassfish .jersey .logging .LoggingFeature ;
55-
51+ import java .util .AbstractMap .SimpleEntry ;
52+ import java .util .logging .Level ;
5653import java .util .logging .Logger ;
5754import java .util .Collection ;
5855import java .util .Collections ;
5956import java .util .Map ;
6057import java .util .Map .Entry ;
6158import java .util .HashMap ;
6259import java .util .LinkedHashMap ;
60+ import java .util .LinkedHashSet ;
6361import java .util .List ;
6462import java .util .Arrays ;
6563import java .util .ArrayList ;
6664import java .util .Date ;
65+ import java .util .stream .Collectors ;
66+ import java .util .stream .Stream ;
6767
6868import java .net .URLEncoder ;
6969
8282/**
8383 * <p>ApiClient class.</p>
8484 */
85- @ javax .annotation .Generated (value = "org.openapitools.codegen.languages.JavaClientCodegen" , comments = "Generator version: 7.11 .0" )
85+ @ javax .annotation .Generated (value = "org.openapitools.codegen.languages.JavaClientCodegen" , comments = "Generator version: 7.14 .0" )
8686public class ApiClient {
87- private static final Pattern JSON_MIME_PATTERN = Pattern .compile ("(?i)^(application/json|[^;/ \t ]+/[^;/ \t ]+[+]json)[ \t ]*(;.*)?$" );
87+ protected static final Pattern JSON_MIME_PATTERN = Pattern .compile ("(?i)^(application/json|[^;/ \t ]+/[^;/ \t ]+[+]json)[ \t ]*(;.*)?$" );
8888
8989 protected Map <String , String > defaultHeaderMap = new HashMap <>();
9090 protected Map <String , String > defaultCookieMap = new HashMap <>();
9191 protected String basePath = "http://localhost" ;
9292 protected String userAgent ;
93- private static final Logger log = Logger .getLogger (ApiClient .class .getName ());
93+ protected static final Logger log = Logger .getLogger (ApiClient .class .getName ());
9494
9595 protected List <ServerConfiguration > servers = new ArrayList <>(Arrays .asList (
9696 new ServerConfiguration (
@@ -107,7 +107,7 @@ public class ApiClient {
107107 protected boolean debugging = false ;
108108 protected ClientConfig clientConfig ;
109109 protected int connectionTimeout = 0 ;
110- private int readTimeout = 0 ;
110+ protected int readTimeout = 0 ;
111111
112112 protected Client httpClient ;
113113 protected JSON json ;
@@ -137,7 +137,7 @@ public ApiClient(Map<String, Authentication> authMap) {
137137 this .dateFormat = new RFC3339DateFormat ();
138138
139139 // Set default User-Agent.
140- setUserAgent ("OpenAPI-Generator/1.4 .0-SNAPSHOT/java" );
140+ setUserAgent ("OpenAPI-Generator/1.5 .0-SNAPSHOT/java" );
141141
142142 // Setup authentications (key: authentication name, value: authentication).
143143 authentications = new HashMap <>();
@@ -264,7 +264,7 @@ public ApiClient setServerVariables(Map<String, String> serverVariables) {
264264 return this ;
265265 }
266266
267- private void updateBasePath () {
267+ protected void updateBasePath () {
268268 if (serverIndex != null ) {
269269 setBasePath (servers .get (serverIndex ).URL (serverVariables ));
270270 }
@@ -475,6 +475,7 @@ public boolean isDebugging() {
475475 */
476476 public ApiClient setDebugging (boolean debugging ) {
477477 this .debugging = debugging ;
478+ applyDebugSetting (this .clientConfig );
478479 // Rebuild HTTP Client according to the new "debugging" value.
479480 this .httpClient = buildHttpClient ();
480481 return this ;
@@ -799,15 +800,15 @@ public Entity<?> serialize(Object obj, Map<String, Object> formParams, String co
799800 return entity ;
800801 }
801802
802- /**
803+ /**
803804 * Adds the object with the provided key to the MultiPart.
804805 * Based on the object type sets Content-Disposition and Content-Type.
805806 *
806807 * @param obj Object
807808 * @param key Key of the object
808809 * @param multiPart MultiPart to add the form param to
809810 */
810- private void addParamToMultipart (Object value , String key , MultiPart multiPart ) {
811+ protected void addParamToMultipart (Object value , String key , MultiPart multiPart ) {
811812 if (value instanceof File ) {
812813 File file = (File ) value ;
813814 FormDataContentDisposition contentDisp = FormDataContentDisposition .name (key )
@@ -827,7 +828,7 @@ private void addParamToMultipart(Object value, String key, MultiPart multiPart)
827828 FormDataContentDisposition contentDisp = FormDataContentDisposition .name (key ).build ();
828829 multiPart .bodyPart (new FormDataBodyPart (contentDisp , parameterToString (value )));
829830 }
830- }
831+ }
831832
832833 /**
833834 * Serialize the given Java object into string according the given
@@ -1011,6 +1012,22 @@ public <T> ApiResponse<T> invokeAPI(
10111012 // to support (constant) query string in `path`, e.g. "/posts?draft=1"
10121013 WebTarget target = httpClient .target (targetURL );
10131014
1015+ // put all headers in one place
1016+ Map <String , String > allHeaderParams = new HashMap <>(defaultHeaderMap );
1017+ allHeaderParams .putAll (headerParams );
1018+
1019+ if (authNames != null ) {
1020+ // update different parameters (e.g. headers) for authentication
1021+ updateParamsForAuth (
1022+ authNames ,
1023+ queryParams ,
1024+ allHeaderParams ,
1025+ cookieParams ,
1026+ null ,
1027+ method ,
1028+ target .getUri ());
1029+ }
1030+
10141031 if (queryParams != null ) {
10151032 for (Pair queryParam : queryParams ) {
10161033 if (queryParam .getValue () != null ) {
@@ -1041,22 +1058,6 @@ public <T> ApiResponse<T> invokeAPI(
10411058
10421059 Entity <?> entity = serialize (body , formParams , contentType , isBodyNullable );
10431060
1044- // put all headers in one place
1045- Map <String , String > allHeaderParams = new HashMap <>(defaultHeaderMap );
1046- allHeaderParams .putAll (headerParams );
1047-
1048- if (authNames != null ) {
1049- // update different parameters (e.g. headers) for authentication
1050- updateParamsForAuth (
1051- authNames ,
1052- queryParams ,
1053- allHeaderParams ,
1054- cookieParams ,
1055- null ,
1056- method ,
1057- target .getUri ());
1058- }
1059-
10601061 for (Entry <String , String > entry : allHeaderParams .entrySet ()) {
10611062 String value = entry .getValue ();
10621063 if (value != null ) {
@@ -1105,7 +1106,7 @@ public <T> ApiResponse<T> invokeAPI(
11051106 }
11061107 }
11071108
1108- private Response sendRequest (String method , Invocation .Builder invocationBuilder , Entity <?> entity ) {
1109+ protected Response sendRequest (String method , Invocation .Builder invocationBuilder , Entity <?> entity ) {
11091110 Response response ;
11101111 if ("POST" .equals (method )) {
11111112 response = invocationBuilder .post (entity );
@@ -1139,8 +1140,10 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
11391140 * @return Client
11401141 */
11411142 protected Client buildHttpClient () {
1142- // recreate the client config to pickup changes
1143- clientConfig = getDefaultClientConfig ();
1143+ // Create ClientConfig if it has not been initialized yet
1144+ if (clientConfig == null ) {
1145+ clientConfig = getDefaultClientConfig ();
1146+ }
11441147
11451148 ClientBuilder clientBuilder = ClientBuilder .newBuilder ();
11461149 clientBuilder = clientBuilder .withConfig (clientConfig );
@@ -1161,6 +1164,11 @@ public ClientConfig getDefaultClientConfig() {
11611164 clientConfig .property (HttpUrlConnectorProvider .SET_METHOD_WORKAROUND , true );
11621165 // turn off compliance validation to be able to send payloads with DELETE calls
11631166 clientConfig .property (ClientProperties .SUPPRESS_HTTP_COMPLIANCE_VALIDATION , true );
1167+ applyDebugSetting (clientConfig );
1168+ return clientConfig ;
1169+ }
1170+
1171+ protected void applyDebugSetting (ClientConfig clientConfig ) {
11641172 if (debugging ) {
11651173 clientConfig .register (new LoggingFeature (java .util .logging .Logger .getLogger (LoggingFeature .DEFAULT_LOGGER_NAME ), java .util .logging .Level .INFO , LoggingFeature .Verbosity .PAYLOAD_ANY , 1024 *50 /* Log payloads up to 50K */ ));
11661174 clientConfig .property (LoggingFeature .LOGGING_FEATURE_VERBOSITY , LoggingFeature .Verbosity .PAYLOAD_ANY );
@@ -1170,8 +1178,6 @@ public ClientConfig getDefaultClientConfig() {
11701178 // suppress warnings for payloads with DELETE calls:
11711179 java .util .logging .Logger .getLogger ("org.glassfish.jersey.client" ).setLevel (java .util .logging .Level .SEVERE );
11721180 }
1173-
1174- return clientConfig ;
11751181 }
11761182
11771183 /**
@@ -1263,4 +1269,4 @@ protected void updateParamsForAuth(String[] authNames, List<Pair> queryParams, M
12631269 auth .applyToParams (queryParams , headerParams , cookieParams , payload , method , uri );
12641270 }
12651271 }
1266- }
1272+ }
0 commit comments