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

org.camunda.community.rest.client.api.TaskCommentApi Maven / Gradle / Ivy

/*
 * Camunda Platform REST API
 * OpenApi Spec for Camunda Platform REST API.
 *
 * The version of the OpenAPI document: 7.21.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package org.camunda.community.rest.client.api;

import com.fasterxml.jackson.core.type.TypeReference;

import org.camunda.community.rest.client.invoker.ApiException;
import org.camunda.community.rest.client.invoker.ApiClient;
import org.camunda.community.rest.client.invoker.Configuration;
import org.camunda.community.rest.client.invoker.Pair;

import org.camunda.community.rest.client.dto.AuthorizationExceptionDto;
import org.camunda.community.rest.client.dto.CommentDto;
import org.camunda.community.rest.client.dto.ExceptionDto;


import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-06-27T13:50:23.655629899Z[Etc/UTC]")
public class TaskCommentApi {


  private ApiClient apiClient;

  public TaskCommentApi() {
    this(Configuration.getDefaultApiClient());
  }

  public TaskCommentApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  public ApiClient getApiClient() {
    return apiClient;
  }

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

  /**
   * Create
   * Creates a comment for a task by id.
   * @param id The id of the task to add the comment to. (required)
   * @param commentDto **Note:** Only the `message` and `processInstanceId` properties will be used. Every other property passed to this endpoint will be ignored. (optional)
   * @return CommentDto
   * @throws ApiException if fails to make API call
   */
  public CommentDto createComment(String id, CommentDto commentDto) throws ApiException {
    return this.createComment(id, commentDto, Collections.emptyMap());
  }


  /**
   * Create
   * Creates a comment for a task by id.
   * @param id The id of the task to add the comment to. (required)
   * @param commentDto **Note:** Only the `message` and `processInstanceId` properties will be used. Every other property passed to this endpoint will be ignored. (optional)
   * @param additionalHeaders additionalHeaders for this call
   * @return CommentDto
   * @throws ApiException if fails to make API call
   */
  public CommentDto createComment(String id, CommentDto commentDto, Map additionalHeaders) throws ApiException {
    Object localVarPostBody = commentDto;
    
    // verify the required parameter 'id' is set
    if (id == null) {
      throw new ApiException(400, "Missing the required parameter 'id' when calling createComment");
    }
    
    // create path and map variables
    String localVarPath = "/task/{id}/comment/create"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      "application/json"
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] { "basicAuth" };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "POST",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  /**
   * Get
   * Retrieves a task comment by task id and comment id.
   * @param id The id of the task. (required)
   * @param commentId The id of the comment to be retrieved. (required)
   * @return CommentDto
   * @throws ApiException if fails to make API call
   */
  public CommentDto getComment(String id, String commentId) throws ApiException {
    return this.getComment(id, commentId, Collections.emptyMap());
  }


  /**
   * Get
   * Retrieves a task comment by task id and comment id.
   * @param id The id of the task. (required)
   * @param commentId The id of the comment to be retrieved. (required)
   * @param additionalHeaders additionalHeaders for this call
   * @return CommentDto
   * @throws ApiException if fails to make API call
   */
  public CommentDto getComment(String id, String commentId, Map additionalHeaders) 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 getComment");
    }
    
    // verify the required parameter 'commentId' is set
    if (commentId == null) {
      throw new ApiException(400, "Missing the required parameter 'commentId' when calling getComment");
    }
    
    // create path and map variables
    String localVarPath = "/task/{id}/comment/{commentId}"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
      .replaceAll("\\{" + "commentId" + "\\}", apiClient.escapeString(commentId.toString()));

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] { "basicAuth" };

    TypeReference localVarReturnType = new TypeReference() {};
    return apiClient.invokeAPI(
        localVarPath,
        "GET",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

  /**
   * Get List
   * Gets the comments for a task by id.
   * @param id The id of the task to retrieve the comments for. (required)
   * @return List<CommentDto>
   * @throws ApiException if fails to make API call
   */
  public List getComments(String id) throws ApiException {
    return this.getComments(id, Collections.emptyMap());
  }


  /**
   * Get List
   * Gets the comments for a task by id.
   * @param id The id of the task to retrieve the comments for. (required)
   * @param additionalHeaders additionalHeaders for this call
   * @return List<CommentDto>
   * @throws ApiException if fails to make API call
   */
  public List getComments(String id, Map additionalHeaders) 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 getComments");
    }
    
    // create path and map variables
    String localVarPath = "/task/{id}/comment"
      .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));

    StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
    String localVarQueryParameterBaseName;
    List localVarQueryParams = new ArrayList();
    List localVarCollectionQueryParams = new ArrayList();
    Map localVarHeaderParams = new HashMap();
    Map localVarCookieParams = new HashMap();
    Map localVarFormParams = new HashMap();

    
    localVarHeaderParams.putAll(additionalHeaders);

    
    
    final String[] localVarAccepts = {
      "application/json"
    };
    final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);

    final String[] localVarContentTypes = {
      
    };
    final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

    String[] localVarAuthNames = new String[] { "basicAuth" };

    TypeReference> localVarReturnType = new TypeReference>() {};
    return apiClient.invokeAPI(
        localVarPath,
        "GET",
        localVarQueryParams,
        localVarCollectionQueryParams,
        localVarQueryStringJoiner.toString(),
        localVarPostBody,
        localVarHeaderParams,
        localVarCookieParams,
        localVarFormParams,
        localVarAccept,
        localVarContentType,
        localVarAuthNames,
        localVarReturnType
    );
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy