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.
/*
* 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.BulkPermissionGrants;
import software.tnb.jira.validation.generated.model.BulkPermissionsRequestBean;
import software.tnb.jira.validation.generated.model.ErrorCollection;
import software.tnb.jira.validation.generated.model.Permissions;
import software.tnb.jira.validation.generated.model.PermissionsKeysBean;
import software.tnb.jira.validation.generated.model.PermittedProjects;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PermissionsApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public PermissionsApi() {
this(Configuration.getDefaultApiClient());
}
public PermissionsApi(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 getAllPermissions
* @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.
-
403
Returned if the user does not have the necessary permission.
-
*/
public okhttp3.Call getAllPermissionsCall(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/permissions";
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 getAllPermissionsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getAllPermissionsCall(_callback);
}
/**
* Get all permissions
* Returns all permissions, including: * global permissions. * project permissions. * global permissions added by plugins. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
* @return Permissions
* @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.
-
403
Returned if the user does not have the necessary permission.
-
*/
public Permissions getAllPermissions() throws ApiException {
ApiResponse localVarResp = getAllPermissionsWithHttpInfo();
return localVarResp.getData();
}
/**
* Get all permissions
* Returns all permissions, including: * global permissions. * project permissions. * global permissions added by plugins. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
* @return ApiResponse<Permissions>
* @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.
-
403
Returned if the user does not have the necessary permission.
-
*/
public ApiResponse getAllPermissionsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getAllPermissionsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get all permissions (asynchronously)
* Returns all permissions, including: * global permissions. * project permissions. * global permissions added by plugins. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg).
* @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.
-
403
Returned if the user does not have the necessary permission.
-
*/
public okhttp3.Call getAllPermissionsAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getAllPermissionsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getBulkPermissions
* @param bulkPermissionsRequestBean Details of the permissions to check. (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.
-
400
Returned if: * `projectPermissions` is provided without at least one project permission being provided. * an invalid global permission is provided in the global permissions list. * an invalid project permission is provided in the project permissions list. * more than 1000 valid project IDs or more than 1000 valid issue IDs are provided. * an invalid account ID is provided.
-
403
Returned if the user does not have the necessary permission.
-
*/
public okhttp3.Call getBulkPermissionsCall(BulkPermissionsRequestBean bulkPermissionsRequestBean, 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 = bulkPermissionsRequestBean;
// create path and map variables
String localVarPath = "/rest/api/3/permissions/check";
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 getBulkPermissionsValidateBeforeCall(BulkPermissionsRequestBean bulkPermissionsRequestBean, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'bulkPermissionsRequestBean' is set
if (bulkPermissionsRequestBean == null) {
throw new ApiException("Missing the required parameter 'bulkPermissionsRequestBean' when calling getBulkPermissions(Async)");
}
return getBulkPermissionsCall(bulkPermissionsRequestBean, _callback);
}
/**
* Get bulk permissions
* Returns: * for a list of global permissions, the global permissions granted to a user. * for a list of project permissions and lists of projects and issues, for each project permission a list of the projects and issues a user can access or manipulate. If no account ID is provided, the operation returns details for the logged in user. Note that: * Invalid project and issue IDs are ignored. * A maximum of 1000 projects and 1000 issues can be checked. * Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and `projectPermissions.issues` are ignored. * Empty strings in `projectPermissions.permissions` are ignored. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made using AP.request() in a browser.
* @param bulkPermissionsRequestBean Details of the permissions to check. (required)
* @return BulkPermissionGrants
* @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: * `projectPermissions` is provided without at least one project permission being provided. * an invalid global permission is provided in the global permissions list. * an invalid project permission is provided in the project permissions list. * more than 1000 valid project IDs or more than 1000 valid issue IDs are provided. * an invalid account ID is provided.
-
403
Returned if the user does not have the necessary permission.
-
*/
public BulkPermissionGrants getBulkPermissions(BulkPermissionsRequestBean bulkPermissionsRequestBean) throws ApiException {
ApiResponse localVarResp = getBulkPermissionsWithHttpInfo(bulkPermissionsRequestBean);
return localVarResp.getData();
}
/**
* Get bulk permissions
* Returns: * for a list of global permissions, the global permissions granted to a user. * for a list of project permissions and lists of projects and issues, for each project permission a list of the projects and issues a user can access or manipulate. If no account ID is provided, the operation returns details for the logged in user. Note that: * Invalid project and issue IDs are ignored. * A maximum of 1000 projects and 1000 issues can be checked. * Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and `projectPermissions.issues` are ignored. * Empty strings in `projectPermissions.permissions` are ignored. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made using AP.request() in a browser.
* @param bulkPermissionsRequestBean Details of the permissions to check. (required)
* @return ApiResponse<BulkPermissionGrants>
* @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: * `projectPermissions` is provided without at least one project permission being provided. * an invalid global permission is provided in the global permissions list. * an invalid project permission is provided in the project permissions list. * more than 1000 valid project IDs or more than 1000 valid issue IDs are provided. * an invalid account ID is provided.
-
403
Returned if the user does not have the necessary permission.
-
*/
public ApiResponse getBulkPermissionsWithHttpInfo(BulkPermissionsRequestBean bulkPermissionsRequestBean) throws ApiException {
okhttp3.Call localVarCall = getBulkPermissionsValidateBeforeCall(bulkPermissionsRequestBean, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get bulk permissions (asynchronously)
* Returns: * for a list of global permissions, the global permissions granted to a user. * for a list of project permissions and lists of projects and issues, for each project permission a list of the projects and issues a user can access or manipulate. If no account ID is provided, the operation returns details for the logged in user. Note that: * Invalid project and issue IDs are ignored. * A maximum of 1000 projects and 1000 issues can be checked. * Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and `projectPermissions.issues` are ignored. * Empty strings in `projectPermissions.permissions` are ignored. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made using AP.request() in a browser.
* @param bulkPermissionsRequestBean Details of the permissions to check. (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.
-
400
Returned if: * `projectPermissions` is provided without at least one project permission being provided. * an invalid global permission is provided in the global permissions list. * an invalid project permission is provided in the project permissions list. * more than 1000 valid project IDs or more than 1000 valid issue IDs are provided. * an invalid account ID is provided.
-
403
Returned if the user does not have the necessary permission.
-
*/
public okhttp3.Call getBulkPermissionsAsync(BulkPermissionsRequestBean bulkPermissionsRequestBean, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getBulkPermissionsValidateBeforeCall(bulkPermissionsRequestBean, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getMyPermissions
* @param projectKey The key of project. Ignored if `projectId` is provided. (optional)
* @param projectId The ID of project. (optional)
* @param issueKey The key of the issue. Ignored if `issueId` is provided. (optional)
* @param issueId The ID of the issue. (optional)
* @param permissions A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). (optional)
* @param projectUuid (optional)
* @param projectConfigurationUuid (optional)
* @param commentId The ID of the comment. (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 `permissions` is empty, contains an invalid key, or does not equal BROWSE\\_PROJECTS when commentId is provided.
-
401
Returned if the authentication credentials are incorrect or missing.
-
404
Returned if the project or issue is not found or the user does not have permission to view the project or issue.
-
*/
public okhttp3.Call getMyPermissionsCall(String projectKey, String projectId, String issueKey, String issueId, String permissions, String projectUuid, String projectConfigurationUuid, String commentId, 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/mypermissions";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (projectKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectKey", projectKey));
}
if (projectId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectId", projectId));
}
if (issueKey != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("issueKey", issueKey));
}
if (issueId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("issueId", issueId));
}
if (permissions != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("permissions", permissions));
}
if (projectUuid != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectUuid", projectUuid));
}
if (projectConfigurationUuid != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("projectConfigurationUuid", projectConfigurationUuid));
}
if (commentId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("commentId", commentId));
}
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 getMyPermissionsValidateBeforeCall(String projectKey, String projectId, String issueKey, String issueId, String permissions, String projectUuid, String projectConfigurationUuid, String commentId, final ApiCallback _callback) throws ApiException {
return getMyPermissionsCall(projectKey, projectId, issueKey, issueId, permissions, projectUuid, projectConfigurationUuid, commentId, _callback);
}
/**
* Get my permissions
* Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be obtained in a global, project, issue or comment context. The user is reported as having a project permission: * in the global context, if the user has the project permission in any project. * for a project, where the project permission is determined using issue data, if the user meets the permission's criteria for any issue in the project. Otherwise, if the user has the project permission in the project. * for an issue, where a project permission is determined using issue data, if the user has the permission in the issue. Otherwise, if the user has the project permission in the project containing the issue. * for a comment, where the user has both the permission to browse the comment and the project permission for the comment's parent issue. Only the BROWSE\\_PROJECTS permission is supported. If a `commentId` is provided whose `permissions` does not equal BROWSE\\_PROJECTS, a 400 error will be returned. This means that users may be shown as having an issue permission (such as EDIT\\_ISSUES) in the global context or a project context but may not have the permission for any or all issues. For example, if Reporters have the EDIT\\_ISSUES permission a user would be shown as having this permission in the global context or the context of a project, because any user can be a reporter. However, if they are not the user who reported the issue queried they would not have EDIT\\_ISSUES permission for that issue. Global permissions are unaffected by context. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @param projectKey The key of project. Ignored if `projectId` is provided. (optional)
* @param projectId The ID of project. (optional)
* @param issueKey The key of the issue. Ignored if `issueId` is provided. (optional)
* @param issueId The ID of the issue. (optional)
* @param permissions A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). (optional)
* @param projectUuid (optional)
* @param projectConfigurationUuid (optional)
* @param commentId The ID of the comment. (optional)
* @return Permissions
* @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 `permissions` is empty, contains an invalid key, or does not equal BROWSE\\_PROJECTS when commentId is provided.
-
401
Returned if the authentication credentials are incorrect or missing.
-
404
Returned if the project or issue is not found or the user does not have permission to view the project or issue.
-
*/
public Permissions getMyPermissions(String projectKey, String projectId, String issueKey, String issueId, String permissions, String projectUuid, String projectConfigurationUuid, String commentId) throws ApiException {
ApiResponse localVarResp = getMyPermissionsWithHttpInfo(projectKey, projectId, issueKey, issueId, permissions, projectUuid, projectConfigurationUuid, commentId);
return localVarResp.getData();
}
/**
* Get my permissions
* Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be obtained in a global, project, issue or comment context. The user is reported as having a project permission: * in the global context, if the user has the project permission in any project. * for a project, where the project permission is determined using issue data, if the user meets the permission's criteria for any issue in the project. Otherwise, if the user has the project permission in the project. * for an issue, where a project permission is determined using issue data, if the user has the permission in the issue. Otherwise, if the user has the project permission in the project containing the issue. * for a comment, where the user has both the permission to browse the comment and the project permission for the comment's parent issue. Only the BROWSE\\_PROJECTS permission is supported. If a `commentId` is provided whose `permissions` does not equal BROWSE\\_PROJECTS, a 400 error will be returned. This means that users may be shown as having an issue permission (such as EDIT\\_ISSUES) in the global context or a project context but may not have the permission for any or all issues. For example, if Reporters have the EDIT\\_ISSUES permission a user would be shown as having this permission in the global context or the context of a project, because any user can be a reporter. However, if they are not the user who reported the issue queried they would not have EDIT\\_ISSUES permission for that issue. Global permissions are unaffected by context. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @param projectKey The key of project. Ignored if `projectId` is provided. (optional)
* @param projectId The ID of project. (optional)
* @param issueKey The key of the issue. Ignored if `issueId` is provided. (optional)
* @param issueId The ID of the issue. (optional)
* @param permissions A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). (optional)
* @param projectUuid (optional)
* @param projectConfigurationUuid (optional)
* @param commentId The ID of the comment. (optional)
* @return ApiResponse<Permissions>
* @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 `permissions` is empty, contains an invalid key, or does not equal BROWSE\\_PROJECTS when commentId is provided.
-
401
Returned if the authentication credentials are incorrect or missing.
-
404
Returned if the project or issue is not found or the user does not have permission to view the project or issue.
-
*/
public ApiResponse getMyPermissionsWithHttpInfo(String projectKey, String projectId, String issueKey, String issueId, String permissions, String projectUuid, String projectConfigurationUuid, String commentId) throws ApiException {
okhttp3.Call localVarCall = getMyPermissionsValidateBeforeCall(projectKey, projectId, issueKey, issueId, permissions, projectUuid, projectConfigurationUuid, commentId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get my permissions (asynchronously)
* Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be obtained in a global, project, issue or comment context. The user is reported as having a project permission: * in the global context, if the user has the project permission in any project. * for a project, where the project permission is determined using issue data, if the user meets the permission's criteria for any issue in the project. Otherwise, if the user has the project permission in the project. * for an issue, where a project permission is determined using issue data, if the user has the permission in the issue. Otherwise, if the user has the project permission in the project containing the issue. * for a comment, where the user has both the permission to browse the comment and the project permission for the comment's parent issue. Only the BROWSE\\_PROJECTS permission is supported. If a `commentId` is provided whose `permissions` does not equal BROWSE\\_PROJECTS, a 400 error will be returned. This means that users may be shown as having an issue permission (such as EDIT\\_ISSUES) in the global context or a project context but may not have the permission for any or all issues. For example, if Reporters have the EDIT\\_ISSUES permission a user would be shown as having this permission in the global context or the context of a project, because any user can be a reporter. However, if they are not the user who reported the issue queried they would not have EDIT\\_ISSUES permission for that issue. Global permissions are unaffected by context. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @param projectKey The key of project. Ignored if `projectId` is provided. (optional)
* @param projectId The ID of project. (optional)
* @param issueKey The key of the issue. Ignored if `issueId` is provided. (optional)
* @param issueId The ID of the issue. (optional)
* @param permissions A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). (optional)
* @param projectUuid (optional)
* @param projectConfigurationUuid (optional)
* @param commentId The ID of the comment. (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 `permissions` is empty, contains an invalid key, or does not equal BROWSE\\_PROJECTS when commentId is provided.
-
401
Returned if the authentication credentials are incorrect or missing.
-
404
Returned if the project or issue is not found or the user does not have permission to view the project or issue.
-
*/
public okhttp3.Call getMyPermissionsAsync(String projectKey, String projectId, String issueKey, String issueId, String permissions, String projectUuid, String projectConfigurationUuid, String commentId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getMyPermissionsValidateBeforeCall(projectKey, projectId, issueKey, issueId, permissions, projectUuid, projectConfigurationUuid, commentId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPermittedProjects
* @param permissionsKeysBean (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.
-
400
Returned if a project permission is not found.
-
401
Returned if the authentication credentials are incorrect or missing.
-
*/
public okhttp3.Call getPermittedProjectsCall(PermissionsKeysBean permissionsKeysBean, 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 = permissionsKeysBean;
// create path and map variables
String localVarPath = "/rest/api/3/permissions/project";
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 getPermittedProjectsValidateBeforeCall(PermissionsKeysBean permissionsKeysBean, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'permissionsKeysBean' is set
if (permissionsKeysBean == null) {
throw new ApiException("Missing the required parameter 'permissionsKeysBean' when calling getPermittedProjects(Async)");
}
return getPermittedProjectsCall(permissionsKeysBean, _callback);
}
/**
* Get permitted projects
* Returns all the projects where the user is granted a list of project permissions. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @param permissionsKeysBean (required)
* @return PermittedProjects
* @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 a project permission is not found.
-
401
Returned if the authentication credentials are incorrect or missing.
-
*/
public PermittedProjects getPermittedProjects(PermissionsKeysBean permissionsKeysBean) throws ApiException {
ApiResponse localVarResp = getPermittedProjectsWithHttpInfo(permissionsKeysBean);
return localVarResp.getData();
}
/**
* Get permitted projects
* Returns all the projects where the user is granted a list of project permissions. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @param permissionsKeysBean (required)
* @return ApiResponse<PermittedProjects>
* @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 a project permission is not found.
-
401
Returned if the authentication credentials are incorrect or missing.
-
*/
public ApiResponse getPermittedProjectsWithHttpInfo(PermissionsKeysBean permissionsKeysBean) throws ApiException {
okhttp3.Call localVarCall = getPermittedProjectsValidateBeforeCall(permissionsKeysBean, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get permitted projects (asynchronously)
* Returns all the projects where the user is granted a list of project permissions. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @param permissionsKeysBean (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.
-
400
Returned if a project permission is not found.
-
401
Returned if the authentication credentials are incorrect or missing.
-
*/
public okhttp3.Call getPermittedProjectsAsync(PermissionsKeysBean permissionsKeysBean, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getPermittedProjectsValidateBeforeCall(permissionsKeysBean, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}