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.
/*
* Catapult REST Endpoints
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.7.21
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package io.nem.sdk.openapi.okhttp_gson.api;
import io.nem.sdk.openapi.okhttp_gson.invoker.ApiCallback;
import io.nem.sdk.openapi.okhttp_gson.invoker.ApiClient;
import io.nem.sdk.openapi.okhttp_gson.invoker.ApiException;
import io.nem.sdk.openapi.okhttp_gson.invoker.ApiResponse;
import io.nem.sdk.openapi.okhttp_gson.invoker.Configuration;
import io.nem.sdk.openapi.okhttp_gson.invoker.Pair;
import io.nem.sdk.openapi.okhttp_gson.invoker.ProgressRequestBody;
import io.nem.sdk.openapi.okhttp_gson.invoker.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import io.nem.sdk.openapi.okhttp_gson.model.ChainScoreDTO;
import io.nem.sdk.openapi.okhttp_gson.model.HeightInfoDTO;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ChainRoutesApi {
private ApiClient localVarApiClient;
public ChainRoutesApi() {
this(Configuration.getDefaultApiClient());
}
public ChainRoutesApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for getChainHeight
* @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
success
-
*/
public okhttp3.Call getChainHeightCall(final ApiCallback _callback) throws ApiException {
Object localVarPostBody = new Object();
// create path and map variables
String localVarPath = "/chain/height";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = 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);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getChainHeightValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getChainHeightCall(_callback);
return localVarCall;
}
/**
* Get the current height of the chain
* Returns the current height of the blockchain.
* @return HeightInfoDTO
* @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
success
-
*/
public HeightInfoDTO getChainHeight() throws ApiException {
ApiResponse localVarResp = getChainHeightWithHttpInfo();
return localVarResp.getData();
}
/**
* Get the current height of the chain
* Returns the current height of the blockchain.
* @return ApiResponse<HeightInfoDTO>
* @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
success
-
*/
public ApiResponse getChainHeightWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getChainHeightValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get the current height of the chain (asynchronously)
* Returns the current height of the blockchain.
* @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
success
-
*/
public okhttp3.Call getChainHeightAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getChainHeightValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for getChainScore
* @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
success
-
*/
public okhttp3.Call getChainScoreCall(final ApiCallback _callback) throws ApiException {
Object localVarPostBody = new Object();
// create path and map variables
String localVarPath = "/chain/score";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = 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);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { };
return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call getChainScoreValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getChainScoreCall(_callback);
return localVarCall;
}
/**
* Get the current score of the chain
* Gets the current score of the blockchain. The higher the score, the better the chain. During synchronization, nodes try to get the best blockchain in the network. The score for a block is derived from its difficulty and the time (in seconds) that has elapsed since the last block: block score = difficulty − time elapsed since last block
* @return ChainScoreDTO
* @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
success
-
*/
public ChainScoreDTO getChainScore() throws ApiException {
ApiResponse localVarResp = getChainScoreWithHttpInfo();
return localVarResp.getData();
}
/**
* Get the current score of the chain
* Gets the current score of the blockchain. The higher the score, the better the chain. During synchronization, nodes try to get the best blockchain in the network. The score for a block is derived from its difficulty and the time (in seconds) that has elapsed since the last block: block score = difficulty − time elapsed since last block
* @return ApiResponse<ChainScoreDTO>
* @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
success
-
*/
public ApiResponse getChainScoreWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getChainScoreValidateBeforeCall(null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Get the current score of the chain (asynchronously)
* Gets the current score of the blockchain. The higher the score, the better the chain. During synchronization, nodes try to get the best blockchain in the network. The score for a block is derived from its difficulty and the time (in seconds) that has elapsed since the last block: block score = difficulty − time elapsed since last block
* @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
success
-
*/
public okhttp3.Call getChainScoreAsync(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getChainScoreValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}