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

software.tnb.jira.validation.generated.api.IssueCommentsApi Maven / Gradle / Ivy

The newest version!
/*
 * The Jira Cloud platform REST API
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package software.tnb.jira.validation.generated.api;

import software.tnb.jira.validation.generated.ApiCallback;
import software.tnb.jira.validation.generated.ApiClient;
import software.tnb.jira.validation.generated.ApiException;
import software.tnb.jira.validation.generated.ApiResponse;
import software.tnb.jira.validation.generated.Configuration;
import software.tnb.jira.validation.generated.Pair;
import software.tnb.jira.validation.generated.ProgressRequestBody;
import software.tnb.jira.validation.generated.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import software.tnb.jira.validation.generated.model.Comment;
import software.tnb.jira.validation.generated.model.IssueCommentListRequestBean;
import software.tnb.jira.validation.generated.model.PageBeanComment;
import software.tnb.jira.validation.generated.model.PageOfComments;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class IssueCommentsApi {
    private ApiClient localVarApiClient;
    private int localHostIndex;
    private String localCustomBaseUrl;

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

    public IssueCommentsApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

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

    public int getHostIndex() {
        return localHostIndex;
    }

    public void setHostIndex(int hostIndex) {
        this.localHostIndex = hostIndex;
    }

    public String getCustomBaseUrl() {
        return localCustomBaseUrl;
    }

    public void setCustomBaseUrl(String customBaseUrl) {
        this.localCustomBaseUrl = customBaseUrl;
    }

    /**
     * Build call for addComment
     * @param issueIdOrKey The ID or key of the issue. (required)
     * @param requestBody  (required)
     * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if the request is invalid. -
401 Returned if the authentication credentials are incorrect. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public okhttp3.Call addCommentCall(String issueIdOrKey, Map requestBody, String expand, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = requestBody; // create path and map variables String localVarPath = "/rest/api/3/issue/{issueIdOrKey}/comment" .replace("{" + "issueIdOrKey" + "}", localVarApiClient.escapeString(issueIdOrKey.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (expand != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("expand", expand)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "OAuth2", "basicAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call addCommentValidateBeforeCall(String issueIdOrKey, Map requestBody, String expand, final ApiCallback _callback) throws ApiException { // verify the required parameter 'issueIdOrKey' is set if (issueIdOrKey == null) { throw new ApiException("Missing the required parameter 'issueIdOrKey' when calling addComment(Async)"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException("Missing the required parameter 'requestBody' when calling addComment(Async)"); } return addCommentCall(issueIdOrKey, requestBody, expand, _callback); } /** * Add comment * Adds a comment to an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Add comments* [ project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * @param issueIdOrKey The ID or key of the issue. (required) * @param requestBody (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return Comment * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if the request is invalid. -
401 Returned if the authentication credentials are incorrect. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public Comment addComment(String issueIdOrKey, Map requestBody, String expand) throws ApiException { ApiResponse localVarResp = addCommentWithHttpInfo(issueIdOrKey, requestBody, expand); return localVarResp.getData(); } /** * Add comment * Adds a comment to an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Add comments* [ project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * @param issueIdOrKey The ID or key of the issue. (required) * @param requestBody (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return ApiResponse<Comment> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if the request is invalid. -
401 Returned if the authentication credentials are incorrect. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public ApiResponse addCommentWithHttpInfo(String issueIdOrKey, Map requestBody, String expand) throws ApiException { okhttp3.Call localVarCall = addCommentValidateBeforeCall(issueIdOrKey, requestBody, expand, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Add comment (asynchronously) * Adds a comment to an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Add comments* [ project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * @param issueIdOrKey The ID or key of the issue. (required) * @param requestBody (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if the request is invalid. -
401 Returned if the authentication credentials are incorrect. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public okhttp3.Call addCommentAsync(String issueIdOrKey, Map requestBody, String expand, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = addCommentValidateBeforeCall(issueIdOrKey, requestBody, expand, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteComment * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
400 Returned if the user does not have permission to delete the comment. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
405 Returned if an anonymous call is made to the operation. -
*/ public okhttp3.Call deleteCommentCall(String issueIdOrKey, String id, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/rest/api/3/issue/{issueIdOrKey}/comment/{id}" .replace("{" + "issueIdOrKey" + "}", localVarApiClient.escapeString(issueIdOrKey.toString())) .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "OAuth2", "basicAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call deleteCommentValidateBeforeCall(String issueIdOrKey, String id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'issueIdOrKey' is set if (issueIdOrKey == null) { throw new ApiException("Missing the required parameter 'issueIdOrKey' when calling deleteComment(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling deleteComment(Async)"); } return deleteCommentCall(issueIdOrKey, id, _callback); } /** * Delete comment * Deletes a comment. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Delete all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or *Delete own comments* to delete comment created by the user, * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
400 Returned if the user does not have permission to delete the comment. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
405 Returned if an anonymous call is made to the operation. -
*/ public void deleteComment(String issueIdOrKey, String id) throws ApiException { deleteCommentWithHttpInfo(issueIdOrKey, id); } /** * Delete comment * Deletes a comment. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Delete all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or *Delete own comments* to delete comment created by the user, * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
400 Returned if the user does not have permission to delete the comment. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
405 Returned if an anonymous call is made to the operation. -
*/ public ApiResponse deleteCommentWithHttpInfo(String issueIdOrKey, String id) throws ApiException { okhttp3.Call localVarCall = deleteCommentValidateBeforeCall(issueIdOrKey, id, null); return localVarApiClient.execute(localVarCall); } /** * Delete comment (asynchronously) * Deletes a comment. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Delete all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or *Delete own comments* to delete comment created by the user, * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
400 Returned if the user does not have permission to delete the comment. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
405 Returned if an anonymous call is made to the operation. -
*/ public okhttp3.Call deleteCommentAsync(String issueIdOrKey, String id, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteCommentValidateBeforeCall(issueIdOrKey, id, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for getComment * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public okhttp3.Call getCommentCall(String issueIdOrKey, String id, String expand, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/rest/api/3/issue/{issueIdOrKey}/comment/{id}" .replace("{" + "issueIdOrKey" + "}", localVarApiClient.escapeString(issueIdOrKey.toString())) .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (expand != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("expand", expand)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "OAuth2", "basicAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getCommentValidateBeforeCall(String issueIdOrKey, String id, String expand, final ApiCallback _callback) throws ApiException { // verify the required parameter 'issueIdOrKey' is set if (issueIdOrKey == null) { throw new ApiException("Missing the required parameter 'issueIdOrKey' when calling getComment(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getComment(Async)"); } return getCommentCall(issueIdOrKey, id, expand, _callback); } /** * Get comment * Returns a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return Comment * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public Comment getComment(String issueIdOrKey, String id, String expand) throws ApiException { ApiResponse localVarResp = getCommentWithHttpInfo(issueIdOrKey, id, expand); return localVarResp.getData(); } /** * Get comment * Returns a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return ApiResponse<Comment> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public ApiResponse getCommentWithHttpInfo(String issueIdOrKey, String id, String expand) throws ApiException { okhttp3.Call localVarCall = getCommentValidateBeforeCall(issueIdOrKey, id, expand, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get comment (asynchronously) * Returns a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public okhttp3.Call getCommentAsync(String issueIdOrKey, String id, String expand, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getCommentValidateBeforeCall(issueIdOrKey, id, expand, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getComments * @param issueIdOrKey The ID or key of the issue. (required) * @param startAt The index of the first item to return in a page of results (page offset). (optional, default to 0) * @param maxResults The maximum number of items to return per page. (optional, default to 5000) * @param orderBy [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. (optional) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if `orderBy` is set to a value other than *created*. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public okhttp3.Call getCommentsCall(String issueIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = null; // create path and map variables String localVarPath = "/rest/api/3/issue/{issueIdOrKey}/comment" .replace("{" + "issueIdOrKey" + "}", localVarApiClient.escapeString(issueIdOrKey.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (startAt != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("startAt", startAt)); } if (maxResults != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("maxResults", maxResults)); } if (orderBy != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("orderBy", orderBy)); } if (expand != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("expand", expand)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "OAuth2", "basicAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getCommentsValidateBeforeCall(String issueIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand, final ApiCallback _callback) throws ApiException { // verify the required parameter 'issueIdOrKey' is set if (issueIdOrKey == null) { throw new ApiException("Missing the required parameter 'issueIdOrKey' when calling getComments(Async)"); } return getCommentsCall(issueIdOrKey, startAt, maxResults, orderBy, expand, _callback); } /** * Get comments * Returns all comments for an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are included in the response where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param startAt The index of the first item to return in a page of results (page offset). (optional, default to 0) * @param maxResults The maximum number of items to return per page. (optional, default to 5000) * @param orderBy [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. (optional) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return PageOfComments * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if `orderBy` is set to a value other than *created*. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public PageOfComments getComments(String issueIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand) throws ApiException { ApiResponse localVarResp = getCommentsWithHttpInfo(issueIdOrKey, startAt, maxResults, orderBy, expand); return localVarResp.getData(); } /** * Get comments * Returns all comments for an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are included in the response where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param startAt The index of the first item to return in a page of results (page offset). (optional, default to 0) * @param maxResults The maximum number of items to return per page. (optional, default to 5000) * @param orderBy [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. (optional) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return ApiResponse<PageOfComments> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if `orderBy` is set to a value other than *created*. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public ApiResponse getCommentsWithHttpInfo(String issueIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand) throws ApiException { okhttp3.Call localVarCall = getCommentsValidateBeforeCall(issueIdOrKey, startAt, maxResults, orderBy, expand, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get comments (asynchronously) * Returns all comments for an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are included in the response where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param startAt The index of the first item to return in a page of results (page offset). (optional, default to 0) * @param maxResults The maximum number of items to return per page. (optional, default to 5000) * @param orderBy [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. (optional) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if `orderBy` is set to a value other than *created*. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue is not found or the user does not have permission to view it. -
*/ public okhttp3.Call getCommentsAsync(String issueIdOrKey, Long startAt, Integer maxResults, String orderBy, String expand, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getCommentsValidateBeforeCall(issueIdOrKey, startAt, maxResults, orderBy, expand, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getCommentsByIds * @param issueCommentListRequestBean The list of comment IDs. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: * `renderedBody` Returns the comment body rendered in HTML. * `properties` Returns the comment's properties. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request contains more than 1000 IDs or is empty. -
*/ public okhttp3.Call getCommentsByIdsCall(IssueCommentListRequestBean issueCommentListRequestBean, String expand, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = issueCommentListRequestBean; // create path and map variables String localVarPath = "/rest/api/3/comment/list"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (expand != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("expand", expand)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "OAuth2", "basicAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call getCommentsByIdsValidateBeforeCall(IssueCommentListRequestBean issueCommentListRequestBean, String expand, final ApiCallback _callback) throws ApiException { // verify the required parameter 'issueCommentListRequestBean' is set if (issueCommentListRequestBean == null) { throw new ApiException("Missing the required parameter 'issueCommentListRequestBean' when calling getCommentsByIds(Async)"); } return getCommentsByIdsCall(issueCommentListRequestBean, expand, _callback); } /** * Get comments by IDs * Returns a [paginated](#pagination) list of comments specified by a list of comment IDs. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are returned where the user: * has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. * @param issueCommentListRequestBean The list of comment IDs. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: * `renderedBody` Returns the comment body rendered in HTML. * `properties` Returns the comment's properties. (optional) * @return PageBeanComment * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request contains more than 1000 IDs or is empty. -
*/ public PageBeanComment getCommentsByIds(IssueCommentListRequestBean issueCommentListRequestBean, String expand) throws ApiException { ApiResponse localVarResp = getCommentsByIdsWithHttpInfo(issueCommentListRequestBean, expand); return localVarResp.getData(); } /** * Get comments by IDs * Returns a [paginated](#pagination) list of comments specified by a list of comment IDs. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are returned where the user: * has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. * @param issueCommentListRequestBean The list of comment IDs. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: * `renderedBody` Returns the comment body rendered in HTML. * `properties` Returns the comment's properties. (optional) * @return ApiResponse<PageBeanComment> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request contains more than 1000 IDs or is empty. -
*/ public ApiResponse getCommentsByIdsWithHttpInfo(IssueCommentListRequestBean issueCommentListRequestBean, String expand) throws ApiException { okhttp3.Call localVarCall = getCommentsByIdsValidateBeforeCall(issueCommentListRequestBean, expand, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get comments by IDs (asynchronously) * Returns a [paginated](#pagination) list of comments specified by a list of comment IDs. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are returned where the user: * has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. * @param issueCommentListRequestBean The list of comment IDs. (required) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: * `renderedBody` Returns the comment body rendered in HTML. * `properties` Returns the comment's properties. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request contains more than 1000 IDs or is empty. -
*/ public okhttp3.Call getCommentsByIdsAsync(IssueCommentListRequestBean issueCommentListRequestBean, String expand, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getCommentsByIdsValidateBeforeCall(issueCommentListRequestBean, expand, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateComment * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param requestBody (required) * @param notifyUsers Whether users are notified when a comment is updated. (optional, default to true) * @param overrideEditableFlag Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). (optional, default to false) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the user does not have permission to edit the comment or the request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public okhttp3.Call updateCommentCall(String issueIdOrKey, String id, Map requestBody, Boolean notifyUsers, Boolean overrideEditableFlag, String expand, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = requestBody; // create path and map variables String localVarPath = "/rest/api/3/issue/{issueIdOrKey}/comment/{id}" .replace("{" + "issueIdOrKey" + "}", localVarApiClient.escapeString(issueIdOrKey.toString())) .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (notifyUsers != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("notifyUsers", notifyUsers)); } if (overrideEditableFlag != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("overrideEditableFlag", overrideEditableFlag)); } if (expand != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("expand", expand)); } final String[] localVarAccepts = { "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); if (localVarContentType != null) { localVarHeaderParams.put("Content-Type", localVarContentType); } String[] localVarAuthNames = new String[] { "OAuth2", "basicAuth" }; return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call updateCommentValidateBeforeCall(String issueIdOrKey, String id, Map requestBody, Boolean notifyUsers, Boolean overrideEditableFlag, String expand, final ApiCallback _callback) throws ApiException { // verify the required parameter 'issueIdOrKey' is set if (issueIdOrKey == null) { throw new ApiException("Missing the required parameter 'issueIdOrKey' when calling updateComment(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling updateComment(Async)"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException("Missing the required parameter 'requestBody' when calling updateComment(Async)"); } return updateCommentCall(issueIdOrKey, id, requestBody, notifyUsers, overrideEditableFlag, expand, _callback); } /** * Update comment * Updates a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or *Edit own comments* to update comment created by the user. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param requestBody (required) * @param notifyUsers Whether users are notified when a comment is updated. (optional, default to true) * @param overrideEditableFlag Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). (optional, default to false) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return Comment * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the user does not have permission to edit the comment or the request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public Comment updateComment(String issueIdOrKey, String id, Map requestBody, Boolean notifyUsers, Boolean overrideEditableFlag, String expand) throws ApiException { ApiResponse localVarResp = updateCommentWithHttpInfo(issueIdOrKey, id, requestBody, notifyUsers, overrideEditableFlag, expand); return localVarResp.getData(); } /** * Update comment * Updates a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or *Edit own comments* to update comment created by the user. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param requestBody (required) * @param notifyUsers Whether users are notified when a comment is updated. (optional, default to true) * @param overrideEditableFlag Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). (optional, default to false) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @return ApiResponse<Comment> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the user does not have permission to edit the comment or the request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public ApiResponse updateCommentWithHttpInfo(String issueIdOrKey, String id, Map requestBody, Boolean notifyUsers, Boolean overrideEditableFlag, String expand) throws ApiException { okhttp3.Call localVarCall = updateCommentValidateBeforeCall(issueIdOrKey, id, requestBody, notifyUsers, overrideEditableFlag, expand, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Update comment (asynchronously) * Updates a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or *Edit own comments* to update comment created by the user. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. * @param issueIdOrKey The ID or key of the issue. (required) * @param id The ID of the comment. (required) * @param requestBody (required) * @param notifyUsers Whether users are notified when a comment is updated. (optional, default to true) * @param overrideEditableFlag Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). (optional, default to false) * @param expand Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the user does not have permission to edit the comment or the request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the issue or comment is not found or the user does not have permission to view the issue or comment. -
*/ public okhttp3.Call updateCommentAsync(String issueIdOrKey, String id, Map requestBody, Boolean notifyUsers, Boolean overrideEditableFlag, String expand, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateCommentValidateBeforeCall(issueIdOrKey, id, requestBody, notifyUsers, overrideEditableFlag, expand, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy