io.nem.sdk.openapi.jersey2.api.RestrictionAccountRoutesApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-jersey2-client Show documentation
Show all versions of api-jersey2-client Show documentation
Generated Open API client for NEM
package io.nem.sdk.openapi.jersey2.api;
import io.nem.sdk.openapi.jersey2.invoker.ApiException;
import io.nem.sdk.openapi.jersey2.invoker.ApiClient;
import io.nem.sdk.openapi.jersey2.invoker.ApiResponse;
import io.nem.sdk.openapi.jersey2.invoker.Configuration;
import io.nem.sdk.openapi.jersey2.invoker.Pair;
import javax.ws.rs.core.GenericType;
import io.nem.sdk.openapi.jersey2.model.AccountIds;
import io.nem.sdk.openapi.jersey2.model.AccountRestrictionsInfoDTO;
import io.nem.sdk.openapi.jersey2.model.ModelError;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2020-02-07T22:44:38.001Z[UTC]")
public class RestrictionAccountRoutesApi {
private ApiClient apiClient;
public RestrictionAccountRoutesApi() {
this(Configuration.getDefaultApiClient());
}
public RestrictionAccountRoutesApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the account restrictions
* Returns the account restrictions for a given account.
* @param accountId Account public key or address enconded using a 32-character set. (required)
* @return AccountRestrictionsInfoDTO
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 success -
404 ResourceNotFound -
409 InvalidArgument -
*/
public AccountRestrictionsInfoDTO getAccountRestrictions(String accountId) throws ApiException {
return getAccountRestrictionsWithHttpInfo(accountId).getData();
}
/**
* Get the account restrictions
* Returns the account restrictions for a given account.
* @param accountId Account public key or address enconded using a 32-character set. (required)
* @return ApiResponse<AccountRestrictionsInfoDTO>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 success -
404 ResourceNotFound -
409 InvalidArgument -
*/
public ApiResponse getAccountRestrictionsWithHttpInfo(String accountId) throws ApiException {
Object localVarPostBody = new Object();
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parameter 'accountId' when calling getAccountRestrictions");
}
// create path and map variables
String localVarPath = "/restrictions/account/{accountId}"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* Get account restrictions for given array of addresses
* Returns the account restrictions for a given array of addresses.
* @param accountIds (optional)
* @return List<AccountRestrictionsInfoDTO>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 success -
400 InvalidContent -
409 InvalidArgument -
*/
public List getAccountRestrictionsFromAccounts(AccountIds accountIds) throws ApiException {
return getAccountRestrictionsFromAccountsWithHttpInfo(accountIds).getData();
}
/**
* Get account restrictions for given array of addresses
* Returns the account restrictions for a given array of addresses.
* @param accountIds (optional)
* @return ApiResponse<List<AccountRestrictionsInfoDTO>>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code Description Response Headers
200 success -
400 InvalidContent -
409 InvalidArgument -
*/
public ApiResponse> getAccountRestrictionsFromAccountsWithHttpInfo(AccountIds accountIds) throws ApiException {
Object localVarPostBody = accountIds;
// create path and map variables
String localVarPath = "/restrictions/account";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
GenericType> localVarReturnType = new GenericType>() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
}