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

app.cybrid.cybrid_api_id.client.api.UsersIdpApi Maven / Gradle / Ivy

There is a newer version: v0.119.126
Show newest version
package app.cybrid.cybrid_api_id.client.api;

import app.cybrid.cybrid_api_id.client.ApiClient;

import app.cybrid.cybrid_api_id.client.model.ErrorResponseIdpModel;
import app.cybrid.cybrid_api_id.client.model.PostUserIdpModel;
import app.cybrid.cybrid_api_id.client.model.UserIdpModel;
import app.cybrid.cybrid_api_id.client.model.UserListIdpModel;

import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-21T22:21:18.012560Z[Etc/UTC]")
public class UsersIdpApi {
    private ApiClient apiClient;

    public UsersIdpApi() {
        this(new ApiClient());
    }

    @Autowired
    public UsersIdpApi(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return apiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * Create user
     * Creates a user.  
     * 

201 - User created * @param postUserIdpModel The postUserIdpModel parameter * @return UserIdpModel * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ private ResponseSpec createUserRequestCreation(PostUserIdpModel postUserIdpModel) throws WebClientResponseException { Object postBody = postUserIdpModel; // verify the required parameter 'postUserIdpModel' is set if (postUserIdpModel == null) { throw new WebClientResponseException("Missing the required parameter 'postUserIdpModel' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { "application/json" }; final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "BearerAuth", "oauth2" }; ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/api/users", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * Create user * Creates a user. *

201 - User created * @param postUserIdpModel The postUserIdpModel parameter * @return UserIdpModel * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ public Mono createUser(PostUserIdpModel postUserIdpModel) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return createUserRequestCreation(postUserIdpModel).bodyToMono(localVarReturnType); } public Mono> createUserWithHttpInfo(PostUserIdpModel postUserIdpModel) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return createUserRequestCreation(postUserIdpModel).toEntity(localVarReturnType); } /** * Disable User * Disables a user. User is not deleted. Required scope: **users:execute** *

204 - User disabled *

401 - Unauthorized - Authentication failed, *

403 - Invalid scope *

404 - user not found * @param userGuid Identifier for the user. * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ private ResponseSpec disableUserRequestCreation(String userGuid) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'userGuid' is set if (userGuid == null) { throw new WebClientResponseException("Missing the required parameter 'userGuid' when calling disableUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); pathParams.put("user_guid", userGuid); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "BearerAuth", "oauth2" }; ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/api/users/{user_guid}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * Disable User * Disables a user. User is not deleted. Required scope: **users:execute** *

204 - User disabled *

401 - Unauthorized - Authentication failed, *

403 - Invalid scope *

404 - user not found * @param userGuid Identifier for the user. * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ public Mono disableUser(String userGuid) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return disableUserRequestCreation(userGuid).bodyToMono(localVarReturnType); } public Mono> disableUserWithHttpInfo(String userGuid) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return disableUserRequestCreation(userGuid).toEntity(localVarReturnType); } /** * Get User * Retrieves a user. Required scope: **users:read** *

200 - user found *

401 - Unauthorized - Authentication failed, *

403 - Invalid scope *

404 - user not found * @param userGuid Identifier for the user. * @return UserIdpModel * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ private ResponseSpec getUserRequestCreation(String userGuid) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'userGuid' is set if (userGuid == null) { throw new WebClientResponseException("Missing the required parameter 'userGuid' when calling getUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); pathParams.put("user_guid", userGuid); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "BearerAuth", "oauth2" }; ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/api/users/{user_guid}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * Get User * Retrieves a user. Required scope: **users:read** *

200 - user found *

401 - Unauthorized - Authentication failed, *

403 - Invalid scope *

404 - user not found * @param userGuid Identifier for the user. * @return UserIdpModel * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ public Mono getUser(String userGuid) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return getUserRequestCreation(userGuid).bodyToMono(localVarReturnType); } public Mono> getUserWithHttpInfo(String userGuid) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return getUserRequestCreation(userGuid).toEntity(localVarReturnType); } /** * List users * Retrieve a list users. Required scope: **users:read** *

200 - list users * @param page The page index to retrieve. * @param perPage The number of entities per page to return. * @param guid Comma separated guids to list users for. * @return UserListIdpModel * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ private ResponseSpec listUserRequestCreation(java.math.BigInteger page, java.math.BigInteger perPage, String guid) throws WebClientResponseException { Object postBody = null; // create path and map variables final Map pathParams = new HashMap(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "page", page)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "per_page", perPage)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "guid", guid)); final String[] localVarAccepts = { "application/json" }; final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "BearerAuth", "oauth2" }; ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI("/api/users", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** * List users * Retrieve a list users. Required scope: **users:read** *

200 - list users * @param page The page index to retrieve. * @param perPage The number of entities per page to return. * @param guid Comma separated guids to list users for. * @return UserListIdpModel * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ public Mono listUser(java.math.BigInteger page, java.math.BigInteger perPage, String guid) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return listUserRequestCreation(page, perPage, guid).bodyToMono(localVarReturnType); } public Mono> listUserWithHttpInfo(java.math.BigInteger page, java.math.BigInteger perPage, String guid) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return listUserRequestCreation(page, perPage, guid).toEntity(localVarReturnType); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy