File tree Expand file tree Collapse file tree 8 files changed +113
-0
lines changed
modules/openapi-generator/src/main/resources/Java/libraries/restclient
echo_api/java/restclient/src/main/java/org/openapitools/client
others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client
restclient/src/main/java/org/openapitools/client
restclient-nullable-arrays/src/main/java/org/openapitools/client
restclient-swagger2/src/main/java/org/openapitools/client
restclient-useSingleRequestParameter/src/main/java/org/openapitools/client Expand file tree Collapse file tree 8 files changed +113
-0
lines changed Original file line number Diff line number Diff line change @@ -631,6 +631,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
631
631
- [ act coding] ( https://github.com/actcoding )
632
632
- [ Adaptant Solutions AG] ( https://www.adaptant.io/ )
633
633
- [ adesso SE] ( https://www.adesso.de/ )
634
+ - [ adorsys GmbH & Co.KG] ( https://adorsys.com/ )
634
635
- [ Adyen] ( https://www.adyen.com/ )
635
636
- [ Agoda] ( https://www.agoda.com/ )
636
637
- [ Airthings] ( https://www.airthings.com/ )
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ import java.util.List;
44
44
import java.util.Map;
45
45
import java.util.Map.Entry;
46
46
import java.util.TimeZone;
47
+ import java.util.function.Supplier;
47
48
48
49
import { {javaxPackage} }.annotation.Nullable;
49
50
@@ -240,6 +241,21 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
240
241
throw new RuntimeException("No Bearer authentication configured!");
241
242
}
242
243
244
+ /**
245
+ * Helper method to set the supplier of access tokens for Bearer authentication.
246
+ *
247
+ * @param tokenSupplier the token supplier function
248
+ */
249
+ public void setBearerToken(Supplier<String > tokenSupplier) {
250
+ for (Authentication auth : authentications.values()) {
251
+ if (auth instanceof HttpBearerAuth) {
252
+ ((HttpBearerAuth) auth).setBearerToken(tokenSupplier);
253
+ return;
254
+ }
255
+ }
256
+ throw new RuntimeException("No Bearer authentication configured!");
257
+ }
258
+
243
259
/**
244
260
* Helper method to set username for the first HTTP basic authentication.
245
261
* @param username the username
Original file line number Diff line number Diff line change 46
46
import java .util .Map ;
47
47
import java .util .Map .Entry ;
48
48
import java .util .TimeZone ;
49
+ import java .util .function .Supplier ;
49
50
50
51
import jakarta .annotation .Nullable ;
51
52
@@ -222,6 +223,21 @@ public void setBearerToken(String bearerToken) {
222
223
throw new RuntimeException ("No Bearer authentication configured!" );
223
224
}
224
225
226
+ /**
227
+ * Helper method to set the supplier of access tokens for Bearer authentication.
228
+ *
229
+ * @param tokenSupplier the token supplier function
230
+ */
231
+ public void setBearerToken (Supplier <String > tokenSupplier ) {
232
+ for (Authentication auth : authentications .values ()) {
233
+ if (auth instanceof HttpBearerAuth ) {
234
+ ((HttpBearerAuth ) auth ).setBearerToken (tokenSupplier );
235
+ return ;
236
+ }
237
+ }
238
+ throw new RuntimeException ("No Bearer authentication configured!" );
239
+ }
240
+
225
241
/**
226
242
* Helper method to set username for the first HTTP basic authentication.
227
243
* @param username the username
Original file line number Diff line number Diff line change 46
46
import java .util .Map ;
47
47
import java .util .Map .Entry ;
48
48
import java .util .TimeZone ;
49
+ import java .util .function .Supplier ;
49
50
50
51
import jakarta .annotation .Nullable ;
51
52
@@ -220,6 +221,21 @@ public void setBearerToken(String bearerToken) {
220
221
throw new RuntimeException ("No Bearer authentication configured!" );
221
222
}
222
223
224
+ /**
225
+ * Helper method to set the supplier of access tokens for Bearer authentication.
226
+ *
227
+ * @param tokenSupplier the token supplier function
228
+ */
229
+ public void setBearerToken (Supplier <String > tokenSupplier ) {
230
+ for (Authentication auth : authentications .values ()) {
231
+ if (auth instanceof HttpBearerAuth ) {
232
+ ((HttpBearerAuth ) auth ).setBearerToken (tokenSupplier );
233
+ return ;
234
+ }
235
+ }
236
+ throw new RuntimeException ("No Bearer authentication configured!" );
237
+ }
238
+
223
239
/**
224
240
* Helper method to set username for the first HTTP basic authentication.
225
241
* @param username the username
Original file line number Diff line number Diff line change 46
46
import java .util .Map ;
47
47
import java .util .Map .Entry ;
48
48
import java .util .TimeZone ;
49
+ import java .util .function .Supplier ;
49
50
50
51
import jakarta .annotation .Nullable ;
51
52
@@ -220,6 +221,21 @@ public void setBearerToken(String bearerToken) {
220
221
throw new RuntimeException ("No Bearer authentication configured!" );
221
222
}
222
223
224
+ /**
225
+ * Helper method to set the supplier of access tokens for Bearer authentication.
226
+ *
227
+ * @param tokenSupplier the token supplier function
228
+ */
229
+ public void setBearerToken (Supplier <String > tokenSupplier ) {
230
+ for (Authentication auth : authentications .values ()) {
231
+ if (auth instanceof HttpBearerAuth ) {
232
+ ((HttpBearerAuth ) auth ).setBearerToken (tokenSupplier );
233
+ return ;
234
+ }
235
+ }
236
+ throw new RuntimeException ("No Bearer authentication configured!" );
237
+ }
238
+
223
239
/**
224
240
* Helper method to set username for the first HTTP basic authentication.
225
241
* @param username the username
Original file line number Diff line number Diff line change 46
46
import java .util .Map ;
47
47
import java .util .Map .Entry ;
48
48
import java .util .TimeZone ;
49
+ import java .util .function .Supplier ;
49
50
50
51
import jakarta .annotation .Nullable ;
51
52
@@ -226,6 +227,21 @@ public void setBearerToken(String bearerToken) {
226
227
throw new RuntimeException ("No Bearer authentication configured!" );
227
228
}
228
229
230
+ /**
231
+ * Helper method to set the supplier of access tokens for Bearer authentication.
232
+ *
233
+ * @param tokenSupplier the token supplier function
234
+ */
235
+ public void setBearerToken (Supplier <String > tokenSupplier ) {
236
+ for (Authentication auth : authentications .values ()) {
237
+ if (auth instanceof HttpBearerAuth ) {
238
+ ((HttpBearerAuth ) auth ).setBearerToken (tokenSupplier );
239
+ return ;
240
+ }
241
+ }
242
+ throw new RuntimeException ("No Bearer authentication configured!" );
243
+ }
244
+
229
245
/**
230
246
* Helper method to set username for the first HTTP basic authentication.
231
247
* @param username the username
Original file line number Diff line number Diff line change 46
46
import java .util .Map ;
47
47
import java .util .Map .Entry ;
48
48
import java .util .TimeZone ;
49
+ import java .util .function .Supplier ;
49
50
50
51
import jakarta .annotation .Nullable ;
51
52
@@ -226,6 +227,21 @@ public void setBearerToken(String bearerToken) {
226
227
throw new RuntimeException ("No Bearer authentication configured!" );
227
228
}
228
229
230
+ /**
231
+ * Helper method to set the supplier of access tokens for Bearer authentication.
232
+ *
233
+ * @param tokenSupplier the token supplier function
234
+ */
235
+ public void setBearerToken (Supplier <String > tokenSupplier ) {
236
+ for (Authentication auth : authentications .values ()) {
237
+ if (auth instanceof HttpBearerAuth ) {
238
+ ((HttpBearerAuth ) auth ).setBearerToken (tokenSupplier );
239
+ return ;
240
+ }
241
+ }
242
+ throw new RuntimeException ("No Bearer authentication configured!" );
243
+ }
244
+
229
245
/**
230
246
* Helper method to set username for the first HTTP basic authentication.
231
247
* @param username the username
Original file line number Diff line number Diff line change 46
46
import java .util .Map ;
47
47
import java .util .Map .Entry ;
48
48
import java .util .TimeZone ;
49
+ import java .util .function .Supplier ;
49
50
50
51
import jakarta .annotation .Nullable ;
51
52
@@ -226,6 +227,21 @@ public void setBearerToken(String bearerToken) {
226
227
throw new RuntimeException ("No Bearer authentication configured!" );
227
228
}
228
229
230
+ /**
231
+ * Helper method to set the supplier of access tokens for Bearer authentication.
232
+ *
233
+ * @param tokenSupplier the token supplier function
234
+ */
235
+ public void setBearerToken (Supplier <String > tokenSupplier ) {
236
+ for (Authentication auth : authentications .values ()) {
237
+ if (auth instanceof HttpBearerAuth ) {
238
+ ((HttpBearerAuth ) auth ).setBearerToken (tokenSupplier );
239
+ return ;
240
+ }
241
+ }
242
+ throw new RuntimeException ("No Bearer authentication configured!" );
243
+ }
244
+
229
245
/**
230
246
* Helper method to set username for the first HTTP basic authentication.
231
247
* @param username the username
You can’t perform that action at this time.
0 commit comments