forked from loafle/openapi-generator-original
[Java][okhttp-gson] Add new ApiClient constructors for access token retry (#1319)
* Add new ApiClient constructors for access token retry * Update samples * Update security samples
This commit is contained in:
parent
7eb9cda1e0
commit
078b04deac
@ -80,7 +80,7 @@ public class ApiClient {
|
|||||||
private HttpLoggingInterceptor loggingInterceptor;
|
private HttpLoggingInterceptor loggingInterceptor;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient
|
* Basic constructor for ApiClient
|
||||||
*/
|
*/
|
||||||
public ApiClient() {
|
public ApiClient() {
|
||||||
init();
|
init();
|
||||||
@ -94,13 +94,23 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
{{#authMethods}}{{#isOAuth}}
|
{{#authMethods}}{{#isOAuth}}
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient to support access token retry on 401/403
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID
|
||||||
*/
|
*/
|
||||||
public ApiClient(
|
public ApiClient(String clientId) {
|
||||||
String clientId,
|
this(clientId, null, null);
|
||||||
String clientSecret,
|
}
|
||||||
Map<String, String> parameters
|
|
||||||
) {
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, Map<String, String> parameters) {
|
||||||
|
this(clientId, null, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, String clientSecret, Map<String, String> parameters) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
RetryingOAuth retryingOAuth = new RetryingOAuth("{{tokenUrl}}", clientId, OAuthFlow.{{flow}}, clientSecret, parameters);
|
RetryingOAuth retryingOAuth = new RetryingOAuth("{{tokenUrl}}", clientId, OAuthFlow.{{flow}}, clientSecret, parameters);
|
||||||
|
@ -1 +1 @@
|
|||||||
3.3.1-SNAPSHOT
|
3.3.2-SNAPSHOT
|
@ -79,7 +79,7 @@ public class ApiClient {
|
|||||||
private HttpLoggingInterceptor loggingInterceptor;
|
private HttpLoggingInterceptor loggingInterceptor;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient
|
* Basic constructor for ApiClient
|
||||||
*/
|
*/
|
||||||
public ApiClient() {
|
public ApiClient() {
|
||||||
init();
|
init();
|
||||||
@ -92,13 +92,23 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient to support access token retry on 401/403
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID
|
||||||
*/
|
*/
|
||||||
public ApiClient(
|
public ApiClient(String clientId) {
|
||||||
String clientId,
|
this(clientId, null, null);
|
||||||
String clientSecret,
|
}
|
||||||
Map<String, String> parameters
|
|
||||||
) {
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, Map<String, String> parameters) {
|
||||||
|
this(clientId, null, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, String clientSecret, Map<String, String> parameters) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
|
RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
|
||||||
|
@ -32,7 +32,7 @@ import java.io.IOException;
|
|||||||
public class ModelReturn {
|
public class ModelReturn {
|
||||||
public static final String SERIALIZED_NAME_RETURN = "return";
|
public static final String SERIALIZED_NAME_RETURN = "return";
|
||||||
@SerializedName(SERIALIZED_NAME_RETURN)
|
@SerializedName(SERIALIZED_NAME_RETURN)
|
||||||
private Integer _return = null;
|
private Integer _return;
|
||||||
|
|
||||||
public ModelReturn _return(Integer _return) {
|
public ModelReturn _return(Integer _return) {
|
||||||
this._return = _return;
|
this._return = _return;
|
||||||
|
@ -79,7 +79,7 @@ public class ApiClient {
|
|||||||
private HttpLoggingInterceptor loggingInterceptor;
|
private HttpLoggingInterceptor loggingInterceptor;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient
|
* Basic constructor for ApiClient
|
||||||
*/
|
*/
|
||||||
public ApiClient() {
|
public ApiClient() {
|
||||||
init();
|
init();
|
||||||
@ -94,13 +94,23 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient to support access token retry on 401/403
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID
|
||||||
*/
|
*/
|
||||||
public ApiClient(
|
public ApiClient(String clientId) {
|
||||||
String clientId,
|
this(clientId, null, null);
|
||||||
String clientSecret,
|
}
|
||||||
Map<String, String> parameters
|
|
||||||
) {
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, Map<String, String> parameters) {
|
||||||
|
this(clientId, null, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, String clientSecret, Map<String, String> parameters) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
|
RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
|
||||||
|
@ -79,7 +79,7 @@ public class ApiClient {
|
|||||||
private HttpLoggingInterceptor loggingInterceptor;
|
private HttpLoggingInterceptor loggingInterceptor;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient
|
* Basic constructor for ApiClient
|
||||||
*/
|
*/
|
||||||
public ApiClient() {
|
public ApiClient() {
|
||||||
init();
|
init();
|
||||||
@ -94,13 +94,23 @@ public class ApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor for ApiClient to support access token retry on 401/403
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID
|
||||||
*/
|
*/
|
||||||
public ApiClient(
|
public ApiClient(String clientId) {
|
||||||
String clientId,
|
this(clientId, null, null);
|
||||||
String clientSecret,
|
}
|
||||||
Map<String, String> parameters
|
|
||||||
) {
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, Map<String, String> parameters) {
|
||||||
|
this(clientId, null, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Constructor for ApiClient to support access token retry on 401/403 configured with client ID, secret, and additional parameters
|
||||||
|
*/
|
||||||
|
public ApiClient(String clientId, String clientSecret, Map<String, String> parameters) {
|
||||||
init();
|
init();
|
||||||
|
|
||||||
RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
|
RetryingOAuth retryingOAuth = new RetryingOAuth("", clientId, OAuthFlow.implicit, clientSecret, parameters);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user