Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.tnb.jira.validation.generated.api.IssueWatchersApi Maven / Gradle / Ivy
/*
* 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.BulkIssueIsWatching;
import software.tnb.jira.validation.generated.model.IssueList;
import software.tnb.jira.validation.generated.model.Watchers;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class IssueWatchersApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public IssueWatchersApi() {
this(Configuration.getDefaultApiClient());
}
public IssueWatchersApi(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 addWatcher
* @param issueIdOrKey The ID or key of the issue. (required)
* @param body The account ID of the user. Note that username cannot be used due to privacy changes. (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 request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public okhttp3.Call addWatcherCall(String issueIdOrKey, String body, 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 = body;
// create path and map variables
String localVarPath = "/rest/api/3/issue/{issueIdOrKey}/watchers"
.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();
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 addWatcherValidateBeforeCall(String issueIdOrKey, String body, 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 addWatcher(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling addWatcher(Async)");
}
return addWatcherCall(issueIdOrKey, body, _callback);
}
/**
* Add watcher
* Adds a user as a watcher of an issue by passing the account ID of the user. For example, `\"5b10ac8d82e05b22cc7d4ef5\"`. If no user is specified the calling user is added. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To add users other than themselves to the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @param body The account ID of the user. Note that username cannot be used due to privacy changes. (required)
* @return Object
* @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 request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public Object addWatcher(String issueIdOrKey, String body) throws ApiException {
ApiResponse localVarResp = addWatcherWithHttpInfo(issueIdOrKey, body);
return localVarResp.getData();
}
/**
* Add watcher
* Adds a user as a watcher of an issue by passing the account ID of the user. For example, `\"5b10ac8d82e05b22cc7d4ef5\"`. If no user is specified the calling user is added. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To add users other than themselves to the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @param body The account ID of the user. Note that username cannot be used due to privacy changes. (required)
* @return ApiResponse<Object>
* @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 request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public ApiResponse addWatcherWithHttpInfo(String issueIdOrKey, String body) throws ApiException {
okhttp3.Call localVarCall = addWatcherValidateBeforeCall(issueIdOrKey, body, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Add watcher (asynchronously)
* Adds a user as a watcher of an issue by passing the account ID of the user. For example, `\"5b10ac8d82e05b22cc7d4ef5\"`. If no user is specified the calling user is added. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To add users other than themselves to the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @param body The account ID of the user. Note that username cannot be used due to privacy changes. (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 request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public okhttp3.Call addWatcherAsync(String issueIdOrKey, String body, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = addWatcherValidateBeforeCall(issueIdOrKey, body, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getIsWatchingIssueBulk
* @param issueList A list of issue IDs. (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
200 Returned if the request is successful -
401 Returned if the authentication credentials are incorrect or missing. -
*/
public okhttp3.Call getIsWatchingIssueBulkCall(IssueList issueList, 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 = issueList;
// create path and map variables
String localVarPath = "/rest/api/3/issue/watching";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
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 getIsWatchingIssueBulkValidateBeforeCall(IssueList issueList, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'issueList' is set
if (issueList == null) {
throw new ApiException("Missing the required parameter 'issueList' when calling getIsWatchingIssueBulk(Async)");
}
return getIsWatchingIssueBulkCall(issueList, _callback);
}
/**
* Get is watching issue bulk
* Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned watched status is `false`. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.
* @param issueList A list of issue IDs. (required)
* @return BulkIssueIsWatching
* @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. -
*/
public BulkIssueIsWatching getIsWatchingIssueBulk(IssueList issueList) throws ApiException {
ApiResponse localVarResp = getIsWatchingIssueBulkWithHttpInfo(issueList);
return localVarResp.getData();
}
/**
* Get is watching issue bulk
* Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned watched status is `false`. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.
* @param issueList A list of issue IDs. (required)
* @return ApiResponse<BulkIssueIsWatching>
* @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. -
*/
public ApiResponse getIsWatchingIssueBulkWithHttpInfo(IssueList issueList) throws ApiException {
okhttp3.Call localVarCall = getIsWatchingIssueBulkValidateBeforeCall(issueList, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get is watching issue bulk (asynchronously)
* Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned watched status is `false`. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue.
* @param issueList A list of issue IDs. (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
200 Returned if the request is successful -
401 Returned if the authentication credentials are incorrect or missing. -
*/
public okhttp3.Call getIsWatchingIssueBulkAsync(IssueList issueList, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getIsWatchingIssueBulkValidateBeforeCall(issueList, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getIssueWatchers
* @param issueIdOrKey The ID or key of the issue. (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
200 Returned if the request is successful -
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 getIssueWatchersCall(String issueIdOrKey, 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}/watchers"
.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();
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 getIssueWatchersValidateBeforeCall(String issueIdOrKey, 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 getIssueWatchers(Async)");
}
return getIssueWatchersCall(issueIdOrKey, _callback);
}
/**
* Get issue watchers
* Returns the watchers for an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. 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 is ini * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To see details of users on the watchlist other than themselves, *View voters and watchers* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @return Watchers
* @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 is not found or the user does not have permission to view it. -
*/
public Watchers getIssueWatchers(String issueIdOrKey) throws ApiException {
ApiResponse localVarResp = getIssueWatchersWithHttpInfo(issueIdOrKey);
return localVarResp.getData();
}
/**
* Get issue watchers
* Returns the watchers for an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. 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 is ini * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To see details of users on the watchlist other than themselves, *View voters and watchers* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @return ApiResponse<Watchers>
* @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 is not found or the user does not have permission to view it. -
*/
public ApiResponse getIssueWatchersWithHttpInfo(String issueIdOrKey) throws ApiException {
okhttp3.Call localVarCall = getIssueWatchersValidateBeforeCall(issueIdOrKey, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get issue watchers (asynchronously)
* Returns the watchers for an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. 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 is ini * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To see details of users on the watchlist other than themselves, *View voters and watchers* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (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
200 Returned if the request is successful -
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 getIssueWatchersAsync(String issueIdOrKey, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getIssueWatchersValidateBeforeCall(issueIdOrKey, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for removeWatcher
* @param issueIdOrKey The ID or key of the issue. (required)
* @param username This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. (optional)
* @param accountId The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. (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
204 Returned if the request is successful. -
400 Returned if `accountId` is not supplied. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public okhttp3.Call removeWatcherCall(String issueIdOrKey, String username, String accountId, 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}/watchers"
.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 (username != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username));
}
if (accountId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("accountId", accountId));
}
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 removeWatcherValidateBeforeCall(String issueIdOrKey, String username, String accountId, 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 removeWatcher(Async)");
}
return removeWatcherCall(issueIdOrKey, username, accountId, _callback);
}
/**
* Delete watcher
* Deletes a user as a watcher of an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To remove users other than themselves from the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @param username This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. (optional)
* @param accountId The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. (optional)
* @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 `accountId` is not supplied. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public void removeWatcher(String issueIdOrKey, String username, String accountId) throws ApiException {
removeWatcherWithHttpInfo(issueIdOrKey, username, accountId);
}
/**
* Delete watcher
* Deletes a user as a watcher of an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To remove users other than themselves from the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @param username This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. (optional)
* @param accountId The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. (optional)
* @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 `accountId` is not supplied. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public ApiResponse removeWatcherWithHttpInfo(String issueIdOrKey, String username, String accountId) throws ApiException {
okhttp3.Call localVarCall = removeWatcherValidateBeforeCall(issueIdOrKey, username, accountId, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete watcher (asynchronously)
* Deletes a user as a watcher of an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To remove users other than themselves from the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in.
* @param issueIdOrKey The ID or key of the issue. (required)
* @param username This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. (optional)
* @param accountId The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. (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
204 Returned if the request is successful. -
400 Returned if `accountId` is not supplied. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have the permission to manage the watcher list. -
404 Returned if the issue or the user is not found or the user does not have permission to view the issue. -
*/
public okhttp3.Call removeWatcherAsync(String issueIdOrKey, String username, String accountId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = removeWatcherValidateBeforeCall(issueIdOrKey, username, accountId, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
}