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

software.tnb.jira.validation.generated.api.AvatarsApi 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.Avatars;
import software.tnb.jira.validation.generated.model.ErrorCollection;
import software.tnb.jira.validation.generated.model.SystemAvatars;

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

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

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

    public AvatarsApi(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 deleteAvatar
     * @param type The avatar type. (required)
     * @param owningObjectId The ID of the item the avatar is associated with. (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. -
400 Returned if the request is invalid. -
403 Returned if the user does not have permission to delete the avatar, the avatar is not deletable. -
404 Returned if the avatar type, associated item ID, or avatar ID is invalid. -
*/ public okhttp3.Call deleteAvatarCall(String type, String owningObjectId, 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/universal_avatar/type/{type}/owner/{owningObjectId}/avatar/{id}" .replace("{" + "type" + "}", localVarApiClient.escapeString(type.toString())) .replace("{" + "owningObjectId" + "}", localVarApiClient.escapeString(owningObjectId.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 deleteAvatarValidateBeforeCall(String type, String owningObjectId, Long id, final ApiCallback _callback) throws ApiException { // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling deleteAvatar(Async)"); } // verify the required parameter 'owningObjectId' is set if (owningObjectId == null) { throw new ApiException("Missing the required parameter 'owningObjectId' when calling deleteAvatar(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling deleteAvatar(Async)"); } return deleteAvatarCall(type, owningObjectId, id, _callback); } /** * Delete avatar * Deletes an avatar from a project or issue type. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param type The avatar type. (required) * @param owningObjectId The ID of the item the avatar is associated with. (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. -
400 Returned if the request is invalid. -
403 Returned if the user does not have permission to delete the avatar, the avatar is not deletable. -
404 Returned if the avatar type, associated item ID, or avatar ID is invalid. -
*/ public void deleteAvatar(String type, String owningObjectId, Long id) throws ApiException { deleteAvatarWithHttpInfo(type, owningObjectId, id); } /** * Delete avatar * Deletes an avatar from a project or issue type. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param type The avatar type. (required) * @param owningObjectId The ID of the item the avatar is associated with. (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. -
400 Returned if the request is invalid. -
403 Returned if the user does not have permission to delete the avatar, the avatar is not deletable. -
404 Returned if the avatar type, associated item ID, or avatar ID is invalid. -
*/ public ApiResponse deleteAvatarWithHttpInfo(String type, String owningObjectId, Long id) throws ApiException { okhttp3.Call localVarCall = deleteAvatarValidateBeforeCall(type, owningObjectId, id, null); return localVarApiClient.execute(localVarCall); } /** * Delete avatar (asynchronously) * Deletes an avatar from a project or issue type. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param type The avatar type. (required) * @param owningObjectId The ID of the item the avatar is associated with. (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. -
400 Returned if the request is invalid. -
403 Returned if the user does not have permission to delete the avatar, the avatar is not deletable. -
404 Returned if the avatar type, associated item ID, or avatar ID is invalid. -
*/ public okhttp3.Call deleteAvatarAsync(String type, String owningObjectId, Long id, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteAvatarValidateBeforeCall(type, owningObjectId, id, _callback); localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** * Build call for getAllSystemAvatars * @param type The avatar type. (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. -
500 Returned if an error occurs while retrieving the list of avatars. -
*/ public okhttp3.Call getAllSystemAvatarsCall(String type, 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/avatar/{type}/system" .replace("{" + "type" + "}", localVarApiClient.escapeString(type.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 getAllSystemAvatarsValidateBeforeCall(String type, final ApiCallback _callback) throws ApiException { // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling getAllSystemAvatars(Async)"); } return getAllSystemAvatarsCall(type, _callback); } /** * Get system avatars by type * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. * @param type The avatar type. (required) * @return SystemAvatars * @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. -
500 Returned if an error occurs while retrieving the list of avatars. -
*/ public SystemAvatars getAllSystemAvatars(String type) throws ApiException { ApiResponse localVarResp = getAllSystemAvatarsWithHttpInfo(type); return localVarResp.getData(); } /** * Get system avatars by type * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. * @param type The avatar type. (required) * @return ApiResponse<SystemAvatars> * @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. -
500 Returned if an error occurs while retrieving the list of avatars. -
*/ public ApiResponse getAllSystemAvatarsWithHttpInfo(String type) throws ApiException { okhttp3.Call localVarCall = getAllSystemAvatarsValidateBeforeCall(type, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get system avatars by type (asynchronously) * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. * @param type The avatar type. (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. -
500 Returned if an error occurs while retrieving the list of avatars. -
*/ public okhttp3.Call getAllSystemAvatarsAsync(String type, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAllSystemAvatarsValidateBeforeCall(type, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getAvatarImageByID * @param type The icon type of the avatar. (required) * @param id The ID of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public okhttp3.Call getAvatarImageByIDCall(String type, Long id, String size, String format, 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/universal_avatar/view/type/{type}/avatar/{id}" .replace("{" + "type" + "}", localVarApiClient.escapeString(type.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 (size != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); } if (format != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format)); } final String[] localVarAccepts = { "application/json", "image/png", "image/svg+xml", "*/*" }; 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 getAvatarImageByIDValidateBeforeCall(String type, Long id, String size, String format, final ApiCallback _callback) throws ApiException { // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling getAvatarImageByID(Async)"); } // verify the required parameter 'id' is set if (id == null) { throw new ApiException("Missing the required parameter 'id' when calling getAvatarImageByID(Async)"); } return getAvatarImageByIDCall(type, id, size, format, _callback); } /** * Get avatar image by ID * Returns a project or issue type avatar image by ID. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * @param type The icon type of the avatar. (required) * @param id The ID of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @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
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public Object getAvatarImageByID(String type, Long id, String size, String format) throws ApiException { ApiResponse localVarResp = getAvatarImageByIDWithHttpInfo(type, id, size, format); return localVarResp.getData(); } /** * Get avatar image by ID * Returns a project or issue type avatar image by ID. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * @param type The icon type of the avatar. (required) * @param id The ID of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @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
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public ApiResponse getAvatarImageByIDWithHttpInfo(String type, Long id, String size, String format) throws ApiException { okhttp3.Call localVarCall = getAvatarImageByIDValidateBeforeCall(type, id, size, format, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get avatar image by ID (asynchronously) * Returns a project or issue type avatar image by ID. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * @param type The icon type of the avatar. (required) * @param id The ID of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public okhttp3.Call getAvatarImageByIDAsync(String type, Long id, String size, String format, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAvatarImageByIDValidateBeforeCall(type, id, size, format, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getAvatarImageByOwner * @param type The icon type of the avatar. (required) * @param entityId The ID of the project or issue type the avatar belongs to. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public okhttp3.Call getAvatarImageByOwnerCall(String type, String entityId, String size, String format, 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/universal_avatar/view/type/{type}/owner/{entityId}" .replace("{" + "type" + "}", localVarApiClient.escapeString(type.toString())) .replace("{" + "entityId" + "}", localVarApiClient.escapeString(entityId.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (size != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); } if (format != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format)); } final String[] localVarAccepts = { "application/json", "image/png", "image/svg+xml", "*/*" }; 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 getAvatarImageByOwnerValidateBeforeCall(String type, String entityId, String size, String format, final ApiCallback _callback) throws ApiException { // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling getAvatarImageByOwner(Async)"); } // verify the required parameter 'entityId' is set if (entityId == null) { throw new ApiException("Missing the required parameter 'entityId' when calling getAvatarImageByOwner(Async)"); } return getAvatarImageByOwnerCall(type, entityId, size, format, _callback); } /** * Get avatar image by owner * Returns the avatar image for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * @param type The icon type of the avatar. (required) * @param entityId The ID of the project or issue type the avatar belongs to. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @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
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public Object getAvatarImageByOwner(String type, String entityId, String size, String format) throws ApiException { ApiResponse localVarResp = getAvatarImageByOwnerWithHttpInfo(type, entityId, size, format); return localVarResp.getData(); } /** * Get avatar image by owner * Returns the avatar image for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * @param type The icon type of the avatar. (required) * @param entityId The ID of the project or issue type the avatar belongs to. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @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
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public ApiResponse getAvatarImageByOwnerWithHttpInfo(String type, String entityId, String size, String format) throws ApiException { okhttp3.Call localVarCall = getAvatarImageByOwnerValidateBeforeCall(type, entityId, size, format, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get avatar image by owner (asynchronously) * Returns the avatar image for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * @param type The icon type of the avatar. (required) * @param entityId The ID of the project or issue type the avatar belongs to. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
400 Returned if the request is not valid. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public okhttp3.Call getAvatarImageByOwnerAsync(String type, String entityId, String size, String format, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAvatarImageByOwnerValidateBeforeCall(type, entityId, size, format, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getAvatarImageByType * @param type The icon type of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public okhttp3.Call getAvatarImageByTypeCall(String type, String size, String format, 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/universal_avatar/view/type/{type}" .replace("{" + "type" + "}", localVarApiClient.escapeString(type.toString())); List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); if (size != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); } if (format != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("format", format)); } final String[] localVarAccepts = { "application/json", "image/png", "image/svg+xml", "*/*" }; 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 getAvatarImageByTypeValidateBeforeCall(String type, String size, String format, final ApiCallback _callback) throws ApiException { // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling getAvatarImageByType(Async)"); } return getAvatarImageByTypeCall(type, size, format, _callback); } /** * Get avatar image by type * Returns the default project or issue type avatar image. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. * @param type The icon type of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @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
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public Object getAvatarImageByType(String type, String size, String format) throws ApiException { ApiResponse localVarResp = getAvatarImageByTypeWithHttpInfo(type, size, format); return localVarResp.getData(); } /** * Get avatar image by type * Returns the default project or issue type avatar image. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. * @param type The icon type of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @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
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public ApiResponse getAvatarImageByTypeWithHttpInfo(String type, String size, String format) throws ApiException { okhttp3.Call localVarCall = getAvatarImageByTypeValidateBeforeCall(type, size, format, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get avatar image by type (asynchronously) * Returns the default project or issue type avatar image. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. * @param type The icon type of the avatar. (required) * @param size The size of the avatar image. If not provided the default size is returned. (optional) * @param format The format to return the avatar image in. If not provided the original content format is returned. (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect. -
403 Returned if the user does not have the necessary permission. -
404 Returned if an avatar is not found or an avatar matching the requested size is not found. -
*/ public okhttp3.Call getAvatarImageByTypeAsync(String type, String size, String format, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAvatarImageByTypeValidateBeforeCall(type, size, format, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for getAvatars * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public okhttp3.Call getAvatarsCall(String type, String entityId, 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/universal_avatar/type/{type}/owner/{entityId}" .replace("{" + "type" + "}", localVarApiClient.escapeString(type.toString())) .replace("{" + "entityId" + "}", localVarApiClient.escapeString(entityId.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 getAvatarsValidateBeforeCall(String type, String entityId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling getAvatars(Async)"); } // verify the required parameter 'entityId' is set if (entityId == null) { throw new ApiException("Missing the required parameter 'entityId' when calling getAvatars(Async)"); } return getAvatarsCall(type, entityId, _callback); } /** * Get avatars * Returns the system and custom avatars for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * for custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * for custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * for system avatars, none. * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @return Avatars * @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 avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public Avatars getAvatars(String type, String entityId) throws ApiException { ApiResponse localVarResp = getAvatarsWithHttpInfo(type, entityId); return localVarResp.getData(); } /** * Get avatars * Returns the system and custom avatars for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * for custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * for custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * for system avatars, none. * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @return ApiResponse<Avatars> * @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 avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public ApiResponse getAvatarsWithHttpInfo(String type, String entityId) throws ApiException { okhttp3.Call localVarCall = getAvatarsValidateBeforeCall(type, entityId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Get avatars (asynchronously) * Returns the system and custom avatars for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * for custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * for custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * for system avatars, none. * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object * @http.response.details
Status Code Description Response Headers
200 Returned if the request is successful. -
401 Returned if the authentication credentials are incorrect or missing. -
404 Returned if the avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public okhttp3.Call getAvatarsAsync(String type, String entityId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getAvatarsValidateBeforeCall(type, entityId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** * Build call for storeAvatar * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @param size The length of each side of the crop region. (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 _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 the necessary permissions. -
404 Returned if the avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public okhttp3.Call storeAvatarCall(String type, String entityId, Integer size, Object body, Integer x, Integer y, 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/universal_avatar/type/{type}/owner/{entityId}" .replace("{" + "type" + "}", localVarApiClient.escapeString(type.toString())) .replace("{" + "entityId" + "}", localVarApiClient.escapeString(entityId.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 storeAvatarValidateBeforeCall(String type, String entityId, Integer size, Object body, Integer x, Integer y, final ApiCallback _callback) throws ApiException { // verify the required parameter 'type' is set if (type == null) { throw new ApiException("Missing the required parameter 'type' when calling storeAvatar(Async)"); } // verify the required parameter 'entityId' is set if (entityId == null) { throw new ApiException("Missing the required parameter 'entityId' when calling storeAvatar(Async)"); } // verify the required parameter 'size' is set if (size == null) { throw new ApiException("Missing the required parameter 'size' when calling storeAvatar(Async)"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling storeAvatar(Async)"); } return storeAvatarCall(type, entityId, size, body, x, y, _callback); } /** * Load avatar * Loads a custom avatar for a project or issue type. 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/universal_avatar/type/{type}/owner/{entityId}'` 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: * [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. * [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @param size The length of each side of the crop region. (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) * @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 the necessary permissions. -
404 Returned if the avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public Avatar storeAvatar(String type, String entityId, Integer size, Object body, Integer x, Integer y) throws ApiException { ApiResponse localVarResp = storeAvatarWithHttpInfo(type, entityId, size, body, x, y); return localVarResp.getData(); } /** * Load avatar * Loads a custom avatar for a project or issue type. 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/universal_avatar/type/{type}/owner/{entityId}'` 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: * [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. * [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @param size The length of each side of the crop region. (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) * @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 the necessary permissions. -
404 Returned if the avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public ApiResponse storeAvatarWithHttpInfo(String type, String entityId, Integer size, Object body, Integer x, Integer y) throws ApiException { okhttp3.Call localVarCall = storeAvatarValidateBeforeCall(type, entityId, size, body, x, y, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * Load avatar (asynchronously) * Loads a custom avatar for a project or issue type. 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/universal_avatar/type/{type}/owner/{entityId}'` 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: * [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. * [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * @param type The avatar type. (required) * @param entityId The ID of the item the avatar is associated with. (required) * @param size The length of each side of the crop region. (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 _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 the necessary permissions. -
404 Returned if the avatar type is invalid, the associated item ID is missing, or the item is not found. -
*/ public okhttp3.Call storeAvatarAsync(String type, String entityId, Integer size, Object body, Integer x, Integer y, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = storeAvatarValidateBeforeCall(type, entityId, size, body, x, y, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } }