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

software.tnb.jira.validation.generated.api.ProjectRolesApi 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.CreateUpdateRoleRequestBean;
import software.tnb.jira.validation.generated.model.ProjectRole;
import software.tnb.jira.validation.generated.model.ProjectRoleDetails;
import java.net.URI;

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

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

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

    public ProjectRolesApi(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 createProjectRole
     * @param createUpdateRoleRequestBean  (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 the request is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
409 Returned if a project role with the provided name already exists. -
*/ public okhttp3.Call createProjectRoleCall(CreateUpdateRoleRequestBean createUpdateRoleRequestBean, 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 = createUpdateRoleRequestBean; // create path and map variables String localVarPath = "/rest/api/3/role"; 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 createProjectRoleValidateBeforeCall(CreateUpdateRoleRequestBean createUpdateRoleRequestBean, final ApiCallback _callback) throws ApiException { // verify the required parameter 'createUpdateRoleRequestBean' is set if (createUpdateRoleRequestBean == null) { throw new ApiException("Missing the required parameter 'createUpdateRoleRequestBean' when calling createProjectRole(Async)"); } return createProjectRoleCall(createUpdateRoleRequestBean, _callback); } /** * Create project role * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role after creating it. *Note that although a new project role is available to all projects upon creation, any default actors that are associated with the project role are not added to projects that existed prior to the role being created.*< **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param createUpdateRoleRequestBean (required) * @return ProjectRole * @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 is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
409 Returned if a project role with the provided name already exists. -
*/ public ProjectRole createProjectRole(CreateUpdateRoleRequestBean createUpdateRoleRequestBean) throws ApiException { ApiResponse localVarResp = createProjectRoleWithHttpInfo(createUpdateRoleRequestBean); return localVarResp.getData(); } /** * Create project role * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role after creating it. *Note that although a new project role is available to all projects upon creation, any default actors that are associated with the project role are not added to projects that existed prior to the role being created.*< **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param createUpdateRoleRequestBean (required) * @return ApiResponse<ProjectRole> * @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 is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
409 Returned if a project role with the provided name already exists. -
*/ public ApiResponse createProjectRoleWithHttpInfo(CreateUpdateRoleRequestBean createUpdateRoleRequestBean) throws ApiException { okhttp3.Call localVarCall = createProjectRoleValidateBeforeCall(createUpdateRoleRequestBean, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Create project role (asynchronously) * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role after creating it. *Note that although a new project role is available to all projects upon creation, any default actors that are associated with the project role are not added to projects that existed prior to the role being created.*< **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param createUpdateRoleRequestBean (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 the request is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
409 Returned if a project role with the provided name already exists. -
*/ public okhttp3.Call createProjectRoleAsync(CreateUpdateRoleRequestBean createUpdateRoleRequestBean, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createProjectRoleValidateBeforeCall(createUpdateRoleRequestBean, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteProjectRole * @param id The ID of the project role to delete. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param swap The ID of the project role that will replace the one being deleted. (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 the request is invalid or if the replacement project role is not found. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role being deleted is not found. -
409 Returned if the project role being deleted is in use and a replacement project role is not specified in the request. -
*/ public okhttp3.Call deleteProjectRoleCall(Long id, Long swap, 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/role/{id}" .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 (swap != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("swap", swap)); } 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 deleteProjectRoleValidateBeforeCall(Long id, Long swap, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling deleteProjectRole(Async)"); } return deleteProjectRoleCall(id, swap, _callback); } /** * Delete project role * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in use. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role to delete. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param swap The ID of the project role that will replace the one being deleted. (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 the request is invalid or if the replacement project role is not found. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role being deleted is not found. -
409 Returned if the project role being deleted is in use and a replacement project role is not specified in the request. -
*/ public void deleteProjectRole(Long id, Long swap) throws ApiException { deleteProjectRoleWithHttpInfo(id, swap); } /** * Delete project role * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in use. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role to delete. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param swap The ID of the project role that will replace the one being deleted. (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 the request is invalid or if the replacement project role is not found. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role being deleted is not found. -
409 Returned if the project role being deleted is in use and a replacement project role is not specified in the request. -
*/ public ApiResponse deleteProjectRoleWithHttpInfo(Long id, Long swap) throws ApiException { okhttp3.Call localVarCall = deleteProjectRoleValidateBeforeCall(id, swap, null); return localVarApiClient.execute(localVarCall); } /** * Delete project role (asynchronously) * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in use. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role to delete. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param swap The ID of the project role that will replace the one being deleted. (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 the request is invalid or if the replacement project role is not found. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role being deleted is not found. -
409 Returned if the project role being deleted is in use and a replacement project role is not specified in the request. -
*/ public okhttp3.Call deleteProjectRoleAsync(Long id, Long swap, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteProjectRoleValidateBeforeCall(id, swap, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for fullyUpdateProjectRole * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (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 the request is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public okhttp3.Call fullyUpdateProjectRoleCall(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean, 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 = createUpdateRoleRequestBean; // create path and map variables String localVarPath = "/rest/api/3/role/{id}" .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 = { "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 fullyUpdateProjectRoleValidateBeforeCall(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling fullyUpdateProjectRole(Async)"); } // verify the required parameter 'createUpdateRoleRequestBean' is set if (createUpdateRoleRequestBean == null) { throw new ApiException("Missing the required parameter 'createUpdateRoleRequestBean' when calling fullyUpdateProjectRole(Async)"); } return fullyUpdateProjectRoleCall(id, createUpdateRoleRequestBean, _callback); } /** * Fully update project role * Updates the project role's name and description. You must include both a name and a description in the request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (required) * @return ProjectRole * @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 is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public ProjectRole fullyUpdateProjectRole(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean) throws ApiException { ApiResponse localVarResp = fullyUpdateProjectRoleWithHttpInfo(id, createUpdateRoleRequestBean); return localVarResp.getData(); } /** * Fully update project role * Updates the project role's name and description. You must include both a name and a description in the request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (required) * @return ApiResponse<ProjectRole> * @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 is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public ApiResponse fullyUpdateProjectRoleWithHttpInfo(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean) throws ApiException { okhttp3.Call localVarCall = fullyUpdateProjectRoleValidateBeforeCall(id, createUpdateRoleRequestBean, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Fully update project role (asynchronously) * Updates the project role's name and description. You must include both a name and a description in the request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (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 the request is not valid. The `name` cannot be empty or start or end with whitespace. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public okhttp3.Call fullyUpdateProjectRoleAsync(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = fullyUpdateProjectRoleValidateBeforeCall(id, createUpdateRoleRequestBean, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getAllProjectRoles * @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 administrative permissions. -
*/ public okhttp3.Call getAllProjectRolesCall(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/role"; 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 getAllProjectRolesValidateBeforeCall(final ApiCallback _callback) throws ApiException { return getAllProjectRolesCall(_callback); } /** * Get all project roles * Gets a list of all project roles, complete with project role details and default actors. ### About project roles ### [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira applications). Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification schemes](#api-rest-api-3-notificationscheme-get), [issue security levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and workflow conditions. #### Members and actors #### In the Jira REST API, a member of a project role is called an *actor*. An *actor* is a group or user associated with a project role. Actors may be set as [default members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) of the project role or set at the project level: * Default actors: Users and groups that are assigned to the project role for all newly created projects. The default actors can be removed at the project level later if desired. * Actors: Users and groups that are associated with a project role for a project, which may differ from the default actors. This enables you to assign a user to different roles in different projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @return List<ProjectRole> * @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 administrative permissions. -
*/ public List getAllProjectRoles() throws ApiException { ApiResponse> localVarResp = getAllProjectRolesWithHttpInfo(); return localVarResp.getData(); } /** * Get all project roles * Gets a list of all project roles, complete with project role details and default actors. ### About project roles ### [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira applications). Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification schemes](#api-rest-api-3-notificationscheme-get), [issue security levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and workflow conditions. #### Members and actors #### In the Jira REST API, a member of a project role is called an *actor*. An *actor* is a group or user associated with a project role. Actors may be set as [default members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) of the project role or set at the project level: * Default actors: Users and groups that are assigned to the project role for all newly created projects. The default actors can be removed at the project level later if desired. * Actors: Users and groups that are associated with a project role for a project, which may differ from the default actors. This enables you to assign a user to different roles in different projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @return ApiResponse<List<ProjectRole>> * @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 administrative permissions. -
*/ public ApiResponse> getAllProjectRolesWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getAllProjectRolesValidateBeforeCall(null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get all project roles (asynchronously) * Gets a list of all project roles, complete with project role details and default actors. ### About project roles ### [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira applications). Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification schemes](#api-rest-api-3-notificationscheme-get), [issue security levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and workflow conditions. #### Members and actors #### In the Jira REST API, a member of a project role is called an *actor*. An *actor* is a group or user associated with a project role. Actors may be set as [default members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) of the project role or set at the project level: * Default actors: Users and groups that are assigned to the project role for all newly created projects. The default actors can be removed at the project level later if desired. * Actors: Users and groups that are associated with a project role for a project, which may differ from the default actors. This enables you to assign a user to different roles in different projects. **[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 administrative permissions. -
*/ public okhttp3.Call getAllProjectRolesAsync(final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getAllProjectRolesValidateBeforeCall(_callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getProjectRole * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param excludeInactiveUsers Exclude inactive users. (optional, default to false) * @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 is not valid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if: * the project or project role is not found. * the user does not have administrative permission. -
*/ public okhttp3.Call getProjectRoleCall(String projectIdOrKey, Long id, Boolean excludeInactiveUsers, 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/project/{projectIdOrKey}/role/{id}" .replace("{" + "projectIdOrKey" + "}", localVarApiClient.escapeString(projectIdOrKey.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 (excludeInactiveUsers != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("excludeInactiveUsers", excludeInactiveUsers)); } 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 getProjectRoleValidateBeforeCall(String projectIdOrKey, Long id, Boolean excludeInactiveUsers, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectIdOrKey' is set if (projectIdOrKey == null) { throw new ApiException("Missing the required parameter 'projectIdOrKey' when calling getProjectRole(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getProjectRole(Async)"); } return getProjectRoleCall(projectIdOrKey, id, excludeInactiveUsers, _callback); } /** * Get project role for project * Returns a project role's details and actors associated with the project. The list of actors is sorted by display name. To check whether a user belongs to a role based on their group memberships, use [Get user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and groups match with the actors returned for the project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param excludeInactiveUsers Exclude inactive users. (optional, default to false) * @return ProjectRole * @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 is not valid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if: * the project or project role is not found. * the user does not have administrative permission. -
*/ public ProjectRole getProjectRole(String projectIdOrKey, Long id, Boolean excludeInactiveUsers) throws ApiException { ApiResponse localVarResp = getProjectRoleWithHttpInfo(projectIdOrKey, id, excludeInactiveUsers); return localVarResp.getData(); } /** * Get project role for project * Returns a project role's details and actors associated with the project. The list of actors is sorted by display name. To check whether a user belongs to a role based on their group memberships, use [Get user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and groups match with the actors returned for the project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param excludeInactiveUsers Exclude inactive users. (optional, default to false) * @return ApiResponse<ProjectRole> * @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 is not valid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if: * the project or project role is not found. * the user does not have administrative permission. -
*/ public ApiResponse getProjectRoleWithHttpInfo(String projectIdOrKey, Long id, Boolean excludeInactiveUsers) throws ApiException { okhttp3.Call localVarCall = getProjectRoleValidateBeforeCall(projectIdOrKey, id, excludeInactiveUsers, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get project role for project (asynchronously) * Returns a project role's details and actors associated with the project. The list of actors is sorted by display name. To check whether a user belongs to a role based on their group memberships, use [Get user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and groups match with the actors returned for the project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param excludeInactiveUsers Exclude inactive users. (optional, default to false) * @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 is not valid. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if: * the project or project role is not found. * the user does not have administrative permission. -
*/ public okhttp3.Call getProjectRoleAsync(String projectIdOrKey, Long id, Boolean excludeInactiveUsers, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getProjectRoleValidateBeforeCall(projectIdOrKey, id, excludeInactiveUsers, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getProjectRoleById * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role 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. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public okhttp3.Call getProjectRoleByIdCall(Long 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/role/{id}" .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 = { "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 getProjectRoleByIdValidateBeforeCall(Long id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getProjectRoleById(Async)"); } return getProjectRoleByIdCall(id, _callback); } /** * Get project role by ID * Gets the project role details and the default actors associated with the role. The list of default actors is sorted by display name. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @return ProjectRole * @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 administrative permissions. -
404 Returned if the project role is not found. -
*/ public ProjectRole getProjectRoleById(Long id) throws ApiException { ApiResponse localVarResp = getProjectRoleByIdWithHttpInfo(id); return localVarResp.getData(); } /** * Get project role by ID * Gets the project role details and the default actors associated with the role. The list of default actors is sorted by display name. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @return ApiResponse<ProjectRole> * @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 administrative permissions. -
404 Returned if the project role is not found. -
*/ public ApiResponse getProjectRoleByIdWithHttpInfo(Long id) throws ApiException { okhttp3.Call localVarCall = getProjectRoleByIdValidateBeforeCall(id, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get project role by ID (asynchronously) * Gets the project role details and the default actors associated with the role. The list of default actors is sorted by display name. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role 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. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public okhttp3.Call getProjectRoleByIdAsync(Long id, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getProjectRoleByIdValidateBeforeCall(id, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getProjectRoleDetails * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param currentMember Whether the roles should be filtered to include only those the user is assigned to. (optional, default to false) * @param excludeConnectAddons (optional, default to false) * @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 project is not found or if the user does not have the necessary permissions for the project. -
*/ public okhttp3.Call getProjectRoleDetailsCall(String projectIdOrKey, Boolean currentMember, Boolean excludeConnectAddons, 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/project/{projectIdOrKey}/roledetails" .replace("{" + "projectIdOrKey" + "}", localVarApiClient.escapeString(projectIdOrKey.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (currentMember != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("currentMember", currentMember)); } if (excludeConnectAddons != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("excludeConnectAddons", excludeConnectAddons)); } 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 getProjectRoleDetailsValidateBeforeCall(String projectIdOrKey, Boolean currentMember, Boolean excludeConnectAddons, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectIdOrKey' is set if (projectIdOrKey == null) { throw new ApiException("Missing the required parameter 'projectIdOrKey' when calling getProjectRoleDetails(Async)"); } return getProjectRoleDetailsCall(projectIdOrKey, currentMember, excludeConnectAddons, _callback); } /** * Get project role details * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the list of project roles is common to all projects. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param currentMember Whether the roles should be filtered to include only those the user is assigned to. (optional, default to false) * @param excludeConnectAddons (optional, default to false) * @return List<ProjectRoleDetails> * @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 project is not found or if the user does not have the necessary permissions for the project. -
*/ public List getProjectRoleDetails(String projectIdOrKey, Boolean currentMember, Boolean excludeConnectAddons) throws ApiException { ApiResponse> localVarResp = getProjectRoleDetailsWithHttpInfo(projectIdOrKey, currentMember, excludeConnectAddons); return localVarResp.getData(); } /** * Get project role details * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the list of project roles is common to all projects. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param currentMember Whether the roles should be filtered to include only those the user is assigned to. (optional, default to false) * @param excludeConnectAddons (optional, default to false) * @return ApiResponse<List<ProjectRoleDetails>> * @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 project is not found or if the user does not have the necessary permissions for the project. -
*/ public ApiResponse> getProjectRoleDetailsWithHttpInfo(String projectIdOrKey, Boolean currentMember, Boolean excludeConnectAddons) throws ApiException { okhttp3.Call localVarCall = getProjectRoleDetailsValidateBeforeCall(projectIdOrKey, currentMember, excludeConnectAddons, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get project role details (asynchronously) * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the list of project roles is common to all projects. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @param currentMember Whether the roles should be filtered to include only those the user is assigned to. (optional, default to false) * @param excludeConnectAddons (optional, default to false) * @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 project is not found or if the user does not have the necessary permissions for the project. -
*/ public okhttp3.Call getProjectRoleDetailsAsync(String projectIdOrKey, Boolean currentMember, Boolean excludeConnectAddons, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getProjectRoleDetailsValidateBeforeCall(projectIdOrKey, currentMember, excludeConnectAddons, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getProjectRoles * @param projectIdOrKey The project ID or project key (case sensitive). (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 or if the user lacks administrative permissions for the project. -
404 Returned if the project is not found or or if the user does not have administrative permissions for the project. -
*/ public okhttp3.Call getProjectRolesCall(String projectIdOrKey, 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/project/{projectIdOrKey}/role" .replace("{" + "projectIdOrKey" + "}", localVarApiClient.escapeString(projectIdOrKey.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 getProjectRolesValidateBeforeCall(String projectIdOrKey, final ApiCallback _callback) throws ApiException { // verify the required parameter 'projectIdOrKey' is set if (projectIdOrKey == null) { throw new ApiException("Missing the required parameter 'projectIdOrKey' when calling getProjectRoles(Async)"); } return getProjectRolesCall(projectIdOrKey, _callback); } /** * Get project roles for project * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and self URL for each role. Note that all project roles are shared with all projects in Jira Cloud. See [Get all project roles](#api-rest-api-3-role-get) for more information. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @return Map<String, URI> * @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 or if the user lacks administrative permissions for the project. -
404 Returned if the project is not found or or if the user does not have administrative permissions for the project. -
*/ public Map getProjectRoles(String projectIdOrKey) throws ApiException { ApiResponse> localVarResp = getProjectRolesWithHttpInfo(projectIdOrKey); return localVarResp.getData(); } /** * Get project roles for project * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and self URL for each role. Note that all project roles are shared with all projects in Jira Cloud. See [Get all project roles](#api-rest-api-3-role-get) for more information. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param projectIdOrKey The project ID or project key (case sensitive). (required) * @return ApiResponse<Map<String, URI>> * @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 or if the user lacks administrative permissions for the project. -
404 Returned if the project is not found or or if the user does not have administrative permissions for the project. -
*/ public ApiResponse> getProjectRolesWithHttpInfo(String projectIdOrKey) throws ApiException { okhttp3.Call localVarCall = getProjectRolesValidateBeforeCall(projectIdOrKey, null); Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get project roles for project (asynchronously) * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and self URL for each role. Note that all project roles are shared with all projects in Jira Cloud. See [Get all project roles](#api-rest-api-3-role-get) for more information. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param projectIdOrKey The project ID or project key (case sensitive). (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 or if the user lacks administrative permissions for the project. -
404 Returned if the project is not found or or if the user does not have administrative permissions for the project. -
*/ public okhttp3.Call getProjectRolesAsync(String projectIdOrKey, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getProjectRolesValidateBeforeCall(projectIdOrKey, _callback); Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for partialUpdateProjectRole * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (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 the request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public okhttp3.Call partialUpdateProjectRoleCall(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean, 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 = createUpdateRoleRequestBean; // create path and map variables String localVarPath = "/rest/api/3/role/{id}" .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 = { "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 partialUpdateProjectRoleValidateBeforeCall(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean, final ApiCallback _callback) throws ApiException { // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling partialUpdateProjectRole(Async)"); } // verify the required parameter 'createUpdateRoleRequestBean' is set if (createUpdateRoleRequestBean == null) { throw new ApiException("Missing the required parameter 'createUpdateRoleRequestBean' when calling partialUpdateProjectRole(Async)"); } return partialUpdateProjectRoleCall(id, createUpdateRoleRequestBean, _callback); } /** * Partial update project role * Updates either the project role's name or its description. You cannot update both the name and description at the same time using this operation. If you send a request with a name and a description only the name is updated. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (required) * @return ProjectRole * @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 is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public ProjectRole partialUpdateProjectRole(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean) throws ApiException { ApiResponse localVarResp = partialUpdateProjectRoleWithHttpInfo(id, createUpdateRoleRequestBean); return localVarResp.getData(); } /** * Partial update project role * Updates either the project role's name or its description. You cannot update both the name and description at the same time using this operation. If you send a request with a name and a description only the name is updated. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (required) * @return ApiResponse<ProjectRole> * @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 is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public ApiResponse partialUpdateProjectRoleWithHttpInfo(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean) throws ApiException { okhttp3.Call localVarCall = partialUpdateProjectRoleValidateBeforeCall(id, createUpdateRoleRequestBean, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Partial update project role (asynchronously) * Updates either the project role's name or its description. You cannot update both the name and description at the same time using this operation. If you send a request with a name and a description only the name is updated. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param id The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. (required) * @param createUpdateRoleRequestBean (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 the request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have administrative permissions. -
404 Returned if the project role is not found. -
*/ public okhttp3.Call partialUpdateProjectRoleAsync(Long id, CreateUpdateRoleRequestBean createUpdateRoleRequestBean, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = partialUpdateProjectRoleValidateBeforeCall(id, createUpdateRoleRequestBean, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy