Please wait. This can take some minutes ...
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.
software.tnb.jira.validation.generated.api.MyselfApi Maven / Gradle / Ivy
/*
* 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.Locale;
import software.tnb.jira.validation.generated.model.User;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MyselfApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public MyselfApi() {
this(Configuration.getDefaultApiClient());
}
public MyselfApi(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 deleteLocale
* @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. -
* @deprecated
*/
@Deprecated
public okhttp3.Call deleteLocaleCall(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/mypreferences/locale";
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[] { "basicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteLocaleValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return deleteLocaleCall(_callback);
}
/**
* Delete locale
* Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Deletes the locale of the user, which restores the default setting. **[Permissions](#permissions) required:** Permission to access Jira.
* @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. -
* @deprecated
*/
@Deprecated
public Object deleteLocale() throws ApiException {
ApiResponse localVarResp = deleteLocaleWithHttpInfo();
return localVarResp.getData();
}
/**
* Delete locale
* Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Deletes the locale of the user, which restores the default setting. **[Permissions](#permissions) required:** Permission to access Jira.
* @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. -
* @deprecated
*/
@Deprecated
public ApiResponse deleteLocaleWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = deleteLocaleValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Delete locale (asynchronously)
* Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Deletes the locale of the user, which restores the default setting. **[Permissions](#permissions) required:** Permission to access Jira.
* @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. -
* @deprecated
*/
@Deprecated
public okhttp3.Call deleteLocaleAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteLocaleValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getCurrentUser
* @param expand Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: * `groups` Returns all groups, including nested groups, the user belongs to. * `applicationRoles` Returns the application roles the user is assigned to. (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 or missing. -
*/
public okhttp3.Call getCurrentUserCall(String expand, 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/myself";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (expand != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("expand", expand));
}
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 getCurrentUserValidateBeforeCall(String expand, final ApiCallback _callback) throws ApiException {
return getCurrentUserCall(expand, _callback);
}
/**
* Get current user
* Returns details for the current user. **[Permissions](#permissions) required:** Permission to access Jira.
* @param expand Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: * `groups` Returns all groups, including nested groups, the user belongs to. * `applicationRoles` Returns the application roles the user is assigned to. (optional)
* @return User
* @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. -
*/
public User getCurrentUser(String expand) throws ApiException {
ApiResponse localVarResp = getCurrentUserWithHttpInfo(expand);
return localVarResp.getData();
}
/**
* Get current user
* Returns details for the current user. **[Permissions](#permissions) required:** Permission to access Jira.
* @param expand Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: * `groups` Returns all groups, including nested groups, the user belongs to. * `applicationRoles` Returns the application roles the user is assigned to. (optional)
* @return ApiResponse<User>
* @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. -
*/
public ApiResponse getCurrentUserWithHttpInfo(String expand) throws ApiException {
okhttp3.Call localVarCall = getCurrentUserValidateBeforeCall(expand, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get current user (asynchronously)
* Returns details for the current user. **[Permissions](#permissions) required:** Permission to access Jira.
* @param expand Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: * `groups` Returns all groups, including nested groups, the user belongs to. * `applicationRoles` Returns the application roles the user is assigned to. (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 or missing. -
*/
public okhttp3.Call getCurrentUserAsync(String expand, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getCurrentUserValidateBeforeCall(expand, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getLocale
* @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. -
*/
public okhttp3.Call getLocaleCall(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/mypreferences/locale";
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 getLocaleValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return getLocaleCall(_callback);
}
/**
* Get locale
* Returns the locale for the user. If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, the browser locale detected by Jira is returned. Jira detects the browser locale using the *Accept-Language* header in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @return Locale
* @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. -
*/
public Locale getLocale() throws ApiException {
ApiResponse localVarResp = getLocaleWithHttpInfo();
return localVarResp.getData();
}
/**
* Get locale
* Returns the locale for the user. If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, the browser locale detected by Jira is returned. Jira detects the browser locale using the *Accept-Language* header in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @return ApiResponse<Locale>
* @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. -
*/
public ApiResponse getLocaleWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getLocaleValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get locale (asynchronously)
* Returns the locale for the user. If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, the browser locale detected by Jira is returned. Jira detects the browser locale using the *Accept-Language* header in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None.
* @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. -
*/
public okhttp3.Call getLocaleAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getLocaleValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getPreference
* @param key The key of the preference. (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 key is not provided or not found. -
*/
public okhttp3.Call getPreferenceCall(String key, 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/mypreferences";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (key != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("key", key));
}
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 getPreferenceValidateBeforeCall(String key, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
throw new ApiException("Missing the required parameter 'key' when calling getPreference(Async)");
}
return getPreferenceCall(key, _callback);
}
/**
* Get preference
* Returns the value of a preference of the current user. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default this is not set and the user takes the locale of the instance. * *jira.user.timezone* The time zone of the user. By default this is not set and the user takes the timezone of the instance. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. (required)
* @return String
* @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 key is not provided or not found. -
*/
public String getPreference(String key) throws ApiException {
ApiResponse localVarResp = getPreferenceWithHttpInfo(key);
return localVarResp.getData();
}
/**
* Get preference
* Returns the value of a preference of the current user. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default this is not set and the user takes the locale of the instance. * *jira.user.timezone* The time zone of the user. By default this is not set and the user takes the timezone of the instance. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. (required)
* @return ApiResponse<String>
* @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 key is not provided or not found. -
*/
public ApiResponse getPreferenceWithHttpInfo(String key) throws ApiException {
okhttp3.Call localVarCall = getPreferenceValidateBeforeCall(key, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get preference (asynchronously)
* Returns the value of a preference of the current user. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default this is not set and the user takes the locale of the instance. * *jira.user.timezone* The time zone of the user. By default this is not set and the user takes the timezone of the instance. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. (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 key is not provided or not found. -
*/
public okhttp3.Call getPreferenceAsync(String key, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getPreferenceValidateBeforeCall(key, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for removePreference
* @param key The key of the preference. (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. -
404 Returned if the key is not provided or not found. -
*/
public okhttp3.Call removePreferenceCall(String key, 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/mypreferences";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (key != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("key", key));
}
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 removePreferenceValidateBeforeCall(String key, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
throw new ApiException("Missing the required parameter 'key' when calling removePreference(Async)");
}
return removePreferenceCall(key, _callback);
}
/**
* Delete preference
* Deletes a preference of the user, which restores the default value of system defined settings. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. (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. -
404 Returned if the key is not provided or not found. -
*/
public void removePreference(String key) throws ApiException {
removePreferenceWithHttpInfo(key);
}
/**
* Delete preference
* Deletes a preference of the user, which restores the default value of system defined settings. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. (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. -
404 Returned if the key is not provided or not found. -
*/
public ApiResponse removePreferenceWithHttpInfo(String key) throws ApiException {
okhttp3.Call localVarCall = removePreferenceValidateBeforeCall(key, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Delete preference (asynchronously)
* Deletes a preference of the user, which restores the default value of system defined settings. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. (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. -
404 Returned if the key is not provided or not found. -
*/
public okhttp3.Call removePreferenceAsync(String key, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = removePreferenceValidateBeforeCall(key, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for setLocale
* @param locale The locale defined in a LocaleBean. (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 request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
* @deprecated
*/
@Deprecated
public okhttp3.Call setLocaleCall(Locale locale, 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 = locale;
// create path and map variables
String localVarPath = "/rest/api/3/mypreferences/locale";
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[] { "basicAuth" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call setLocaleValidateBeforeCall(Locale locale, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'locale' is set
if (locale == null) {
throw new ApiException("Missing the required parameter 'locale' when calling setLocale(Async)");
}
return setLocaleCall(locale, _callback);
}
/**
* Set locale
* Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Sets the locale of the user. The locale must be one supported by the instance of Jira. **[Permissions](#permissions) required:** Permission to access Jira.
* @param locale The locale defined in a LocaleBean. (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. -
400 Returned if request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
* @deprecated
*/
@Deprecated
public Object setLocale(Locale locale) throws ApiException {
ApiResponse localVarResp = setLocaleWithHttpInfo(locale);
return localVarResp.getData();
}
/**
* Set locale
* Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Sets the locale of the user. The locale must be one supported by the instance of Jira. **[Permissions](#permissions) required:** Permission to access Jira.
* @param locale The locale defined in a LocaleBean. (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. -
400 Returned if request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
* @deprecated
*/
@Deprecated
public ApiResponse setLocaleWithHttpInfo(Locale locale) throws ApiException {
okhttp3.Call localVarCall = setLocaleValidateBeforeCall(locale, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Set locale (asynchronously)
* Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Sets the locale of the user. The locale must be one supported by the instance of Jira. **[Permissions](#permissions) required:** Permission to access Jira.
* @param locale The locale defined in a LocaleBean. (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 request is invalid. -
401 Returned if the authentication credentials are incorrect or missing. -
* @deprecated
*/
@Deprecated
public okhttp3.Call setLocaleAsync(Locale locale, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = setLocaleValidateBeforeCall(locale, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for setPreference
* @param key The key of the preference. The maximum length is 255 characters. (required)
* @param body The value of the preference as a plain text string. The maximum length is 255 characters. (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. -
404 Returned if the key or value is not provided or invalid. -
*/
public okhttp3.Call setPreferenceCall(String key, String body, 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/mypreferences";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (key != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("key", key));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json",
"text/plain"
};
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 setPreferenceValidateBeforeCall(String key, String body, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'key' is set
if (key == null) {
throw new ApiException("Missing the required parameter 'key' when calling setPreference(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling setPreference(Async)");
}
return setPreferenceCall(key, body, _callback);
}
/**
* Set preference
* Creates a preference for the user or updates a preference's value by sending a plain text string. For example, `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the following keys define system preferences that can be set or created: * *user.notifications.mimetype* The mime type used in notifications sent to the user. Defaults to `html`. * *user.notify.own.changes* Whether the user gets notified of their own changes. Defaults to `false`. * *user.default.share.private* Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. Defaults to `true`. * *user.keyboard.shortcuts.disabled* Whether keyboard shortcuts are disabled. Defaults to `false`. * *user.autowatch.disabled* Whether the user automatically watches issues they create or add a comment to. By default, not set: the user takes the instance autowatch setting. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. The maximum length is 255 characters. (required)
* @param body The value of the preference as a plain text string. The maximum length is 255 characters. (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. -
404 Returned if the key or value is not provided or invalid. -
*/
public Object setPreference(String key, String body) throws ApiException {
ApiResponse localVarResp = setPreferenceWithHttpInfo(key, body);
return localVarResp.getData();
}
/**
* Set preference
* Creates a preference for the user or updates a preference's value by sending a plain text string. For example, `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the following keys define system preferences that can be set or created: * *user.notifications.mimetype* The mime type used in notifications sent to the user. Defaults to `html`. * *user.notify.own.changes* Whether the user gets notified of their own changes. Defaults to `false`. * *user.default.share.private* Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. Defaults to `true`. * *user.keyboard.shortcuts.disabled* Whether keyboard shortcuts are disabled. Defaults to `false`. * *user.autowatch.disabled* Whether the user automatically watches issues they create or add a comment to. By default, not set: the user takes the instance autowatch setting. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. The maximum length is 255 characters. (required)
* @param body The value of the preference as a plain text string. The maximum length is 255 characters. (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. -
404 Returned if the key or value is not provided or invalid. -
*/
public ApiResponse setPreferenceWithHttpInfo(String key, String body) throws ApiException {
okhttp3.Call localVarCall = setPreferenceValidateBeforeCall(key, body, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Set preference (asynchronously)
* Creates a preference for the user or updates a preference's value by sending a plain text string. For example, `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the following keys define system preferences that can be set or created: * *user.notifications.mimetype* The mime type used in notifications sent to the user. Defaults to `html`. * *user.notify.own.changes* Whether the user gets notified of their own changes. Defaults to `false`. * *user.default.share.private* Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. Defaults to `true`. * *user.keyboard.shortcuts.disabled* Whether keyboard shortcuts are disabled. Defaults to `false`. * *user.autowatch.disabled* Whether the user automatically watches issues they create or add a comment to. By default, not set: the user takes the instance autowatch setting. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira.
* @param key The key of the preference. The maximum length is 255 characters. (required)
* @param body The value of the preference as a plain text string. The maximum length is 255 characters. (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. -
404 Returned if the key or value is not provided or invalid. -
*/
public okhttp3.Call setPreferenceAsync(String key, String body, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = setPreferenceValidateBeforeCall(key, body, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}