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

com.katalon.testops.api.TestPlanApi 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.RunConfigurationResource;

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

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Creates and triggers a sample Test Plan. Returns the created Test Plan detail.
     * 
     * 

200 - OK * @param body The body parameter * @return RunConfigurationResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public RunConfigurationResource createAndTriggerSample(RunConfigurationResource body) 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 createAndTriggerSample"); } String path = UriComponentsBuilder.fromPath("/api/v1/run-configurations/sample").build().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); } /** * Creates or updates a Test Plan. Returns the Test Plan detail. * *

200 - OK * @param body The body parameter * @param verifyRunConfiguration The verifyRunConfiguration parameter * @return RunConfigurationResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public RunConfigurationResource createOrUpdateConfiguration(RunConfigurationResource body, Boolean verifyRunConfiguration) 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 createOrUpdateConfiguration"); } String path = UriComponentsBuilder.fromPath("/api/v1/run-configurations").build().toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "verifyRunConfiguration", verifyRunConfiguration)); 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); } /** * Deletes a Test Plan. Returns the deleted Test Plan detail. * *

200 - OK * @param id The id parameter * @return RunConfigurationResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public RunConfigurationResource delete5(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 delete5"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/run-configurations/{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.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Link an Run Configuration to a Release. Returns the updated Run Configuration detail. * *

200 - OK * @param id The id parameter * @param projectId The projectId parameter * @param releaseId The releaseId parameter * @return RunConfigurationResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public RunConfigurationResource linkRelease1(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 linkRelease1"); } // verify the required parameter 'projectId' is set if (projectId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'projectId' when calling linkRelease1"); } // verify the required parameter 'releaseId' is set if (releaseId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'releaseId' when calling linkRelease1"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("id", id); String path = UriComponentsBuilder.fromPath("/api/v1/run-configurations/{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); } /** * Unlink an Run Configuration to a Release. Returns the updated Run Configuration detail. * *

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy