com.katalon.testops.api.ExecutionTestResultApi Maven / Gradle / Ivy
Show all versions of testops-client-openapi Show documentation
package com.katalon.testops.api;
import com.katalon.testops.ApiClient;
import com.katalon.testops.model.ExecutionTestResultResource;
import com.katalon.testops.model.IncidentExecutionTestResultResource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@Component("com.katalon.testops.api.ExecutionTestResultApi")
public class ExecutionTestResultApi {
private ApiClient apiClient;
public ExecutionTestResultApi() {
this(new ApiClient());
}
@Autowired
public ExecutionTestResultApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Returns an Execution Test Result detail.
*
* 200 - OK
* @param id The id parameter
* @return ExecutionTestResultResource
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ExecutionTestResultResource get2(String id) throws RestClientException {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling get2");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("id", id);
String path = UriComponentsBuilder.fromPath("/api/v1/test-results/{id}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
final String[] accepts = {
"*/*"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = { };
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "basicScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
* Downloads a test result's log. Returns the log file.
*
* 200 - OK
* @param id The id parameter
* @return String
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public String getStdout(Long id) throws RestClientException {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling getStdout");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("id", id);
String path = UriComponentsBuilder.fromPath("/api/v1/test-results/logs/{id}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
final String[] accepts = {
"text/plain;charset=UTF-8"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = { };
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "basicScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
* Link an Execution Test Result to a Task. Returns the created binding detail.
*
* 200 - OK
* @param body The body parameter
* @param id The id parameter
* @return IncidentExecutionTestResultResource
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public IncidentExecutionTestResultResource linkIncidents(IncidentExecutionTestResultResource body, String id) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling linkIncidents");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling linkIncidents");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("id", id);
String path = UriComponentsBuilder.fromPath("/api/v1/test-results/{id}/incidents").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
final String[] accepts = {
"*/*"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "basicScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
*
*
* 200 - OK
* @param id The id parameter
* @return ExecutionTestResultResource
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ExecutionTestResultResource markAsRetested(String id) throws RestClientException {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling markAsRetested");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("id", id);
String path = UriComponentsBuilder.fromPath("/api/v1/test-results/{id}/mask-as-retested").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
final String[] accepts = {
"*/*"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = { };
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "basicScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
* Unlink an Execution Test Result to a Task. Returns the deleted binding detail.
*
* 200 - OK
* @param body The body parameter
* @param id The id parameter
* @return IncidentExecutionTestResultResource
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public IncidentExecutionTestResultResource unlinkIncidents(IncidentExecutionTestResultResource body, String id) throws RestClientException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling unlinkIncidents");
}
// verify the required parameter 'id' is set
if (id == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling unlinkIncidents");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("id", id);
String path = UriComponentsBuilder.fromPath("/api/v1/test-results/{id}/incidents").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
final String[] accepts = {
"*/*"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = {
"application/json"
};
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "basicScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
}