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

com.katalon.testops.api.CommentApi 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.CommentResource;

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

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

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

    public ApiClient getApiClient() {
        return apiClient;
    }

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

    /**
     * Creates a Comment. Returns the created Comment detail.
     * 
     * 

200 - OK * @param body The body parameter * @return CommentResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public CommentResource create1(CommentResource 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 create1"); } String path = UriComponentsBuilder.fromPath("/api/v1/comments").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); } /** * Updates a Comment detail. Returns the updated Comment detail. * *

200 - OK * @param body The body parameter * @return CommentResource * @throws RestClientException if an error occurs while attempting to invoke the API */ public CommentResource update(CommentResource 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 update"); } String path = UriComponentsBuilder.fromPath("/api/v1/comments").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.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy