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.
/*
* FINBOURNE Identity Service API
*
* 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 com.finbourne.identity.api;
import com.finbourne.identity.ApiCallback;
import com.finbourne.identity.ApiClient;
import com.finbourne.identity.ApiException;
import com.finbourne.identity.ApiResponse;
import com.finbourne.identity.Configuration;
import com.finbourne.identity.Pair;
import com.finbourne.identity.ProgressRequestBody;
import com.finbourne.identity.ProgressResponseBody;
import com.finbourne.identity.extensions.ConfigurationOptions;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.finbourne.identity.model.CreateRoleRequest;
import com.finbourne.identity.model.LusidProblemDetails;
import com.finbourne.identity.model.LusidValidationProblemDetails;
import com.finbourne.identity.model.RoleResponse;
import com.finbourne.identity.model.UpdateRoleRequest;
import com.finbourne.identity.model.UserResponse;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class RolesApi {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public RolesApi() {
this(Configuration.getDefaultApiClient());
}
public RolesApi(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;
}
private okhttp3.Call addUserToRoleCall(String id, String userId, final ApiCallback _callback) throws ApiException {
return addUserToRoleCall(id, userId, _callback, new ConfigurationOptions());
}
private okhttp3.Call addUserToRoleCall(String id, String userId, final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/roles/{id}/users/{userId}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()))
.replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.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" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call addUserToRoleValidateBeforeCall(String id, String userId, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling addUserToRole(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling addUserToRole(Async)");
}
return addUserToRoleCall(id, userId, _callback, opts);
}
private ApiResponse addUserToRoleWithHttpInfo(String id, String userId) throws ApiException {
okhttp3.Call localVarCall = addUserToRoleValidateBeforeCall(id, userId, null, new ConfigurationOptions());
return localVarApiClient.execute(localVarCall);
}
private ApiResponse addUserToRoleWithHttpInfo(String id, String userId, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = addUserToRoleValidateBeforeCall(id, userId, null, opts);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call addUserToRoleAsync(String id, String userId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = addUserToRoleValidateBeforeCall(id, userId, _callback, new ConfigurationOptions());
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
private okhttp3.Call addUserToRoleAsync(String id, String userId, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = addUserToRoleValidateBeforeCall(id, userId, _callback, opts);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public class APIaddUserToRoleRequest {
private final String id;
private final String userId;
private APIaddUserToRoleRequest(String id, String userId) {
this.id = id;
this.userId = userId;
}
/**
* Build call for addUserToRole
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
204
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return addUserToRoleCall(id, userId, _callback);
}
/**
* Execute addUserToRole request
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public void execute() throws ApiException {
addUserToRoleWithHttpInfo(id, userId);
}
/**
* Execute addUserToRole request
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public void execute(ConfigurationOptions opts) throws ApiException {
addUserToRoleWithHttpInfo(id, userId, opts);
}
/**
* Execute addUserToRole request with HTTP info returned
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return addUserToRoleWithHttpInfo(id, userId);
}
/**
* Execute addUserToRole request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return addUserToRoleWithHttpInfo(id, userId, opts);
}
/**
* Execute addUserToRole request (asynchronously)
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return addUserToRoleAsync(id, userId, _callback);
}
/**
* Execute addUserToRole request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
return addUserToRoleAsync(id, userId, _callback, opts);
}
}
/**
* AddUserToRole: Add User to Role
* Adds the User to the specified Role
* @param id The unique identifier for the Role (required)
* @param userId The unique identifier for the User (required)
* @return APIaddUserToRoleRequest
* @http.response.details
Status Code
Description
Response Headers
204
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public APIaddUserToRoleRequest addUserToRole(String id, String userId) {
return new APIaddUserToRoleRequest(id, userId);
}
private okhttp3.Call createRoleCall(CreateRoleRequest createRoleRequest, final ApiCallback _callback) throws ApiException {
return createRoleCall(createRoleRequest, _callback, new ConfigurationOptions());
}
private okhttp3.Call createRoleCall(CreateRoleRequest createRoleRequest, final ApiCallback _callback, ConfigurationOptions opts) 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 = createRoleRequest;
// create path and map variables
String localVarPath = "/api/roles";
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-patch+json",
"application/json",
"text/json",
"application/*+json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "oauth2" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call createRoleValidateBeforeCall(CreateRoleRequest createRoleRequest, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
// verify the required parameter 'createRoleRequest' is set
if (createRoleRequest == null) {
throw new ApiException("Missing the required parameter 'createRoleRequest' when calling createRole(Async)");
}
return createRoleCall(createRoleRequest, _callback, opts);
}
private ApiResponse createRoleWithHttpInfo(CreateRoleRequest createRoleRequest) throws ApiException {
okhttp3.Call localVarCall = createRoleValidateBeforeCall(createRoleRequest, null, new ConfigurationOptions());
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private ApiResponse createRoleWithHttpInfo(CreateRoleRequest createRoleRequest, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = createRoleValidateBeforeCall(createRoleRequest, null, opts);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call createRoleAsync(CreateRoleRequest createRoleRequest, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = createRoleValidateBeforeCall(createRoleRequest, _callback, new ConfigurationOptions());
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
private okhttp3.Call createRoleAsync(CreateRoleRequest createRoleRequest, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = createRoleValidateBeforeCall(createRoleRequest, _callback, opts);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIcreateRoleRequest {
private final CreateRoleRequest createRoleRequest;
private APIcreateRoleRequest(CreateRoleRequest createRoleRequest) {
this.createRoleRequest = createRoleRequest;
}
/**
* Build call for createRole
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return createRoleCall(createRoleRequest, _callback);
}
/**
* Execute createRole request
* @return RoleResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public RoleResponse execute() throws ApiException {
ApiResponse localVarResp = createRoleWithHttpInfo(createRoleRequest);
return localVarResp.getData();
}
/**
* Execute createRole request. Use any specified configuration options to override any other configuration for this request only.
* @return RoleResponse
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public RoleResponse execute(ConfigurationOptions opts) throws ApiException {
ApiResponse localVarResp = createRoleWithHttpInfo(createRoleRequest, opts);
return localVarResp.getData();
}
/**
* Execute createRole request with HTTP info returned
* @return ApiResponse<RoleResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return createRoleWithHttpInfo(createRoleRequest);
}
/**
* Execute createRole request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @return ApiResponse<RoleResponse>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return createRoleWithHttpInfo(createRoleRequest, opts);
}
/**
* Execute createRole request (asynchronously)
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return createRoleAsync(createRoleRequest, _callback);
}
/**
* Execute createRole request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
return createRoleAsync(createRoleRequest, _callback, opts);
}
}
/**
* CreateRole: Create Role
* Creates a new Role
* @param createRoleRequest Details of the role to be created (required)
* @return APIcreateRoleRequest
* @http.response.details
Status Code
Description
Response Headers
201
Create a new role
-
409
A role with the same Name already exists.
-
400
The details of the input related failure
-
0
Error response
-
*/
public APIcreateRoleRequest createRole(CreateRoleRequest createRoleRequest) {
return new APIcreateRoleRequest(createRoleRequest);
}
private okhttp3.Call deleteRoleCall(String id, final ApiCallback _callback) throws ApiException {
return deleteRoleCall(id, _callback, new ConfigurationOptions());
}
private okhttp3.Call deleteRoleCall(String id, final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/roles/{id}"
.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 = {
"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" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteRoleValidateBeforeCall(String id, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling deleteRole(Async)");
}
return deleteRoleCall(id, _callback, opts);
}
private ApiResponse deleteRoleWithHttpInfo(String id) throws ApiException {
okhttp3.Call localVarCall = deleteRoleValidateBeforeCall(id, null, new ConfigurationOptions());
return localVarApiClient.execute(localVarCall);
}
private ApiResponse deleteRoleWithHttpInfo(String id, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = deleteRoleValidateBeforeCall(id, null, opts);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call deleteRoleAsync(String id, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteRoleValidateBeforeCall(id, _callback, new ConfigurationOptions());
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
private okhttp3.Call deleteRoleAsync(String id, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = deleteRoleValidateBeforeCall(id, _callback, opts);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public class APIdeleteRoleRequest {
private final String id;
private APIdeleteRoleRequest(String id) {
this.id = id;
}
/**
* Build call for deleteRole
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
204
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return deleteRoleCall(id, _callback);
}
/**
* Execute deleteRole request
* @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
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public void execute() throws ApiException {
deleteRoleWithHttpInfo(id);
}
/**
* Execute deleteRole request
* @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
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public void execute(ConfigurationOptions opts) throws ApiException {
deleteRoleWithHttpInfo(id, opts);
}
/**
* Execute deleteRole request with HTTP info returned
* @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
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return deleteRoleWithHttpInfo(id);
}
/**
* Execute deleteRole request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @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
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return deleteRoleWithHttpInfo(id, opts);
}
/**
* Execute deleteRole request (asynchronously)
* @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
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteRoleAsync(id, _callback);
}
/**
* Execute deleteRole request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @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
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
return deleteRoleAsync(id, _callback, opts);
}
}
/**
* DeleteRole: Delete Role
* Delete the specified role
* @param id The unique identifier for the role (required)
* @return APIdeleteRoleRequest
* @http.response.details
Status Code
Description
Response Headers
204
No Content
-
400
The details of the input related failure
-
0
Error response
-
*/
public APIdeleteRoleRequest deleteRole(String id) {
return new APIdeleteRoleRequest(id);
}
private okhttp3.Call getRoleCall(String id, final ApiCallback _callback) throws ApiException {
return getRoleCall(id, _callback, new ConfigurationOptions());
}
private okhttp3.Call getRoleCall(String id, final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/roles/{id}"
.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 = {
"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" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getRoleValidateBeforeCall(String id, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling getRole(Async)");
}
return getRoleCall(id, _callback, opts);
}
private ApiResponse getRoleWithHttpInfo(String id) throws ApiException {
okhttp3.Call localVarCall = getRoleValidateBeforeCall(id, null, new ConfigurationOptions());
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private ApiResponse getRoleWithHttpInfo(String id, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = getRoleValidateBeforeCall(id, null, opts);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getRoleAsync(String id, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getRoleValidateBeforeCall(id, _callback, new ConfigurationOptions());
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
private okhttp3.Call getRoleAsync(String id, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = getRoleValidateBeforeCall(id, _callback, opts);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIgetRoleRequest {
private final String id;
private APIgetRoleRequest(String id) {
this.id = id;
}
/**
* Build call for getRole
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getRoleCall(id, _callback);
}
/**
* Execute getRole request
* @return RoleResponse
* @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
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public RoleResponse execute() throws ApiException {
ApiResponse localVarResp = getRoleWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Execute getRole request. Use any specified configuration options to override any other configuration for this request only.
* @return RoleResponse
* @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
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public RoleResponse execute(ConfigurationOptions opts) throws ApiException {
ApiResponse localVarResp = getRoleWithHttpInfo(id, opts);
return localVarResp.getData();
}
/**
* Execute getRole request with HTTP info returned
* @return ApiResponse<RoleResponse>
* @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
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return getRoleWithHttpInfo(id);
}
/**
* Execute getRole request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @return ApiResponse<RoleResponse>
* @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
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return getRoleWithHttpInfo(id, opts);
}
/**
* Execute getRole request (asynchronously)
* @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
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getRoleAsync(id, _callback);
}
/**
* Execute getRole request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @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
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
return getRoleAsync(id, _callback, opts);
}
}
/**
* GetRole: Get Role
* Get the specified role
* @param id The unique identifier for the role (required)
* @return APIgetRoleRequest
* @http.response.details
Status Code
Description
Response Headers
200
Get the specified role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public APIgetRoleRequest getRole(String id) {
return new APIgetRoleRequest(id);
}
private okhttp3.Call listRolesCall(final ApiCallback _callback) throws ApiException {
return listRolesCall( _callback, new ConfigurationOptions());
}
private okhttp3.Call listRolesCall(final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/roles";
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" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listRolesValidateBeforeCall(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
return listRolesCall(_callback, opts);
}
private ApiResponse> listRolesWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = listRolesValidateBeforeCall(null, new ConfigurationOptions());
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private ApiResponse> listRolesWithHttpInfo(ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = listRolesValidateBeforeCall(null, opts);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call listRolesAsync(final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listRolesValidateBeforeCall(_callback, new ConfigurationOptions());
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
private okhttp3.Call listRolesAsync(final ApiCallback> _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = listRolesValidateBeforeCall(_callback, opts);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIlistRolesRequest {
private APIlistRolesRequest() {
}
/**
* Build call for listRoles
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
List the available roles
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return listRolesCall(_callback);
}
/**
* Execute listRoles request
* @return List<RoleResponse>
* @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
List the available roles
-
0
Error response
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = listRolesWithHttpInfo();
return localVarResp.getData();
}
/**
* Execute listRoles request. Use any specified configuration options to override any other configuration for this request only.
* @return List<RoleResponse>
* @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
List the available roles
-
0
Error response
-
*/
public List execute(ConfigurationOptions opts) throws ApiException {
ApiResponse> localVarResp = listRolesWithHttpInfo(opts);
return localVarResp.getData();
}
/**
* Execute listRoles request with HTTP info returned
* @return ApiResponse<List<RoleResponse>>
* @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
List the available roles
-
0
Error response
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return listRolesWithHttpInfo();
}
/**
* Execute listRoles request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @return ApiResponse<List<RoleResponse>>
* @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
List the available roles
-
0
Error response
-
*/
public ApiResponse> executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return listRolesWithHttpInfo(opts);
}
/**
* Execute listRoles request (asynchronously)
* @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
List the available roles
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return listRolesAsync(_callback);
}
/**
* Execute listRoles request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @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
List the available roles
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback, ConfigurationOptions opts) throws ApiException {
return listRolesAsync(_callback, opts);
}
}
/**
* ListRoles: List Roles
* List the available Roles
* @return APIlistRolesRequest
* @http.response.details
Status Code
Description
Response Headers
200
List the available roles
-
0
Error response
-
*/
public APIlistRolesRequest listRoles() {
return new APIlistRolesRequest();
}
private okhttp3.Call listUsersInRoleCall(String id, final ApiCallback _callback) throws ApiException {
return listUsersInRoleCall(id, _callback, new ConfigurationOptions());
}
private okhttp3.Call listUsersInRoleCall(String id, final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/roles/{id}/users"
.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 = {
"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" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listUsersInRoleValidateBeforeCall(String id, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling listUsersInRole(Async)");
}
return listUsersInRoleCall(id, _callback, opts);
}
private ApiResponse> listUsersInRoleWithHttpInfo(String id) throws ApiException {
okhttp3.Call localVarCall = listUsersInRoleValidateBeforeCall(id, null, new ConfigurationOptions());
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private ApiResponse> listUsersInRoleWithHttpInfo(String id, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = listUsersInRoleValidateBeforeCall(id, null, opts);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call listUsersInRoleAsync(String id, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listUsersInRoleValidateBeforeCall(id, _callback, new ConfigurationOptions());
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
private okhttp3.Call listUsersInRoleAsync(String id, final ApiCallback> _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = listUsersInRoleValidateBeforeCall(id, _callback, opts);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIlistUsersInRoleRequest {
private final String id;
private APIlistUsersInRoleRequest(String id) {
this.id = id;
}
/**
* Build call for listUsersInRole
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return listUsersInRoleCall(id, _callback);
}
/**
* Execute listUsersInRole request
* @return List<UserResponse>
* @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
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = listUsersInRoleWithHttpInfo(id);
return localVarResp.getData();
}
/**
* Execute listUsersInRole request. Use any specified configuration options to override any other configuration for this request only.
* @return List<UserResponse>
* @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
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public List execute(ConfigurationOptions opts) throws ApiException {
ApiResponse> localVarResp = listUsersInRoleWithHttpInfo(id, opts);
return localVarResp.getData();
}
/**
* Execute listUsersInRole request with HTTP info returned
* @return ApiResponse<List<UserResponse>>
* @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
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return listUsersInRoleWithHttpInfo(id);
}
/**
* Execute listUsersInRole request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @return ApiResponse<List<UserResponse>>
* @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
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse> executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return listUsersInRoleWithHttpInfo(id, opts);
}
/**
* Execute listUsersInRole request (asynchronously)
* @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
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return listUsersInRoleAsync(id, _callback);
}
/**
* Execute listUsersInRole request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @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
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback, ConfigurationOptions opts) throws ApiException {
return listUsersInRoleAsync(id, _callback, opts);
}
}
/**
* ListUsersInRole: Get the users in the specified role.
* List all Users in the specified Role
* @param id The unique identifier for the Role (required)
* @return APIlistUsersInRoleRequest
* @http.response.details
Status Code
Description
Response Headers
200
The users in the role
-
400
The details of the input related failure
-
0
Error response
-
*/
public APIlistUsersInRoleRequest listUsersInRole(String id) {
return new APIlistUsersInRoleRequest(id);
}
private okhttp3.Call removeUserFromRoleCall(String id, String userId, final ApiCallback _callback) throws ApiException {
return removeUserFromRoleCall(id, userId, _callback, new ConfigurationOptions());
}
private okhttp3.Call removeUserFromRoleCall(String id, String userId, final ApiCallback _callback, ConfigurationOptions opts) 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 = "/api/roles/{id}/users/{userId}"
.replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString()))
.replace("{" + "userId" + "}", localVarApiClient.escapeString(userId.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" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call removeUserFromRoleValidateBeforeCall(String id, String userId, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling removeUserFromRole(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling removeUserFromRole(Async)");
}
return removeUserFromRoleCall(id, userId, _callback, opts);
}
private ApiResponse removeUserFromRoleWithHttpInfo(String id, String userId) throws ApiException {
okhttp3.Call localVarCall = removeUserFromRoleValidateBeforeCall(id, userId, null, new ConfigurationOptions());
return localVarApiClient.execute(localVarCall);
}
private ApiResponse removeUserFromRoleWithHttpInfo(String id, String userId, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = removeUserFromRoleValidateBeforeCall(id, userId, null, opts);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call removeUserFromRoleAsync(String id, String userId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = removeUserFromRoleValidateBeforeCall(id, userId, _callback, new ConfigurationOptions());
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
private okhttp3.Call removeUserFromRoleAsync(String id, String userId, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = removeUserFromRoleValidateBeforeCall(id, userId, _callback, opts);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public class APIremoveUserFromRoleRequest {
private final String id;
private final String userId;
private APIremoveUserFromRoleRequest(String id, String userId) {
this.id = id;
this.userId = userId;
}
/**
* Build call for removeUserFromRole
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
204
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return removeUserFromRoleCall(id, userId, _callback);
}
/**
* Execute removeUserFromRole request
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public void execute() throws ApiException {
removeUserFromRoleWithHttpInfo(id, userId);
}
/**
* Execute removeUserFromRole request
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public void execute(ConfigurationOptions opts) throws ApiException {
removeUserFromRoleWithHttpInfo(id, userId, opts);
}
/**
* Execute removeUserFromRole request with HTTP info returned
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return removeUserFromRoleWithHttpInfo(id, userId);
}
/**
* Execute removeUserFromRole request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return removeUserFromRoleWithHttpInfo(id, userId, opts);
}
/**
* Execute removeUserFromRole request (asynchronously)
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return removeUserFromRoleAsync(id, userId, _callback);
}
/**
* Execute removeUserFromRole request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @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
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
return removeUserFromRoleAsync(id, userId, _callback, opts);
}
}
/**
* RemoveUserFromRole: Remove User from Role
* Removes the User from the specified Role
* @param id The unique identifier for the Role (required)
* @param userId The unique identifier for the User (required)
* @return APIremoveUserFromRoleRequest
* @http.response.details
Status Code
Description
Response Headers
204
No Content
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public APIremoveUserFromRoleRequest removeUserFromRole(String id, String userId) {
return new APIremoveUserFromRoleRequest(id, userId);
}
private okhttp3.Call updateRoleCall(String id, UpdateRoleRequest updateRoleRequest, final ApiCallback _callback) throws ApiException {
return updateRoleCall(id, updateRoleRequest, _callback, new ConfigurationOptions());
}
private okhttp3.Call updateRoleCall(String id, UpdateRoleRequest updateRoleRequest, final ApiCallback _callback, ConfigurationOptions opts) 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 = updateRoleRequest;
// create path and map variables
String localVarPath = "/api/roles/{id}"
.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 = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json-patch+json",
"application/json",
"text/json",
"application/*+json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "oauth2" };
return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback, opts);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateRoleValidateBeforeCall(String id, UpdateRoleRequest updateRoleRequest, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException("Missing the required parameter 'id' when calling updateRole(Async)");
}
return updateRoleCall(id, updateRoleRequest, _callback, opts);
}
private ApiResponse updateRoleWithHttpInfo(String id, UpdateRoleRequest updateRoleRequest) throws ApiException {
okhttp3.Call localVarCall = updateRoleValidateBeforeCall(id, updateRoleRequest, null, new ConfigurationOptions());
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private ApiResponse updateRoleWithHttpInfo(String id, UpdateRoleRequest updateRoleRequest, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = updateRoleValidateBeforeCall(id, updateRoleRequest, null, opts);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call updateRoleAsync(String id, UpdateRoleRequest updateRoleRequest, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = updateRoleValidateBeforeCall(id, updateRoleRequest, _callback, new ConfigurationOptions());
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
private okhttp3.Call updateRoleAsync(String id, UpdateRoleRequest updateRoleRequest, final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
okhttp3.Call localVarCall = updateRoleValidateBeforeCall(id, updateRoleRequest, _callback, opts);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public class APIupdateRoleRequest {
private final String id;
private UpdateRoleRequest updateRoleRequest;
private APIupdateRoleRequest(String id) {
this.id = id;
}
/**
* Set updateRoleRequest
* @param updateRoleRequest The new definition of the role (optional)
* @return APIupdateRoleRequest
*/
public APIupdateRoleRequest updateRoleRequest(UpdateRoleRequest updateRoleRequest) {
this.updateRoleRequest = updateRoleRequest;
return this;
}
/**
* Build call for updateRole
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return updateRoleCall(id, updateRoleRequest, _callback);
}
/**
* Execute updateRole request
* @return RoleResponse
* @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
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public RoleResponse execute() throws ApiException {
ApiResponse localVarResp = updateRoleWithHttpInfo(id, updateRoleRequest);
return localVarResp.getData();
}
/**
* Execute updateRole request. Use any specified configuration options to override any other configuration for this request only.
* @return RoleResponse
* @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
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public RoleResponse execute(ConfigurationOptions opts) throws ApiException {
ApiResponse localVarResp = updateRoleWithHttpInfo(id, updateRoleRequest, opts);
return localVarResp.getData();
}
/**
* Execute updateRole request with HTTP info returned
* @return ApiResponse<RoleResponse>
* @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
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return updateRoleWithHttpInfo(id, updateRoleRequest);
}
/**
* Execute updateRole request with HTTP info returned. Use any specified configuration options to override any other configuration for this request only.
* @return ApiResponse<RoleResponse>
* @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
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public ApiResponse executeWithHttpInfo(ConfigurationOptions opts) throws ApiException {
return updateRoleWithHttpInfo(id, updateRoleRequest, opts);
}
/**
* Execute updateRole request (asynchronously)
* @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
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return updateRoleAsync(id, updateRoleRequest, _callback);
}
/**
* Execute updateRole request (asynchronously). Use any specified configuration options to override any other configuration for this request only.
* @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
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback, ConfigurationOptions opts) throws ApiException {
return updateRoleAsync(id, updateRoleRequest, _callback, opts);
}
}
/**
* UpdateRole: Update Role
* Update the specified Role
* @param id The unique identifier for the role to be updated (required)
* @return APIupdateRoleRequest
* @http.response.details
Status Code
Description
Response Headers
200
Update a role
-
404
Not Found
-
400
The details of the input related failure
-
0
Error response
-
*/
public APIupdateRoleRequest updateRole(String id) {
return new APIupdateRoleRequest(id);
}
}