Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* The Jira Cloud platform REST API
* Jira Cloud platform REST API documentation
*
* The version of the OpenAPI document: 1001.0.0-SNAPSHOT
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package software.tnb.jira.validation.generated.api;
import software.tnb.jira.validation.generated.ApiCallback;
import software.tnb.jira.validation.generated.ApiClient;
import software.tnb.jira.validation.generated.ApiException;
import software.tnb.jira.validation.generated.ApiResponse;
import software.tnb.jira.validation.generated.Configuration;
import software.tnb.jira.validation.generated.Pair;
import software.tnb.jira.validation.generated.ProgressRequestBody;
import software.tnb.jira.validation.generated.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import software.tnb.jira.validation.generated.model.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