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.
package com.seeq.api;
import com.seeq.ApiException;
import com.seeq.ApiClient;
import com.seeq.Configuration;
import com.seeq.model.*;
import com.seeq.Pair;
import javax.ws.rs.core.GenericType;
import javax.ws.rs.ProcessingException;
import com.seeq.model.IdentityPreviewListV1;
import com.seeq.model.StatusMessageBase;
import com.seeq.model.UserInputV1;
import com.seeq.model.UserOutputListV1;
import com.seeq.model.UserOutputV1;
import com.seeq.model.UserPasswordInputV1;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UsersApi {
private ApiClient apiClient;
private long retryTimeout = 5_000; // Default of 5 seconds
public UsersApi() {
this(Configuration.getDefaultApiClient());
}
public UsersApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public void setRetryTimeout(long retryTimeout) {
this.retryTimeout = retryTimeout;
}
public long getRetryTimeout() {
return this.retryTimeout;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
*
*
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param query Part of user or group name to search for (required)
* @return IdentityPreviewListV1
* @throws ApiException if fails to make API call
*/
public IdentityPreviewListV1 autocompleteUsersAndGroups(Integer offset, Integer limit, String query) throws ApiException {
ApiClient.ApiResponse localVarResponse = autocompleteUsersAndGroupsWithHttpInfo(offset, limit, query);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
*
*
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @param query Part of user or group name to search for (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse autocompleteUsersAndGroupsWithHttpInfo(Integer offset, Integer limit, String query) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'query' is set
if (query == null) {
throw new ApiException(400, "Missing the required parameter 'query' when calling autocompleteUsersAndGroups");
}
// create path and map variables
String localVarPath = "/users/autocomplete/{query}"
.replaceAll("\\{" + "query" + "\\}", apiClient.escapeString(query.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Create a user
*
* @param body User information (required)
* @return UserOutputV1
* @throws ApiException if fails to make API call
*/
public UserOutputV1 createUser(UserInputV1 body) throws ApiException {
ApiClient.ApiResponse localVarResponse = createUserWithHttpInfo(body);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Create a user
*
* @param body User information (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse createUserWithHttpInfo(UserInputV1 body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling createUser");
}
// create path and map variables
String localVarPath = "/users";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Delete a user
*
* @param id ID of the user to delete (required)
* @param newOwnerId ID of the user to take over ownership of items. If not specified and the user to delete has owned items, a '400 Bad Request' will be returned. (optional)
* @param transferAclAndGroupMembership True if any ACL entries and group memberships for the user being deleted should be transferred to the new owner, false if ACL entries should be deleted and group memberships shouldn't be transferred. When migrating users to a different authentication method, this should be set to true. When actually deleting a user, it should usually be set to false. The default is 'false'. (optional, default to false)
* @return StatusMessageBase
* @throws ApiException if fails to make API call
*/
public StatusMessageBase deleteUser(String id, String newOwnerId, Boolean transferAclAndGroupMembership) throws ApiException {
ApiClient.ApiResponse localVarResponse = deleteUserWithHttpInfo(id, newOwnerId, transferAclAndGroupMembership);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Delete a user
*
* @param id ID of the user to delete (required)
* @param newOwnerId ID of the user to take over ownership of items. If not specified and the user to delete has owned items, a '400 Bad Request' will be returned. (optional)
* @param transferAclAndGroupMembership True if any ACL entries and group memberships for the user being deleted should be transferred to the new owner, false if ACL entries should be deleted and group memberships shouldn't be transferred. When migrating users to a different authentication method, this should be set to true. When actually deleting a user, it should usually be set to false. The default is 'false'. (optional, default to false)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse deleteUserWithHttpInfo(String id, String newOwnerId, Boolean transferAclAndGroupMembership) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling deleteUser");
}
// create path and map variables
String localVarPath = "/users/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "newOwnerId", newOwnerId));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "transferAclAndGroupMembership", transferAclAndGroupMembership));
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get the user that belongs to this authentication session
*
* @return UserOutputV1
* @throws ApiException if fails to make API call
*/
public UserOutputV1 getMe() throws ApiException {
ApiClient.ApiResponse localVarResponse = getMeWithHttpInfo();
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get the user that belongs to this authentication session
*
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getMeWithHttpInfo() throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/users/me";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get a user
*
* @param id ID of the user to retrieve (required)
* @return UserOutputV1
* @throws ApiException if fails to make API call
*/
public UserOutputV1 getUser(String id) throws ApiException {
ApiClient.ApiResponse localVarResponse = getUserWithHttpInfo(id);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a user
*
* @param id ID of the user to retrieve (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getUserWithHttpInfo(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getUser");
}
// create path and map variables
String localVarPath = "/users/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Search for user from a username
*
* @param authDatasourceClass Auth datasource class of the user to retrieve (required)
* @param authDatasourceId Auth datasource id of the user to retrieve (required)
* @param username Username of the user to retrieve (required)
* @return UserOutputV1
* @throws ApiException if fails to make API call
*/
public UserOutputV1 getUserFromUsername(String authDatasourceClass, String authDatasourceId, String username) throws ApiException {
ApiClient.ApiResponse localVarResponse = getUserFromUsernameWithHttpInfo(authDatasourceClass, authDatasourceId, username);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Search for user from a username
*
* @param authDatasourceClass Auth datasource class of the user to retrieve (required)
* @param authDatasourceId Auth datasource id of the user to retrieve (required)
* @param username Username of the user to retrieve (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getUserFromUsernameWithHttpInfo(String authDatasourceClass, String authDatasourceId, String username) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'authDatasourceClass' is set
if (authDatasourceClass == null) {
throw new ApiException(400, "Missing the required parameter 'authDatasourceClass' when calling getUserFromUsername");
}
// verify the required parameter 'authDatasourceId' is set
if (authDatasourceId == null) {
throw new ApiException(400, "Missing the required parameter 'authDatasourceId' when calling getUserFromUsername");
}
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserFromUsername");
}
// create path and map variables
String localVarPath = "/users/search";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "authDatasourceClass", authDatasourceClass));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "authDatasourceId", authDatasourceId));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username));
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Get a collection of users
*
* @param usernameSearch Search text by which to filter users' names. (optional)
* @param emailSearch Search text by which to filter users' email addresses. (optional)
* @param firstNameSearch Search text by which to filter users' first names. (optional)
* @param lastNameSearch Search text by which to filter users' last names. (optional)
* @param datasourceNameSearch Search text by which to filter users' directories. (optional)
* @param isAdmin Whether to filter users to only users who are administrators. (optional)
* @param isEnabled Whether to filter users to only users who are enabled. (optional)
* @param isLoggedIn Whether to filter users to only users who are logged in. (optional)
* @param isCreated Whether to filter to users that did not come pre-installed with Seeq. (optional)
* @param sortOrder A field by which to order the users followed by a space and 'asc' or 'desc'. Field name can be one of: username, email, firstName, lastName, directory (optional, default to email asc)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @return UserOutputListV1
* @throws ApiException if fails to make API call
*/
public UserOutputListV1 getUsers(String usernameSearch, String emailSearch, String firstNameSearch, String lastNameSearch, String datasourceNameSearch, Boolean isAdmin, Boolean isEnabled, Boolean isLoggedIn, Boolean isCreated, String sortOrder, Integer offset, Integer limit) throws ApiException {
ApiClient.ApiResponse localVarResponse = getUsersWithHttpInfo(usernameSearch, emailSearch, firstNameSearch, lastNameSearch, datasourceNameSearch, isAdmin, isEnabled, isLoggedIn, isCreated, sortOrder, offset, limit);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Get a collection of users
*
* @param usernameSearch Search text by which to filter users' names. (optional)
* @param emailSearch Search text by which to filter users' email addresses. (optional)
* @param firstNameSearch Search text by which to filter users' first names. (optional)
* @param lastNameSearch Search text by which to filter users' last names. (optional)
* @param datasourceNameSearch Search text by which to filter users' directories. (optional)
* @param isAdmin Whether to filter users to only users who are administrators. (optional)
* @param isEnabled Whether to filter users to only users who are enabled. (optional)
* @param isLoggedIn Whether to filter users to only users who are logged in. (optional)
* @param isCreated Whether to filter to users that did not come pre-installed with Seeq. (optional)
* @param sortOrder A field by which to order the users followed by a space and 'asc' or 'desc'. Field name can be one of: username, email, firstName, lastName, directory (optional, default to email asc)
* @param offset The pagination offset, the index of the first collection item that will be returned in this page of results (optional, default to 0)
* @param limit The pagination limit, the total number of collection items that will be returned in this page of results (optional, default to 40)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse getUsersWithHttpInfo(String usernameSearch, String emailSearch, String firstNameSearch, String lastNameSearch, String datasourceNameSearch, Boolean isAdmin, Boolean isEnabled, Boolean isLoggedIn, Boolean isCreated, String sortOrder, Integer offset, Integer limit) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/users";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "usernameSearch", usernameSearch));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "emailSearch", emailSearch));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "firstNameSearch", firstNameSearch));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "lastNameSearch", lastNameSearch));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "datasourceNameSearch", datasourceNameSearch));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "isAdmin", isAdmin));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "isEnabled", isEnabled));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "isLoggedIn", isLoggedIn));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "isCreated", isCreated));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sortOrder", sortOrder));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit));
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Update password for a user authenticating through Seeq
*
* @param id ID of the user to set password for (required)
* @param body User information (required)
* @return UserOutputV1
* @throws ApiException if fails to make API call
*/
public UserOutputV1 updatePassword(String id, UserPasswordInputV1 body) throws ApiException {
ApiClient.ApiResponse localVarResponse = updatePasswordWithHttpInfo(id, body);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Update password for a user authenticating through Seeq
*
* @param id ID of the user to set password for (required)
* @param body User information (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse updatePasswordWithHttpInfo(String id, UserPasswordInputV1 body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updatePassword");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling updatePassword");
}
// create path and map variables
String localVarPath = "/users/{id}/password"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
/**
* Update a user
*
* @param id ID of the user to update (required)
* @param body User Update information (required)
* @return UserOutputV1
* @throws ApiException if fails to make API call
*/
public UserOutputV1 updateUser(String id, UserInputV1 body) throws ApiException {
ApiClient.ApiResponse localVarResponse = updateUserWithHttpInfo(id, body);
return localVarResponse != null ? localVarResponse.getData() : null;
}
/**
* Update a user
*
* @param id ID of the user to update (required)
* @param body User Update information (required)
* @throws ApiException if fails to make API call
*/
public ApiClient.ApiResponse updateUserWithHttpInfo(String id, UserInputV1 body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updateUser");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");
}
// create path and map variables
String localVarPath = "/users/{id}/update"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/vnd.seeq.v1+json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/vnd.seeq.v1+json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "api_key" };
long apiClientInvocationTime = System.currentTimeMillis();
while(true) {
try {
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPIWithHttpInfo(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
// Possible exceptions:
// ===================
// * ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or
// during conversion of the response entity data to an instance of a particular Java type).
// * ProcessingException - in case the request processing or subsequent I/O operation fails.
// * WebApplicationException - in case the response status code of the response returned by the server is not
// successful and the specified response type is not Response.
// * ApiException for exceptions wrapped by ApiClient. Most likely all WebApplicationException are wrapped
// in ApiException(s)
} catch (ApiException | ProcessingException e) {
if (e instanceof ProcessingException || e instanceof ApiException && ((ApiException) e).getCode() == 504) {
long elapsedTime = System.currentTimeMillis() - apiClientInvocationTime;
if (elapsedTime <= this.retryTimeout && this.retryTimeout != 0) {
continue;
}
}
throw e;
}
} // while
}
}