
org.camunda.community.rest.client.api.TaskAttachmentApi 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.AttachmentDto;
import org.camunda.community.rest.client.dto.AuthorizationExceptionDto;
import org.camunda.community.rest.client.dto.ExceptionDto;
import java.io.File;
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 TaskAttachmentApi {
private ApiClient apiClient;
public TaskAttachmentApi() {
this(Configuration.getDefaultApiClient());
}
public TaskAttachmentApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create
* Creates an attachment for a task.
* @param id The id of the task to add the attachment to. (required)
* @param attachmentName The name of the attachment. (optional)
* @param attachmentDescription The description of the attachment. (optional)
* @param attachmentType The type of the attachment. (optional)
* @param url The url to the remote content of the attachment. (optional)
* @param content The content of the attachment. (optional)
* @return AttachmentDto
* @throws ApiException if fails to make API call
*/
public AttachmentDto addAttachment(String id, String attachmentName, String attachmentDescription, String attachmentType, String url, File content) throws ApiException {
return this.addAttachment(id, attachmentName, attachmentDescription, attachmentType, url, content, Collections.emptyMap());
}
/**
* Create
* Creates an attachment for a task.
* @param id The id of the task to add the attachment to. (required)
* @param attachmentName The name of the attachment. (optional)
* @param attachmentDescription The description of the attachment. (optional)
* @param attachmentType The type of the attachment. (optional)
* @param url The url to the remote content of the attachment. (optional)
* @param content The content of the attachment. (optional)
* @param additionalHeaders additionalHeaders for this call
* @return AttachmentDto
* @throws ApiException if fails to make API call
*/
public AttachmentDto addAttachment(String id, String attachmentName, String attachmentDescription, String attachmentType, String url, File content, 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 addAttachment");
}
// create path and map variables
String localVarPath = "/task/{id}/attachment/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);
if (attachmentName != null)
localVarFormParams.put("attachment-name", attachmentName);
if (attachmentDescription != null)
localVarFormParams.put("attachment-description", attachmentDescription);
if (attachmentType != null)
localVarFormParams.put("attachment-type", attachmentType);
if (url != null)
localVarFormParams.put("url", url);
if (content != null)
localVarFormParams.put("content", content);
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
};
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
);
}
/**
* Delete
* Removes an attachment from a task by id.
* @param id The id of the task. (required)
* @param attachmentId The id of the attachment to be removed. (required)
* @throws ApiException if fails to make API call
*/
public void deleteAttachment(String id, String attachmentId) throws ApiException {
this.deleteAttachment(id, attachmentId, Collections.emptyMap());
}
/**
* Delete
* Removes an attachment from a task by id.
* @param id The id of the task. (required)
* @param attachmentId The id of the attachment to be removed. (required)
* @param additionalHeaders additionalHeaders for this call
* @throws ApiException if fails to make API call
*/
public void deleteAttachment(String id, String attachmentId, 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 deleteAttachment");
}
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException(400, "Missing the required parameter 'attachmentId' when calling deleteAttachment");
}
// create path and map variables
String localVarPath = "/task/{id}/attachment/{attachmentId}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "attachmentId" + "\\}", apiClient.escapeString(attachmentId.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" };
apiClient.invokeAPI(
localVarPath,
"DELETE",
localVarQueryParams,
localVarCollectionQueryParams,
localVarQueryStringJoiner.toString(),
localVarPostBody,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
null
);
}
/**
* Get
* Retrieves a task attachment by task id and attachment id.
* @param id The id of the task. (required)
* @param attachmentId The id of the attachment to be retrieved. (required)
* @return AttachmentDto
* @throws ApiException if fails to make API call
*/
public AttachmentDto getAttachment(String id, String attachmentId) throws ApiException {
return this.getAttachment(id, attachmentId, Collections.emptyMap());
}
/**
* Get
* Retrieves a task attachment by task id and attachment id.
* @param id The id of the task. (required)
* @param attachmentId The id of the attachment to be retrieved. (required)
* @param additionalHeaders additionalHeaders for this call
* @return AttachmentDto
* @throws ApiException if fails to make API call
*/
public AttachmentDto getAttachment(String id, String attachmentId, 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 getAttachment");
}
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException(400, "Missing the required parameter 'attachmentId' when calling getAttachment");
}
// create path and map variables
String localVarPath = "/task/{id}/attachment/{attachmentId}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "attachmentId" + "\\}", apiClient.escapeString(attachmentId.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 (Binary)
* Retrieves the binary content of a task attachment by task id and attachment id.
* @param id The id of the task. (required)
* @param attachmentId The id of the attachment to be retrieved. (required)
* @return File
* @throws ApiException if fails to make API call
*/
public File getAttachmentData(String id, String attachmentId) throws ApiException {
return this.getAttachmentData(id, attachmentId, Collections.emptyMap());
}
/**
* Get (Binary)
* Retrieves the binary content of a task attachment by task id and attachment id.
* @param id The id of the task. (required)
* @param attachmentId The id of the attachment to be retrieved. (required)
* @param additionalHeaders additionalHeaders for this call
* @return File
* @throws ApiException if fails to make API call
*/
public File getAttachmentData(String id, String attachmentId, 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 getAttachmentData");
}
// verify the required parameter 'attachmentId' is set
if (attachmentId == null) {
throw new ApiException(400, "Missing the required parameter 'attachmentId' when calling getAttachmentData");
}
// create path and map variables
String localVarPath = "/task/{id}/attachment/{attachmentId}/data"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()))
.replaceAll("\\{" + "attachmentId" + "\\}", apiClient.escapeString(attachmentId.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/octet-stream", "text/plain", "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 attachments for a task.
* @param id The id of the task to retrieve the attachments for. (required)
* @return List<AttachmentDto>
* @throws ApiException if fails to make API call
*/
public List getAttachments(String id) throws ApiException {
return this.getAttachments(id, Collections.emptyMap());
}
/**
* Get List
* Gets the attachments for a task.
* @param id The id of the task to retrieve the attachments for. (required)
* @param additionalHeaders additionalHeaders for this call
* @return List<AttachmentDto>
* @throws ApiException if fails to make API call
*/
public List getAttachments(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 getAttachments");
}
// create path and map variables
String localVarPath = "/task/{id}/attachment"
.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