com.openshift.cloud.api.kas.ErrorsApi Maven / Gradle / Ivy
package com.openshift.cloud.api.kas;
import com.openshift.cloud.api.kas.invoker.ApiException;
import com.openshift.cloud.api.kas.invoker.ApiClient;
import com.openshift.cloud.api.kas.invoker.Configuration;
import com.openshift.cloud.api.kas.invoker.Pair;
import javax.ws.rs.core.GenericType;
import com.openshift.cloud.api.kas.models.Error;
import com.openshift.cloud.api.kas.models.ErrorList;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class ErrorsApi {
private ApiClient apiClient;
public ErrorsApi() {
this(Configuration.getDefaultApiClient());
}
public ErrorsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
*
* Returns the error by Id
* @param id The ID of record (required)
* @return a {@code Error}
* @throws ApiException if fails to make API call
*/
public Error getErrorById(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getErrorById");
}
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/errors/{id}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
*
* Returns the list of possible API errors
* @return a {@code ErrorList}
* @throws ApiException if fails to make API call
*/
public ErrorList getErrors() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/kafkas_mgmt/v1/errors".replaceAll("\\{format\\}","json");
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}