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

software.tnb.jira.validation.generated.api.ProjectAvatarsApi 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.Avatar;
import software.tnb.jira.validation.generated.model.ProjectAvatars;

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

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

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

    public ProjectAvatarsApi(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 createProjectAvatar
     * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required)
     * @param body  (required)
     * @param x The X coordinate of the top-left corner of the crop region. (optional, default to 0)
     * @param y The Y coordinate of the top-left corner of the crop region. (optional, default to 0)
     * @param size The length of each side of the crop region. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if: * an image isn't included in the request. * the image type is unsupported. * the crop parameters extend the crop area beyond the edge of the image. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project or an anonymous call is made to the operation. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call createProjectAvatarCall(String projectIdOrKey, Object body, Integer x, Integer y, Integer size, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = body; // create path and map variables String localVarPath = "/rest/api/3/project/{projectIdOrKey}/avatar2" .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 (x != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("x", x)); } if (y != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("y", y)); } if (size != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); } 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, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } @SuppressWarnings("rawtypes") private okhttp3.Call createProjectAvatarValidateBeforeCall(String projectIdOrKey, Object body, Integer x, Integer y, Integer size, 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 createProjectAvatar(Async)"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createProjectAvatar(Async)"); } return createProjectAvatarCall(projectIdOrKey, body, x, y, size, _callback); } /** * Load project avatar * Loads an avatar for a project. Specify the avatar's local file location in the body of the request. Also, include the following headers: * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special Headers](#special-request-headers). * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. For example: `curl --request POST ` `--user [email protected]:<api_token> ` `--header 'X-Atlassian-Token: no-check' ` `--header 'Content-Type: image/< image_type>' ` `--data-binary \"<@/path/to/file/with/your/avatar>\" ` `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image. The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @param body (required) * @param x The X coordinate of the top-left corner of the crop region. (optional, default to 0) * @param y The Y coordinate of the top-left corner of the crop region. (optional, default to 0) * @param size The length of each side of the crop region. (optional) * @return Avatar * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if: * an image isn't included in the request. * the image type is unsupported. * the crop parameters extend the crop area beyond the edge of the image. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project or an anonymous call is made to the operation. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public Avatar createProjectAvatar(String projectIdOrKey, Object body, Integer x, Integer y, Integer size) throws ApiException { ApiResponse localVarResp = createProjectAvatarWithHttpInfo(projectIdOrKey, body, x, y, size); return localVarResp.getData(); } /** * Load project avatar * Loads an avatar for a project. Specify the avatar's local file location in the body of the request. Also, include the following headers: * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special Headers](#special-request-headers). * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. For example: `curl --request POST ` `--user [email protected]:<api_token> ` `--header 'X-Atlassian-Token: no-check' ` `--header 'Content-Type: image/< image_type>' ` `--data-binary \"<@/path/to/file/with/your/avatar>\" ` `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image. The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @param body (required) * @param x The X coordinate of the top-left corner of the crop region. (optional, default to 0) * @param y The Y coordinate of the top-left corner of the crop region. (optional, default to 0) * @param size The length of each side of the crop region. (optional) * @return ApiResponse<Avatar> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if: * an image isn't included in the request. * the image type is unsupported. * the crop parameters extend the crop area beyond the edge of the image. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project or an anonymous call is made to the operation. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public ApiResponse createProjectAvatarWithHttpInfo(String projectIdOrKey, Object body, Integer x, Integer y, Integer size) throws ApiException { okhttp3.Call localVarCall = createProjectAvatarValidateBeforeCall(projectIdOrKey, body, x, y, size, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Load project avatar (asynchronously) * Loads an avatar for a project. Specify the avatar's local file location in the body of the request. Also, include the following headers: * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special Headers](#special-request-headers). * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. For example: `curl --request POST ` `--user [email protected]:<api_token> ` `--header 'X-Atlassian-Token: no-check' ` `--header 'Content-Type: image/< image_type>' ` `--data-binary \"<@/path/to/file/with/your/avatar>\" ` `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image. The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @param body (required) * @param x The X coordinate of the top-left corner of the crop region. (optional, default to 0) * @param y The Y coordinate of the top-left corner of the crop region. (optional, default to 0) * @param size The length of each side of the crop region. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
201 Returned if the request is successful. -
400 Returned if: * an image isn't included in the request. * the image type is unsupported. * the crop parameters extend the crop area beyond the edge of the image. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project or an anonymous call is made to the operation. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call createProjectAvatarAsync(String projectIdOrKey, Object body, Integer x, Integer y, Integer size, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createProjectAvatarValidateBeforeCall(projectIdOrKey, body, x, y, size, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for deleteProjectAvatar * @param projectIdOrKey The project ID or (case-sensitive) key. (required) * @param id The ID of the avatar. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the avatar is a system avatar or the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call deleteProjectAvatarCall(String projectIdOrKey, 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/project/{projectIdOrKey}/avatar/{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(); 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 deleteProjectAvatarValidateBeforeCall(String projectIdOrKey, Long id, 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 deleteProjectAvatar(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling deleteProjectAvatar(Async)"); } return deleteProjectAvatarCall(projectIdOrKey, id, _callback); } /** * Delete project avatar * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The project ID or (case-sensitive) key. (required) * @param id The ID of the avatar. (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the avatar is a system avatar or the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public void deleteProjectAvatar(String projectIdOrKey, Long id) throws ApiException { deleteProjectAvatarWithHttpInfo(projectIdOrKey, id); } /** * Delete project avatar * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The project ID or (case-sensitive) key. (required) * @param id The ID of the avatar. (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the avatar is a system avatar or the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public ApiResponse deleteProjectAvatarWithHttpInfo(String projectIdOrKey, Long id) throws ApiException { okhttp3.Call localVarCall = deleteProjectAvatarValidateBeforeCall(projectIdOrKey, id, null); return localVarApiClient.execute(localVarCall); } /** * Delete project avatar (asynchronously) * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The project ID or (case-sensitive) key. (required) * @param id The ID of the avatar. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the avatar is a system avatar or the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call deleteProjectAvatarAsync(String projectIdOrKey, Long id, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteProjectAvatarValidateBeforeCall(projectIdOrKey, id, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for getAllProjectAvatars * @param projectIdOrKey The ID or (case-sensitive) key of the project. (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 request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call getAllProjectAvatarsCall(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}/avatars" .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 getAllProjectAvatarsValidateBeforeCall(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 getAllProjectAvatars(Async)"); } return getAllProjectAvatarsCall(projectIdOrKey, _callback); } /** * Get all project avatars * Returns all project avatars, grouped by system and custom avatars. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @return ProjectAvatars * @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 request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public ProjectAvatars getAllProjectAvatars(String projectIdOrKey) throws ApiException { ApiResponse localVarResp = getAllProjectAvatarsWithHttpInfo(projectIdOrKey); return localVarResp.getData(); } /** * Get all project avatars * Returns all project avatars, grouped by system and custom avatars. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @return ApiResponse<ProjectAvatars> * @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 request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public ApiResponse getAllProjectAvatarsWithHttpInfo(String projectIdOrKey) throws ApiException { okhttp3.Call localVarCall = getAllProjectAvatarsValidateBeforeCall(projectIdOrKey, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get all project avatars (asynchronously) * Returns all project avatars, grouped by system and custom avatars. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * @param projectIdOrKey The ID or (case-sensitive) key of the project. (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 request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the project is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call getAllProjectAvatarsAsync(String projectIdOrKey, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAllProjectAvatarsValidateBeforeCall(projectIdOrKey, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for updateProjectAvatar * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @param requestBody (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call updateProjectAvatarCall(String projectIdOrKey, Map requestBody, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; // Determine Base Path to Use if (localCustomBaseUrl != null){ basePath = localCustomBaseUrl; } else if ( localBasePaths.length > 0 ) { basePath = localBasePaths[localHostIndex]; } else { basePath = null; } Object localVarPostBody = requestBody; // create path and map variables String localVarPath = "/rest/api/3/project/{projectIdOrKey}/avatar" .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 = { "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 updateProjectAvatarValidateBeforeCall(String projectIdOrKey, Map requestBody, 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 updateProjectAvatar(Async)"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException("Missing the required parameter 'requestBody' when calling updateProjectAvatar(Async)"); } return updateProjectAvatarCall(projectIdOrKey, requestBody, _callback); } /** * Set project avatar * Sets the avatar displayed for a project. Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the project, before using this operation to set the displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @param requestBody (required) * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public Object updateProjectAvatar(String projectIdOrKey, Map requestBody) throws ApiException { ApiResponse localVarResp = updateProjectAvatarWithHttpInfo(projectIdOrKey, requestBody); return localVarResp.getData(); } /** * Set project avatar * Sets the avatar displayed for a project. Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the project, before using this operation to set the displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @param requestBody (required) * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public ApiResponse updateProjectAvatarWithHttpInfo(String projectIdOrKey, Map requestBody) throws ApiException { okhttp3.Call localVarCall = updateProjectAvatarValidateBeforeCall(projectIdOrKey, requestBody, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Set project avatar (asynchronously) * Sets the avatar displayed for a project. Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the project, before using this operation to set the displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). * @param projectIdOrKey The ID or (case-sensitive) key of the project. (required) * @param requestBody (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
204 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
403 Returned if the user does not have permission to administer the project. -
404 Returned if the project or avatar is not found or the user does not have permission to view the project. -
*/ public okhttp3.Call updateProjectAvatarAsync(String projectIdOrKey, Map requestBody, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateProjectAvatarValidateBeforeCall(projectIdOrKey, requestBody, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }