Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
449 changes: 449 additions & 0 deletions sdk/dotnet/Timr.Api/Endpoints/TaskApi.cs

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions sdk/java-restclient/src/main/java/com/timr/api/apis/TaskApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,90 @@ public ResponseSpec createTaskWithResponseSpec(TaskCreate taskCreate) throws Res
return createTaskRequestCreation(taskCreate);
}

/**
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can't be deleted; the request is answered with 409 and nothing is deleted.
* <p><b>204</b> - Deleted. No content is returned.
* <p><b>403</b> - Forbidden
* <p><b>404</b> - Not Found
* <p><b>409</b> - Conflict
* @param id ID of the Task.
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec deleteTaskRequestCreation(String id) throws RestClientResponseException {
Object postBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new RestClientResponseException("Missing the required parameter 'id' when calling deleteTask", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<>();

pathParams.put("id", id);

final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<>();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<>();
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<>();

final String[] localVarAccepts = {
"application/problem+json"
};
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

String[] localVarAuthNames = new String[] { "OAuth2", "OAuth2" };

ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<>() {};
return apiClient.invokeAPI("/tasks/{id}", HttpMethod.DELETE, pathParams, localVarQueryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}

/**
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can&#39;t be deleted; the request is answered with 409 and nothing is deleted.
* <p><b>204</b> - Deleted. No content is returned.
* <p><b>403</b> - Forbidden
* <p><b>404</b> - Not Found
* <p><b>409</b> - Conflict
* @param id ID of the Task.
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
public void deleteTask(String id) throws RestClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<>() {};
deleteTaskRequestCreation(id).body(localVarReturnType);
}

/**
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can&#39;t be deleted; the request is answered with 409 and nothing is deleted.
* <p><b>204</b> - Deleted. No content is returned.
* <p><b>403</b> - Forbidden
* <p><b>404</b> - Not Found
* <p><b>409</b> - Conflict
* @param id ID of the Task.
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseEntity<Void> deleteTaskWithHttpInfo(String id) throws RestClientResponseException {
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<>() {};
return deleteTaskRequestCreation(id).toEntity(localVarReturnType);
}

/**
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can&#39;t be deleted; the request is answered with 409 and nothing is deleted.
* <p><b>204</b> - Deleted. No content is returned.
* <p><b>403</b> - Forbidden
* <p><b>404</b> - Not Found
* <p><b>409</b> - Conflict
* @param id ID of the Task.
* @return ResponseSpec
* @throws RestClientResponseException if an error occurs while attempting to invoke the API
*/
public ResponseSpec deleteTaskWithResponseSpec(String id) throws RestClientResponseException {
return deleteTaskRequestCreation(id);
}

/**
* List Tasks
* Lists the Tasks the authenticated user or API token can access.
Expand Down
54 changes: 54 additions & 0 deletions sdk/java-resttemplate/src/main/java/com/timr/api/apis/TaskApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,60 @@ public ResponseEntity<Task> createTaskWithHttpInfo(@jakarta.annotation.Nonnull T
ParameterizedTypeReference<Task> localReturnType = new ParameterizedTypeReference<Task>() {};
return apiClient.invokeAPI("/tasks", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}
/**
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can&#39;t be deleted; the request is answered with 409 and nothing is deleted.
* <p><b>204</b> - Deleted. No content is returned.
* <p><b>403</b> - Forbidden
* <p><b>404</b> - Not Found
* <p><b>409</b> - Conflict
* @param id ID of the Task. (required)
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public void deleteTask(@jakarta.annotation.Nonnull String id) throws RestClientException {
deleteTaskWithHttpInfo(id);
}

/**
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can&#39;t be deleted; the request is answered with 409 and nothing is deleted.
* <p><b>204</b> - Deleted. No content is returned.
* <p><b>403</b> - Forbidden
* <p><b>404</b> - Not Found
* <p><b>409</b> - Conflict
* @param id ID of the Task. (required)
* @return ResponseEntity&lt;Void&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public ResponseEntity<Void> deleteTaskWithHttpInfo(@jakarta.annotation.Nonnull String id) throws RestClientException {
Object localVarPostBody = null;

// verify the required parameter 'id' is set
if (id == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'id' when calling deleteTask");
}

// create path and map variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("id", id);

final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();
final HttpHeaders localVarHeaderParams = new HttpHeaders();
final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();
final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();

final String[] localVarAccepts = {
"application/problem+json"
};
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = { };
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);

String[] localVarAuthNames = new String[] { "OAuth2", "OAuth2" };

ParameterizedTypeReference<Void> localReturnType = new ParameterizedTypeReference<Void>() {};
return apiClient.invokeAPI("/tasks/{id}", HttpMethod.DELETE, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);
}
/**
* List Tasks
* Lists the Tasks the authenticated user or API token can access.
Expand Down
71 changes: 71 additions & 0 deletions sdk/kotlin-okhttp/src/main/kotlin/com/timr/api/apis/TaskApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,77 @@ open class TaskApi(basePath: kotlin.String = defaultBasePath, client: Call.Facto
)
}

/**
* DELETE /tasks/{id}
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can&#39;t be deleted; the request is answered with 409 and nothing is deleted.
* @param id ID of the Task.
* @return void
* @throws IllegalStateException If the request is not correctly configured
* @throws IOException Rethrows the OkHttp execute method exception
* @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response
*/
@Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun deleteTask(id: kotlin.String) : Unit = withContext(Dispatchers.IO) {
val localVarResponse = deleteTaskWithHttpInfo(id = id)

return@withContext when (localVarResponse.responseType) {
ResponseType.Success -> Unit
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> {
val localVarError = localVarResponse as ClientError<*>
throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
ResponseType.ServerError -> {
val localVarError = localVarResponse as ServerError<*>
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()} ${localVarError.body}", localVarError.statusCode, localVarResponse)
}
}
}

/**
* DELETE /tasks/{id}
* Delete a Task
* Deletes the Task together with all its subtasks. A Task that has recorded or running Project Times on itself or any of its subtasks can&#39;t be deleted; the request is answered with 409 and nothing is deleted.
* @param id ID of the Task.
* @return ApiResponse<Unit?>
* @throws IllegalStateException If the request is not correctly configured
* @throws IOException Rethrows the OkHttp execute method exception
*/
@Throws(IllegalStateException::class, IOException::class)
suspend fun deleteTaskWithHttpInfo(id: kotlin.String) : ApiResponse<Unit?> = withContext(Dispatchers.IO) {
val localVariableConfig = deleteTaskRequestConfig(id = id)

return@withContext request<Unit, Unit>(
localVariableConfig
)
}

/**
* To obtain the request config of the operation deleteTask
*
* @param id ID of the Task.
* @return RequestConfig
*/
fun deleteTaskRequestConfig(id: kotlin.String) : RequestConfig<Unit> {
val localVariableBody = null
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
localVariableHeaders["Accept"] = "application/problem+json"

return RequestConfig(
method = RequestMethod.DELETE,
path = "/tasks/{id}".replace("{"+"id"+"}", encodeURIComponent(id.toString())),
query = localVariableQuery,
headers = localVariableHeaders,
requiresAuthentication = true,
body = localVariableBody
)
}

/**
* GET /tasks
* List Tasks
Expand Down
Loading
Loading