Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
419 changes: 419 additions & 0 deletions src/main/java/io/gopluslabs/client/api/LockControllerApi.java

Large diffs are not rendered by default.

322 changes: 322 additions & 0 deletions src/main/java/io/gopluslabs/client/api/SecWareOpenControllerApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,322 @@
/*
* GoPlus Security API Document
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/

package io.gopluslabs.client.api;

import io.gopluslabs.client.ApiCallback;
import io.gopluslabs.client.ApiClient;
import io.gopluslabs.client.ApiException;
import io.gopluslabs.client.ApiResponse;
import io.gopluslabs.client.Configuration;
import io.gopluslabs.client.Pair;
import io.gopluslabs.client.ProgressRequestBody;
import io.gopluslabs.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import io.gopluslabs.client.model.ResponseWrapperGetScanResult;
import io.gopluslabs.client.model.ResponseWrapperOpenScanAddressResp;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SecWareOpenControllerApi {
private ApiClient apiClient;

public SecWareOpenControllerApi() {
this(Configuration.getDefaultApiClient());
}

public SecWareOpenControllerApi(ApiClient apiClient) {
this.apiClient = apiClient;
}

public ApiClient getApiClient() {
return apiClient;
}

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

/**
* Build call for getScanResultUsingGET
* @param requestId request_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public okhttp3.Call getScanResultUsingGETCall(String requestId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;

// create path and map variables
String localVarPath = "/api/v1/address/result";

List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
if (requestId != null)
localVarQueryParams.addAll(apiClient.parameterToPair("request_id", requestId));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));

Map<String, Object> localVarFormParams = new HashMap<String, Object>();

final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

final String[] localVarContentTypes = {

};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);

if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
@Override
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
okhttp3.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}

String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}

@SuppressWarnings("rawtypes")
private okhttp3.Call getScanResultUsingGETValidateBeforeCall(String requestId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'requestId' is set
if (requestId == null) {
throw new ApiException("Missing the required parameter 'requestId' when calling getScanResultUsingGET(Async)");
}

okhttp3.Call call = getScanResultUsingGETCall(requestId, authorization, progressListener, progressRequestListener);
return call;

}

/**
* Get address scan result
*
* @param requestId request_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @return ResponseWrapperGetScanResult
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResponseWrapperGetScanResult getScanResultUsingGET(String requestId, String authorization) throws ApiException {
ApiResponse<ResponseWrapperGetScanResult> resp = getScanResultUsingGETWithHttpInfo(requestId, authorization);
return resp.getData();
}

/**
* Get address scan result
*
* @param requestId request_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @return ApiResponse&lt;ResponseWrapperGetScanResult&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<ResponseWrapperGetScanResult> getScanResultUsingGETWithHttpInfo(String requestId, String authorization) throws ApiException {
okhttp3.Call call = getScanResultUsingGETValidateBeforeCall(requestId, authorization, null, null);
Type localVarReturnType = new TypeToken<ResponseWrapperGetScanResult>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}

/**
* Get address scan result (asynchronously)
*
* @param requestId request_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @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
*/
public okhttp3.Call getScanResultUsingGETAsync(String requestId, String authorization, final ApiCallback<ResponseWrapperGetScanResult> callback) throws ApiException {

ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};

progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}

okhttp3.Call call = getScanResultUsingGETValidateBeforeCall(requestId, authorization, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<ResponseWrapperGetScanResult>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
/**
* Build call for scanAddressUsingGET
* @param address address (required)
* @param chainId chain_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @param progressListener Progress listener
* @param progressRequestListener Progress request listener
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
*/
public okhttp3.Call scanAddressUsingGETCall(String address, String chainId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
Object localVarPostBody = null;

// create path and map variables
String localVarPath = "/api/v1/address/scan/{chain_id}"
.replaceAll("\\{" + "chain_id" + "\\}", apiClient.escapeString(chainId.toString()));

List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
if (address != null)
localVarQueryParams.addAll(apiClient.parameterToPair("address", address));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();
if (authorization != null)
localVarHeaderParams.put("Authorization", apiClient.parameterToString(authorization));

Map<String, Object> localVarFormParams = new HashMap<String, Object>();

final String[] localVarAccepts = {
"*/*"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);

final String[] localVarContentTypes = {

};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);

if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() {
@Override
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException {
okhttp3.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();
}
});
}

String[] localVarAuthNames = new String[] { };
return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
}

@SuppressWarnings("rawtypes")
private okhttp3.Call scanAddressUsingGETValidateBeforeCall(String address, String chainId, String authorization, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
// verify the required parameter 'address' is set
if (address == null) {
throw new ApiException("Missing the required parameter 'address' when calling scanAddressUsingGET(Async)");
}
// verify the required parameter 'chainId' is set
if (chainId == null) {
throw new ApiException("Missing the required parameter 'chainId' when calling scanAddressUsingGET(Async)");
}

okhttp3.Call call = scanAddressUsingGETCall(address, chainId, authorization, progressListener, progressRequestListener);
return call;

}

/**
* Start address security scan
*
* @param address address (required)
* @param chainId chain_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @return ResponseWrapperOpenScanAddressResp
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ResponseWrapperOpenScanAddressResp scanAddressUsingGET(String address, String chainId, String authorization) throws ApiException {
ApiResponse<ResponseWrapperOpenScanAddressResp> resp = scanAddressUsingGETWithHttpInfo(address, chainId, authorization);
return resp.getData();
}

/**
* Start address security scan
*
* @param address address (required)
* @param chainId chain_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @return ApiResponse&lt;ResponseWrapperOpenScanAddressResp&gt;
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
*/
public ApiResponse<ResponseWrapperOpenScanAddressResp> scanAddressUsingGETWithHttpInfo(String address, String chainId, String authorization) throws ApiException {
okhttp3.Call call = scanAddressUsingGETValidateBeforeCall(address, chainId, authorization, null, null);
Type localVarReturnType = new TypeToken<ResponseWrapperOpenScanAddressResp>(){}.getType();
return apiClient.execute(call, localVarReturnType);
}

/**
* Start address security scan (asynchronously)
*
* @param address address (required)
* @param chainId chain_id (required)
* @param authorization Authorization (test:Bearer 81|9ihH8JzEuFu4MQ9DjWmH5WrNCPW...) (optional)
* @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
*/
public okhttp3.Call scanAddressUsingGETAsync(String address, String chainId, String authorization, final ApiCallback<ResponseWrapperOpenScanAddressResp> callback) throws ApiException {

ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;

if (callback != null) {
progressListener = new ProgressResponseBody.ProgressListener() {
@Override
public void update(long bytesRead, long contentLength, boolean done) {
callback.onDownloadProgress(bytesRead, contentLength, done);
}
};

progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
@Override
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
callback.onUploadProgress(bytesWritten, contentLength, done);
}
};
}

okhttp3.Call call = scanAddressUsingGETValidateBeforeCall(address, chainId, authorization, progressListener, progressRequestListener);
Type localVarReturnType = new TypeToken<ResponseWrapperOpenScanAddressResp>(){}.getType();
apiClient.executeAsync(call, localVarReturnType, callback);
return call;
}
}
Loading