mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 12:47:07 +00:00
Java API invocation flexibility (#18078)
* add direct invocation methods for java (httpclient) * add direct invocation methods for java (resttemplate) * handle methods only if endpoints exist for api client * preserve previous newline to minimize changes * update httpclient/resttemplate samples * add common methods in base class * regenerate samples with base class
This commit is contained in:
@@ -834,15 +834,11 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build full URL by concatenating base path, the given sub path and query parameters.
|
||||
* Returns the URL of the client as defined by the server (if exists) or the base path.
|
||||
*
|
||||
* @param path The sub path
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject URL query string of the deep object parameters
|
||||
* @return The full URL
|
||||
* @return The URL for the client.
|
||||
*/
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams, String urlQueryDeepObject) {
|
||||
public String getBaseURL() {
|
||||
String baseURL;
|
||||
if (serverIndex != null) {
|
||||
if (serverIndex < 0 || serverIndex >= servers.size()) {
|
||||
@@ -854,6 +850,20 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
} else {
|
||||
baseURL = basePath;
|
||||
}
|
||||
return baseURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build full URL by concatenating base URL, the given sub path and query parameters.
|
||||
*
|
||||
* @param path The sub path
|
||||
* @param queryParams The query parameters
|
||||
* @param collectionQueryParams The collection query parameters
|
||||
* @param urlQueryDeepObject URL query string of the deep object parameters
|
||||
* @return The full URL
|
||||
*/
|
||||
private String buildUrl(String path, List<Pair> queryParams, List<Pair> collectionQueryParams, String urlQueryDeepObject) {
|
||||
String baseURL = getBaseURL();
|
||||
|
||||
final StringBuilder url = new StringBuilder();
|
||||
url.append(baseURL).append(path);
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public abstract class BaseApi {
|
||||
|
||||
protected ApiClient apiClient;
|
||||
|
||||
public BaseApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public BaseApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
|
||||
* @param url The URL for the request, either full URL or only the path.
|
||||
* @param method The HTTP method for the request.
|
||||
* @throws ApiException if fails to make API call.
|
||||
*/
|
||||
public void invokeAPI(String url, String method) throws ApiException {
|
||||
invokeAPI(url, method, null, null, Collections.emptyMap());
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
|
||||
* @param url The URL for the request, either full URL or only the path.
|
||||
* @param method The HTTP method for the request.
|
||||
* @param additionalHeaders Additional headers for the request.
|
||||
* @throws ApiException if fails to make API call.
|
||||
*/
|
||||
public void invokeAPI(String url, String method, Map<String, String> additionalHeaders) throws ApiException {
|
||||
invokeAPI(url, method, null, null, additionalHeaders);
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
|
||||
* @param url The URL for the request, either full URL or only the path.
|
||||
* @param method The HTTP method for the request.
|
||||
* @param request The request object.
|
||||
* @throws ApiException if fails to make API call.
|
||||
*/
|
||||
public void invokeAPI(String url, String method, Object request) throws ApiException {
|
||||
invokeAPI(url, method, request, null, Collections.emptyMap());
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
|
||||
* @param url The URL for the request, either full URL or only the path.
|
||||
* @param method The HTTP method for the request.
|
||||
* @param request The request object.
|
||||
* @param additionalHeaders Additional headers for the request.
|
||||
* @throws ApiException if fails to make API call.
|
||||
*/
|
||||
public void invokeAPI(String url, String method, Object request, Map<String, String> additionalHeaders) throws ApiException {
|
||||
invokeAPI(url, method, request, null, additionalHeaders);
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
|
||||
* @param url The URL for the request, either full URL or only the path.
|
||||
* @param method The HTTP method for the request.
|
||||
* @param returnType The return type.
|
||||
* @return The API response in the specified type.
|
||||
* @throws ApiException if fails to make API call.
|
||||
*/
|
||||
public <T> T invokeAPI(String url, String method, TypeReference<T> returnType) throws ApiException {
|
||||
return invokeAPI(url, method, null, returnType, Collections.emptyMap());
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
|
||||
* @param url The URL for the request, either full URL or only the path.
|
||||
* @param method The HTTP method for the request.
|
||||
* @param request The request object.
|
||||
* @param returnType The return type.
|
||||
* @return The API response in the specified type.
|
||||
* @throws ApiException if fails to make API call.
|
||||
*/
|
||||
public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType) throws ApiException {
|
||||
return invokeAPI(url, method, request, returnType, Collections.emptyMap());
|
||||
}
|
||||
|
||||
/**
|
||||
* Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
|
||||
* @param url The URL for the request, either full URL or only the path.
|
||||
* @param method The HTTP method for the request.
|
||||
* @param request The request object.
|
||||
* @param returnType The return type.
|
||||
* @param additionalHeaders Additional headers for the request.
|
||||
* @return The API response in the specified type.
|
||||
* @throws ApiException if fails to make API call.
|
||||
*/
|
||||
public abstract <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.BaseApi;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
@@ -29,25 +30,14 @@ import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class AuthApi {
|
||||
|
||||
|
||||
private ApiClient apiClient;
|
||||
public class AuthApi extends BaseApi {
|
||||
|
||||
public AuthApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
super(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public AuthApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
super(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,4 +174,44 @@ public class AuthApi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
|
||||
String localVarPath = url.replace(apiClient.getBaseURL(), "");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarHeaderParams.putAll(additionalHeaders);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "http_bearer_auth" };
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
method,
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
request,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
returnType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.BaseApi;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
@@ -33,25 +34,14 @@ import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class BodyApi {
|
||||
|
||||
|
||||
private ApiClient apiClient;
|
||||
public class BodyApi extends BaseApi {
|
||||
|
||||
public BodyApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
super(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public BodyApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
super(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -751,4 +741,44 @@ public class BodyApi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
|
||||
String localVarPath = url.replace(apiClient.getBaseURL(), "");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarHeaderParams.putAll(additionalHeaders);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
method,
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
request,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
returnType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.BaseApi;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
@@ -29,25 +30,14 @@ import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class FormApi {
|
||||
|
||||
|
||||
private ApiClient apiClient;
|
||||
public class FormApi extends BaseApi {
|
||||
|
||||
public FormApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
super(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public FormApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
super(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,4 +210,44 @@ if (name != null)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
|
||||
String localVarPath = url.replace(apiClient.getBaseURL(), "");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarHeaderParams.putAll(additionalHeaders);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
method,
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
request,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
returnType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.BaseApi;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
@@ -30,25 +31,14 @@ import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class HeaderApi {
|
||||
|
||||
|
||||
private ApiClient apiClient;
|
||||
public class HeaderApi extends BaseApi {
|
||||
|
||||
public HeaderApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
super(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public HeaderApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
super(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,4 +128,44 @@ if (enumRefStringHeader != null)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
|
||||
String localVarPath = url.replace(apiClient.getBaseURL(), "");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarHeaderParams.putAll(additionalHeaders);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
method,
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
request,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
returnType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.BaseApi;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
@@ -30,25 +31,14 @@ import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class PathApi {
|
||||
|
||||
|
||||
private ApiClient apiClient;
|
||||
public class PathApi extends BaseApi {
|
||||
|
||||
public PathApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
super(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public PathApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
super(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,4 +140,44 @@ public class PathApi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
|
||||
String localVarPath = url.replace(apiClient.getBaseURL(), "");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarHeaderParams.putAll(additionalHeaders);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
method,
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
request,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
returnType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.BaseApi;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
@@ -36,25 +37,14 @@ import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class QueryApi {
|
||||
|
||||
|
||||
private ApiClient apiClient;
|
||||
public class QueryApi extends BaseApi {
|
||||
|
||||
public QueryApi() {
|
||||
this(Configuration.getDefaultApiClient());
|
||||
super(Configuration.getDefaultApiClient());
|
||||
}
|
||||
|
||||
public QueryApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
super(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -779,4 +769,44 @@ public class QueryApi {
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T invokeAPI(String url, String method, Object request, TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiException {
|
||||
String localVarPath = url.replace(apiClient.getBaseURL(), "");
|
||||
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
|
||||
List<Pair> localVarQueryParams = new ArrayList<Pair>();
|
||||
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
|
||||
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
|
||||
Map<String, String> localVarCookieParams = new HashMap<String, String>();
|
||||
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
|
||||
|
||||
localVarHeaderParams.putAll(additionalHeaders);
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"text/plain"
|
||||
};
|
||||
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
|
||||
};
|
||||
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
return apiClient.invokeAPI(
|
||||
localVarPath,
|
||||
method,
|
||||
localVarQueryParams,
|
||||
localVarCollectionQueryParams,
|
||||
localVarQueryStringJoiner.toString(),
|
||||
request,
|
||||
localVarHeaderParams,
|
||||
localVarCookieParams,
|
||||
localVarFormParams,
|
||||
localVarAccept,
|
||||
localVarContentType,
|
||||
localVarAuthNames,
|
||||
returnType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user