All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.katalon.testops.api.ExecutionApi Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package com.katalon.testops.api;

import com.katalon.testops.ApiClient;

import com.katalon.testops.model.ExecutionResource;
import com.katalon.testops.model.PageExecutionResource;
import com.katalon.testops.model.Pageable;

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.ExecutionApi")
public class ExecutionApi {
    private ApiClient apiClient;

    public ExecutionApi() {
        this(new ApiClient());
    }

    @Autowired
    public ExecutionApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Exports and downloads multiple Executions. Returns the archive file comprising the Execution summaries.
     * 
     * 

200 - OK * @param id The id parameter * @param projectId The projectId parameter * @param fileType The fileType parameter * @throws RestClientException if an error occurs while attempting to invoke the API */ public void bulkDownload(List id, Long projectId, String fileType) 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 bulkDownload"); } // verify the required parameter 'projectId' is set if (projectId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'projectId' when calling bulkDownload"); } String path = UriComponentsBuilder.fromPath("/api/v1/executions/download").build().toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase()), "id", id)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "fileType", fileType)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "projectId", projectId)); 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() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Deletes multiple Executions. Returns the deleted Execution details. * *

200 - OK * @param projectId The projectId parameter * @param order The order parameter * @return List<ExecutionResource> * @throws RestClientException if an error occurs while attempting to invoke the API */ public List delete1(Long projectId, List order) throws RestClientException { Object postBody = null; // verify the required parameter 'projectId' is set if (projectId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'projectId' when calling delete1"); } // verify the required parameter 'order' is set if (order == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'order' when calling delete1"); } String path = UriComponentsBuilder.fromPath("/api/v1/executions").build().toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "projectId", projectId)); queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("multi".toUpperCase()), "order", order)); 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.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Exports and downloads an Execution. Returns the Execution summary file. * *

200 - OK * @param id The id parameter * @param fileType The fileType parameter * @throws RestClientException if an error occurs while attempting to invoke the API */ public void download1(Long id, String fileType) 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 download1"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/executions/{id}/download").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "fileType", fileType)); 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() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Downloads all uploaded files of an Execution. Returns the archive file comprising all Execution's files. * *

200 - OK * @param id The id parameter * @throws RestClientException if an error occurs while attempting to invoke the API */ public void downloadFile(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 downloadFile"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/executions/{id}/download-file").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() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Returns an Execution detail. * *

200 - OK * @param id The id parameter * @return ExecutionResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public ExecutionResource get1(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 get1"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/executions/{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); } /** * * *

200 - OK * @param id The id parameter * @param pageable The pageable parameter * @return PageExecutionResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public PageExecutionResource getLatestExecutions(Long id, Pageable pageable) 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 getLatestExecutions"); } // verify the required parameter 'pageable' is set if (pageable == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pageable' when calling getLatestExecutions"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/organizations/{id}/latest-executions").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "pageable", pageable)); 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); } /** * Link an Execution to a Release. Returns the updated Execution detail. * *

200 - OK * @param id The id parameter * @param projectId The projectId parameter * @param releaseId The releaseId parameter * @return ExecutionResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public ExecutionResource linkRelease(Long id, Long projectId, Long releaseId) 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 linkRelease"); } // verify the required parameter 'projectId' is set if (projectId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'projectId' when calling linkRelease"); } // verify the required parameter 'releaseId' is set if (releaseId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'releaseId' when calling linkRelease"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/executions/{id}/link-release").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "projectId", projectId)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "releaseId", releaseId)); 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); } /** * * *

200 - OK * @param pageable The pageable parameter * @param batch The batch parameter * @param projectId The projectId parameter * @param order The order parameter * @return Object * @throws RestClientException if an error occurs while attempting to invoke the API */ public Object list(Pageable pageable, String batch, Long projectId, Long order) throws RestClientException { Object postBody = null; // verify the required parameter 'pageable' is set if (pageable == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pageable' when calling list"); } String path = UriComponentsBuilder.fromPath("/api/v1/executions").build().toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "batch", batch)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "projectId", projectId)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "pageable", pageable)); 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); } /** * Re-imports an Execution. Returns the newly imported Execution detail. * *

200 - OK * @param id The id parameter * @return ExecutionResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public ExecutionResource reImportExecution(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 reImportExecution"); } String path = UriComponentsBuilder.fromPath("/api/v1/executions/reimport").build().toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "id", id)); 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); } /** * Rerun an Execution. * *

204 - No Content * @param id The id parameter * @throws RestClientException if an error occurs while attempting to invoke the API */ public void rerunExecution(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 rerunExecution"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/executions/{id}/rerun").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() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Terminates a running Execution. Returns the terminated Execution detail. * *

200 - OK * @param projectId The projectId parameter * @param order The order parameter * @return ExecutionResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public ExecutionResource terminatedExecution(Long projectId, Long order) throws RestClientException { Object postBody = null; // verify the required parameter 'projectId' is set if (projectId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'projectId' when calling terminatedExecution"); } // verify the required parameter 'order' is set if (order == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'order' when calling terminatedExecution"); } String path = UriComponentsBuilder.fromPath("/api/v1/executions/terminate").build().toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "projectId", projectId)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "order", order)); 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 to a Release. Returns the updated Execution detail. * *

200 - OK * @param id The id parameter * @return ExecutionResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public ExecutionResource unlinkRelease(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 unlinkRelease"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/executions/{id}/unlink-release").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); } }