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.
/*
* SnapTrade
* Connect brokerage accounts to your app for live positions and trading
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by Konfig (https://konfigthis.com).
* Do not edit the class manually.
*/
package com.konfigthis.client.api;
import com.konfigthis.client.ApiCallback;
import com.konfigthis.client.ApiClient;
import com.konfigthis.client.ApiException;
import com.konfigthis.client.ApiResponse;
import com.konfigthis.client.Configuration;
import com.konfigthis.client.Pair;
import com.konfigthis.client.ProgressRequestBody;
import com.konfigthis.client.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.konfigthis.client.model.DeleteUserResponse;
import com.konfigthis.client.model.SnapTradeLoginUserRequestBody;
import com.konfigthis.client.model.SnapTradeRegisterUserRequestBody;
import com.konfigthis.client.model.UserIDandSecret;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.GenericType;
public class AuthenticationApiGenerated {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AuthenticationApiGenerated() throws IllegalArgumentException {
this(Configuration.getDefaultApiClient());
}
public AuthenticationApiGenerated(ApiClient apiClient) throws IllegalArgumentException {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public int getHostIndex() {
return localHostIndex;
}
public void setHostIndex(int hostIndex) {
this.localHostIndex = hostIndex;
}
public String getCustomBaseUrl() {
return localCustomBaseUrl;
}
public void setCustomBaseUrl(String customBaseUrl) {
this.localCustomBaseUrl = customBaseUrl;
}
private okhttp3.Call deleteSnapTradeUserCall(String userId, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/snapTrade/deleteUser";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (userId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId));
}
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);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "PartnerClientId", "PartnerSignature", "PartnerTimestamp" };
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteSnapTradeUserValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling deleteSnapTradeUser(Async)");
}
return deleteSnapTradeUserCall(userId, _callback);
}
private ApiResponse deleteSnapTradeUserWithHttpInfo(String userId) throws ApiException {
okhttp3.Call localVarCall = deleteSnapTradeUserValidateBeforeCall(userId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call deleteSnapTradeUserAsync(String userId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = deleteSnapTradeUserValidateBeforeCall(userId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class DeleteSnapTradeUserRequestBuilderGenerated {
final String userId;
public DeleteSnapTradeUserRequestBuilderGenerated(String userId) {
this.userId = userId;
}
/**
* Build call for deleteSnapTradeUser
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
500
Unexpected Error
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return deleteSnapTradeUserCall(userId, _callback);
}
/**
* Execute deleteSnapTradeUser request
* @return DeleteUserResponse
* @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
OK
-
500
Unexpected Error
-
*/
public DeleteUserResponse execute() throws ApiException {
ApiResponse localVarResp = deleteSnapTradeUserWithHttpInfo(userId);
return localVarResp.getResponseBody();
}
/**
* Execute deleteSnapTradeUser request with HTTP info returned
* @return ApiResponse<DeleteUserResponse>
* @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
OK
-
500
Unexpected Error
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return deleteSnapTradeUserWithHttpInfo(userId);
}
/**
* Execute deleteSnapTradeUser request (asynchronously)
* @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
OK
-
500
Unexpected Error
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return deleteSnapTradeUserAsync(userId, _callback);
}
}
/**
* Delete user
* Deletes a registered user and all associated data. This action is irreversible. This API is asynchronous and will return a 200 status code if the request is accepted. The user and all associated data will be queued for deletion. Once deleted, a `USER_DELETED` webhook will be sent.
* @param userId (required)
* @return DeleteSnapTradeUserRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
500
Unexpected Error
-
*/
public AuthenticationApi.DeleteSnapTradeUserRequestBuilder deleteSnapTradeUser(String userId) throws IllegalArgumentException {
if (userId == null) throw new IllegalArgumentException("\"userId\" is required but got null");
return ((AuthenticationApi) this).new DeleteSnapTradeUserRequestBuilder(userId);
}
private okhttp3.Call listSnapTradeUsersCall(final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/snapTrade/listUsers";
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"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "PartnerClientId", "PartnerSignature", "PartnerTimestamp" };
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call listSnapTradeUsersValidateBeforeCall(final ApiCallback _callback) throws ApiException {
return listSnapTradeUsersCall(_callback);
}
private ApiResponse> listSnapTradeUsersWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = listSnapTradeUsersValidateBeforeCall(null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call listSnapTradeUsersAsync(final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listSnapTradeUsersValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class ListSnapTradeUsersRequestBuilderGenerated {
public ListSnapTradeUsersRequestBuilderGenerated() {
}
/**
* Build call for listSnapTradeUsers
* @param _callback ApiCallback API callback
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return listSnapTradeUsersCall(_callback);
}
/**
* Execute listSnapTradeUsers request
* @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
OK
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = listSnapTradeUsersWithHttpInfo();
return localVarResp.getResponseBody();
}
/**
* Execute listSnapTradeUsers request with HTTP info returned
* @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
OK
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return listSnapTradeUsersWithHttpInfo();
}
/**
* Execute listSnapTradeUsers request (asynchronously)
* @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
OK
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return listSnapTradeUsersAsync(_callback);
}
}
/**
* List all users
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
* @return ListSnapTradeUsersRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public AuthenticationApi.ListSnapTradeUsersRequestBuilder listSnapTradeUsers() throws IllegalArgumentException {
return ((AuthenticationApi) this).new ListSnapTradeUsersRequestBuilder();
}
private okhttp3.Call loginSnapTradeUserCall(String userId, String userSecret, SnapTradeLoginUserRequestBody snapTradeLoginUserRequestBody, final ApiCallback _callback) throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] { };
// Determine Base Path to Use
if (localCustomBaseUrl != null){
basePath = localCustomBaseUrl;
} else if ( localBasePaths.length > 0 ) {
basePath = localBasePaths[localHostIndex];
} else {
basePath = null;
}
Object localVarPostBody = snapTradeLoginUserRequestBody;
// create path and map variables
String localVarPath = "/snapTrade/login";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (userId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId));
}
if (userSecret != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("userSecret", userSecret));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
localVarHeaderParams.put("Content-Type", localVarContentType);
}
String[] localVarAuthNames = new String[] { "PartnerClientId", "PartnerSignature", "PartnerTimestamp" };
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call loginSnapTradeUserValidateBeforeCall(String userId, String userSecret, SnapTradeLoginUserRequestBody snapTradeLoginUserRequestBody, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling loginSnapTradeUser(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling loginSnapTradeUser(Async)");
}
return loginSnapTradeUserCall(userId, userSecret, snapTradeLoginUserRequestBody, _callback);
}
private ApiResponse