app.cybrid.cybrid_api_bank.client.api.ExternalWalletsBankApi Maven / Gradle / Ivy
package app.cybrid.cybrid_api_bank.client.api;
import app.cybrid.cybrid_api_bank.client.ApiClient;
import app.cybrid.cybrid_api_bank.client.model.ErrorResponseBankModel;
import app.cybrid.cybrid_api_bank.client.model.ExternalWalletBankModel;
import app.cybrid.cybrid_api_bank.client.model.ExternalWalletListBankModel;
import app.cybrid.cybrid_api_bank.client.model.PostExternalWalletBankModel;
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-08-24T13:51:20.069627Z[Etc/UTC]")
public class ExternalWalletsBankApi {
private ApiClient apiClient;
public ExternalWalletsBankApi() {
this(new ApiClient());
}
@Autowired
public ExternalWalletsBankApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create ExternalWallet
* Create an ExternalWallet. ## Wallet creation External Wallets can be created for a Bank or a Customer. To create a wallet for your Bank, omit the `customer_guid` parameter in the request body. To create a wallet for your Customers, include the `customer_guid` parameter in the request body. ## State | State | Description | |-------|-------------| | storing | The Platform is storing the external wallet details in our private store | | pending | The Platform is waiting for the external wallet to be created | | completed | The Platform has created the external wallet | | failed | The Platform was not able to successfully create the external wallet | | deleting | The Platform is deleting the external wallet | | deleted | The Platform has deleted the external wallet | External wallets can be added to the bank by leaving the customer_guid blank. External wallets added to the bank can be used by any customer of the bank. External wallets can also be added to a specific customer by providing the customer_guid. External wallets added to a customer can only be used by that customer. Required scope: **external_wallets:execute**
* 201 - ExternalWallet created
*
400 - Invalid requests
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
*
409 - Data already exists
*
422 - Unable to process request
* @param postExternalWalletBankModel The postExternalWalletBankModel parameter
* @return ExternalWalletBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec createExternalWalletRequestCreation(PostExternalWalletBankModel postExternalWalletBankModel) throws WebClientResponseException {
Object postBody = postExternalWalletBankModel;
// verify the required parameter 'postExternalWalletBankModel' is set
if (postExternalWalletBankModel == null) {
throw new WebClientResponseException("Missing the required parameter 'postExternalWalletBankModel' when calling createExternalWallet", 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/external_wallets", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Create ExternalWallet
* Create an ExternalWallet. ## Wallet creation External Wallets can be created for a Bank or a Customer. To create a wallet for your Bank, omit the `customer_guid` parameter in the request body. To create a wallet for your Customers, include the `customer_guid` parameter in the request body. ## State | State | Description | |-------|-------------| | storing | The Platform is storing the external wallet details in our private store | | pending | The Platform is waiting for the external wallet to be created | | completed | The Platform has created the external wallet | | failed | The Platform was not able to successfully create the external wallet | | deleting | The Platform is deleting the external wallet | | deleted | The Platform has deleted the external wallet | External wallets can be added to the bank by leaving the customer_guid blank. External wallets added to the bank can be used by any customer of the bank. External wallets can also be added to a specific customer by providing the customer_guid. External wallets added to a customer can only be used by that customer. Required scope: **external_wallets:execute**
* 201 - ExternalWallet created
*
400 - Invalid requests
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
*
409 - Data already exists
*
422 - Unable to process request
* @param postExternalWalletBankModel The postExternalWalletBankModel parameter
* @return ExternalWalletBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono createExternalWallet(PostExternalWalletBankModel postExternalWalletBankModel) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return createExternalWalletRequestCreation(postExternalWalletBankModel).bodyToMono(localVarReturnType);
}
public Mono> createExternalWalletWithHttpInfo(PostExternalWalletBankModel postExternalWalletBankModel) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return createExternalWalletRequestCreation(postExternalWalletBankModel).toEntity(localVarReturnType);
}
/**
* Delete External Wallet
* Deletes an external wallet. Required scope: **external_wallets:execute**
* 200 - External wallet deleted
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
*
404 - ExternalWallet not found
* @param externalWalletGuid Identifier for the external wallet.
* @return ExternalWalletBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec deleteExternalWalletRequestCreation(String externalWalletGuid) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'externalWalletGuid' is set
if (externalWalletGuid == null) {
throw new WebClientResponseException("Missing the required parameter 'externalWalletGuid' when calling deleteExternalWallet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("external_wallet_guid", externalWalletGuid);
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/external_wallets/{external_wallet_guid}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Delete External Wallet
* Deletes an external wallet. Required scope: **external_wallets:execute**
* 200 - External wallet deleted
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
*
404 - ExternalWallet not found
* @param externalWalletGuid Identifier for the external wallet.
* @return ExternalWalletBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono deleteExternalWallet(String externalWalletGuid) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return deleteExternalWalletRequestCreation(externalWalletGuid).bodyToMono(localVarReturnType);
}
public Mono> deleteExternalWalletWithHttpInfo(String externalWalletGuid) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return deleteExternalWalletRequestCreation(externalWalletGuid).toEntity(localVarReturnType);
}
/**
* Get External Wallet
* Retrieves an external_wallet. Required scope: **external_wallets:read**
* 200 - External wallet found
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
*
404 - ExternalWallet not found
* @param externalWalletGuid Identifier for the external_wallet.
* @return ExternalWalletBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec getExternalWalletRequestCreation(String externalWalletGuid) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'externalWalletGuid' is set
if (externalWalletGuid == null) {
throw new WebClientResponseException("Missing the required parameter 'externalWalletGuid' when calling getExternalWallet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map pathParams = new HashMap();
pathParams.put("external_wallet_guid", externalWalletGuid);
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/external_wallets/{external_wallet_guid}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Get External Wallet
* Retrieves an external_wallet. Required scope: **external_wallets:read**
* 200 - External wallet found
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
*
404 - ExternalWallet not found
* @param externalWalletGuid Identifier for the external_wallet.
* @return ExternalWalletBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono getExternalWallet(String externalWalletGuid) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return getExternalWalletRequestCreation(externalWalletGuid).bodyToMono(localVarReturnType);
}
public Mono> getExternalWalletWithHttpInfo(String externalWalletGuid) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return getExternalWalletRequestCreation(externalWalletGuid).toEntity(localVarReturnType);
}
/**
* Get external wallets list
* Retrieves a listing of external wallets. Required scope: **external_wallets:read**
* 200 - Get list of external_wallets
*
400 - Invalid requests
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
* @param page The page index to retrieve.
* @param perPage The number of entities per page to return.
* @param owner The owner of the entity.
* @param guid Comma separated external_wallet_guids to list external_wallets for.
* @param bankGuid Comma separated bank_guids to list external_wallets for.
* @param customerGuid Comma separated customer_guids to list external_wallets for.
* @param asset Comma separated assets to list external_wallets for.
* @param state Comma separated states to list external_wallets for.
* @return ExternalWalletListBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
private ResponseSpec listExternalWalletsRequestCreation(java.math.BigInteger page, java.math.BigInteger perPage, String owner, String guid, String bankGuid, String customerGuid, String asset, String state) 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, "owner", owner));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "guid", guid));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "bank_guid", bankGuid));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "customer_guid", customerGuid));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "asset", asset));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "state", state));
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/external_wallets", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Get external wallets list
* Retrieves a listing of external wallets. Required scope: **external_wallets:read**
* 200 - Get list of external_wallets
*
400 - Invalid requests
*
401 - Unauthorized - Authentication failed,
*
403 - Invalid scope
* @param page The page index to retrieve.
* @param perPage The number of entities per page to return.
* @param owner The owner of the entity.
* @param guid Comma separated external_wallet_guids to list external_wallets for.
* @param bankGuid Comma separated bank_guids to list external_wallets for.
* @param customerGuid Comma separated customer_guids to list external_wallets for.
* @param asset Comma separated assets to list external_wallets for.
* @param state Comma separated states to list external_wallets for.
* @return ExternalWalletListBankModel
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono listExternalWallets(java.math.BigInteger page, java.math.BigInteger perPage, String owner, String guid, String bankGuid, String customerGuid, String asset, String state) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return listExternalWalletsRequestCreation(page, perPage, owner, guid, bankGuid, customerGuid, asset, state).bodyToMono(localVarReturnType);
}
public Mono> listExternalWalletsWithHttpInfo(java.math.BigInteger page, java.math.BigInteger perPage, String owner, String guid, String bankGuid, String customerGuid, String asset, String state) throws WebClientResponseException {
ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};
return listExternalWalletsRequestCreation(page, perPage, owner, guid, bankGuid, customerGuid, asset, state).toEntity(localVarReturnType);
}
}