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.
/*
* Nuts network API spec
* API specification for RPC services available at the nuts-network
*
* The version of the OpenAPI document: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package nl.reinkrul.nuts.network;
import nl.reinkrul.nuts.ApiCallback;
import nl.reinkrul.nuts.ApiClient;
import nl.reinkrul.nuts.ApiException;
import nl.reinkrul.nuts.ApiResponse;
import nl.reinkrul.nuts.Configuration;
import nl.reinkrul.nuts.Pair;
import nl.reinkrul.nuts.ProgressRequestBody;
import nl.reinkrul.nuts.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import nl.reinkrul.nuts.network.InlineResponseDefault;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TransactionsApi {
private ApiClient localVarApiClient;
public TransactionsApi() {
this(Configuration.getDefaultApiClient());
}
public TransactionsApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for getTransaction
* @param ref Reference of the transaction (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Transaction is known in the transaction log
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public okhttp3.Call getTransactionCall(String ref, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/internal/network/v1/transaction/{ref}"
.replaceAll("\\{" + "ref" + "\\}", localVarApiClient.escapeString(ref.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/jose", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTransactionValidateBeforeCall(String ref, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'ref' is set
if (ref == null) {
throw new ApiException("Missing the required parameter 'ref' when calling getTransaction(Async)");
}
okhttp3.Call localVarCall = getTransactionCall(ref, _callback);
return localVarCall;
}
/**
* Retrieves a transaction
* Retrieves a transaction. error returns: * 400 - invalid transaction reference * 404 - transaction not found * 500 - internal server error
* @param ref Reference of the transaction (required)
* @return String
* @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
Transaction is known in the transaction log
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public String getTransaction(String ref) throws ApiException {
ApiResponse localVarResp = getTransactionWithHttpInfo(ref);
return localVarResp.getData();
}
/**
* Retrieves a transaction
* Retrieves a transaction. error returns: * 400 - invalid transaction reference * 404 - transaction not found * 500 - internal server error
* @param ref Reference of the transaction (required)
* @return ApiResponse<String>
* @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
Transaction is known in the transaction log
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public ApiResponse getTransactionWithHttpInfo(String ref) throws ApiException {
okhttp3.Call localVarCall = getTransactionValidateBeforeCall(ref, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Retrieves a transaction (asynchronously)
* Retrieves a transaction. error returns: * 400 - invalid transaction reference * 404 - transaction not found * 500 - internal server error
* @param ref Reference of the transaction (required)
* @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
Transaction is known in the transaction log
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public okhttp3.Call getTransactionAsync(String ref, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getTransactionValidateBeforeCall(ref, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getTransactionPayload
* @param ref Reference of the transaction (required)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Transaction found (with payload) and returned.
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public okhttp3.Call getTransactionPayloadCall(String ref, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/internal/network/v1/transaction/{ref}/payload"
.replaceAll("\\{" + "ref" + "\\}", localVarApiClient.escapeString(ref.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/octet-stream", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getTransactionPayloadValidateBeforeCall(String ref, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'ref' is set
if (ref == null) {
throw new ApiException("Missing the required parameter 'ref' when calling getTransactionPayload(Async)");
}
okhttp3.Call localVarCall = getTransactionPayloadCall(ref, _callback);
return localVarCall;
}
/**
* Gets the transaction payload
* Gets the transaction payload. error returns: * 400 - invalid transaction reference * 404 - transaction or payload not found * 500 - internal server error
* @param ref Reference of the transaction (required)
* @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
Transaction found (with payload) and returned.
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public void getTransactionPayload(String ref) throws ApiException {
getTransactionPayloadWithHttpInfo(ref);
}
/**
* Gets the transaction payload
* Gets the transaction payload. error returns: * 400 - invalid transaction reference * 404 - transaction or payload not found * 500 - internal server error
* @param ref Reference of the transaction (required)
* @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
200
Transaction found (with payload) and returned.
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public ApiResponse getTransactionPayloadWithHttpInfo(String ref) throws ApiException {
okhttp3.Call localVarCall = getTransactionPayloadValidateBeforeCall(ref, null);
return localVarApiClient.execute(localVarCall);
}
/**
* Gets the transaction payload (asynchronously)
* Gets the transaction payload. error returns: * 400 - invalid transaction reference * 404 - transaction or payload not found * 500 - internal server error
* @param ref Reference of the transaction (required)
* @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
Transaction found (with payload) and returned.
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public okhttp3.Call getTransactionPayloadAsync(String ref, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getTransactionPayloadValidateBeforeCall(ref, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
/**
* Build call for listTransactions
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
Successfully listed the transactions
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public okhttp3.Call listTransactionsCall(final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/internal/network/v1/transaction";
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", "application/problem+json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listTransactionsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = listTransactionsCall(_callback);
return localVarCall;
}
/**
* Lists the transactions on the DAG
* Lists all transactions on the DAG. Since this call returns all transactions on the DAG, care should be taken when there are many of them. TODO: By then we'd need a more elaborate querying interface (ranging over timestamps/hashes, pagination, filtering, etc). error returns: * 500 - internal server error
* @return List<String>
* @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
Successfully listed the transactions
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public List listTransactions() throws ApiException {
ApiResponse> localVarResp = listTransactionsWithHttpInfo();
return localVarResp.getData();
}
/**
* Lists the transactions on the DAG
* Lists all transactions on the DAG. Since this call returns all transactions on the DAG, care should be taken when there are many of them. TODO: By then we'd need a more elaborate querying interface (ranging over timestamps/hashes, pagination, filtering, etc). error returns: * 500 - internal server error
* @return ApiResponse<List<String>>
* @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
Successfully listed the transactions
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public ApiResponse> listTransactionsWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = listTransactionsValidateBeforeCall(null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Lists the transactions on the DAG (asynchronously)
* Lists all transactions on the DAG. Since this call returns all transactions on the DAG, care should be taken when there are many of them. TODO: By then we'd need a more elaborate querying interface (ranging over timestamps/hashes, pagination, filtering, etc). error returns: * 500 - internal server error
* @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
Successfully listed the transactions
-
0
Default return values follow Problem Details for HTTP APIs as specified in [RFC7807](https://tools.ietf.org/html/rfc7807). Currently, return values contain the following members of a problem details object: - \"title\" (string) - A short, human-readable summary of the problem type. - \"status\" (number) - The HTTP status code generated by the origin server for this occurrence of the problem. - \"detail\" (string) - A human-readable explanation specific to this occurrence of the problem.
-
*/
public okhttp3.Call listTransactionsAsync(final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listTransactionsValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}