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.BrokerageAuthorization;
import com.konfigthis.client.model.BrokerageAuthorizationDisabledConfirmation;
import com.konfigthis.client.model.BrokerageAuthorizationRefreshConfirmation;
import com.konfigthis.client.model.SessionEvent;
import java.util.UUID;
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 ConnectionsApiGenerated {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public ConnectionsApiGenerated() throws IllegalArgumentException {
this(Configuration.getDefaultApiClient());
}
public ConnectionsApiGenerated(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 detailBrokerageAuthorizationCall(UUID authorizationId, String userId, String userSecret, 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 = "/authorizations/{authorizationId}"
.replace("{" + "authorizationId" + "}", localVarApiClient.escapeString(authorizationId.toString()));
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 = {
};
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 detailBrokerageAuthorizationValidateBeforeCall(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'authorizationId' is set
if (authorizationId == null) {
throw new ApiException("Missing the required parameter 'authorizationId' when calling detailBrokerageAuthorization(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling detailBrokerageAuthorization(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling detailBrokerageAuthorization(Async)");
}
return detailBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
private ApiResponse detailBrokerageAuthorizationWithHttpInfo(UUID authorizationId, String userId, String userSecret) throws ApiException {
okhttp3.Call localVarCall = detailBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call detailBrokerageAuthorizationAsync(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = detailBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class DetailBrokerageAuthorizationRequestBuilderGenerated {
final UUID authorizationId;
final String userId;
final String userSecret;
public DetailBrokerageAuthorizationRequestBuilderGenerated(UUID authorizationId, String userId, String userSecret) {
this.authorizationId = authorizationId;
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Build call for detailBrokerageAuthorization
* @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
Authorization object for the authenticated user.
-
0
Unexpected error.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return detailBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
/**
* Execute detailBrokerageAuthorization request
* @return BrokerageAuthorization
* @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
Authorization object for the authenticated user.
-
0
Unexpected error.
-
*/
public BrokerageAuthorization execute() throws ApiException {
ApiResponse localVarResp = detailBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
return localVarResp.getResponseBody();
}
/**
* Execute detailBrokerageAuthorization request with HTTP info returned
* @return ApiResponse<BrokerageAuthorization>
* @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
Authorization object for the authenticated user.
-
0
Unexpected error.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return detailBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
}
/**
* Execute detailBrokerageAuthorization 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
Authorization object for the authenticated user.
-
0
Unexpected error.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return detailBrokerageAuthorizationAsync(authorizationId, userId, userSecret, _callback);
}
}
/**
* Get brokerage authorization details
* Returns a single brokerage authorization object for the specified ID.
* @param authorizationId The ID of a brokerage authorization object. (required)
* @param userId (required)
* @param userSecret (required)
* @return DetailBrokerageAuthorizationRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Authorization object for the authenticated user.
-
0
Unexpected error.
-
*/
public ConnectionsApi.DetailBrokerageAuthorizationRequestBuilder detailBrokerageAuthorization(UUID authorizationId, String userId, String userSecret) throws IllegalArgumentException {
if (authorizationId == null) throw new IllegalArgumentException("\"authorizationId\" is required but got null");
if (userId == null) throw new IllegalArgumentException("\"userId\" is required but got null");
if (userSecret == null) throw new IllegalArgumentException("\"userSecret\" is required but got null");
return ((ConnectionsApi) this).new DetailBrokerageAuthorizationRequestBuilder(authorizationId, userId, userSecret);
}
private okhttp3.Call disableBrokerageAuthorizationCall(UUID authorizationId, String userId, String userSecret, 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 = "/authorizations/{authorizationId}/disable"
.replace("{" + "authorizationId" + "}", localVarApiClient.escapeString(authorizationId.toString()));
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 = {
};
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 disableBrokerageAuthorizationValidateBeforeCall(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'authorizationId' is set
if (authorizationId == null) {
throw new ApiException("Missing the required parameter 'authorizationId' when calling disableBrokerageAuthorization(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling disableBrokerageAuthorization(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling disableBrokerageAuthorization(Async)");
}
return disableBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
private ApiResponse disableBrokerageAuthorizationWithHttpInfo(UUID authorizationId, String userId, String userSecret) throws ApiException {
okhttp3.Call localVarCall = disableBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call disableBrokerageAuthorizationAsync(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = disableBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class DisableBrokerageAuthorizationRequestBuilderGenerated {
final UUID authorizationId;
final String userId;
final String userSecret;
public DisableBrokerageAuthorizationRequestBuilderGenerated(UUID authorizationId, String userId, String userSecret) {
this.authorizationId = authorizationId;
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Build call for disableBrokerageAuthorization
* @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
Confirmation that the connection has been disabled
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return disableBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
/**
* Execute disableBrokerageAuthorization request
* @return BrokerageAuthorizationDisabledConfirmation
* @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
Confirmation that the connection has been disabled
-
*/
public BrokerageAuthorizationDisabledConfirmation execute() throws ApiException {
ApiResponse localVarResp = disableBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
return localVarResp.getResponseBody();
}
/**
* Execute disableBrokerageAuthorization request with HTTP info returned
* @return ApiResponse<BrokerageAuthorizationDisabledConfirmation>
* @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
Confirmation that the connection has been disabled
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return disableBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
}
/**
* Execute disableBrokerageAuthorization 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
Confirmation that the connection has been disabled
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return disableBrokerageAuthorizationAsync(authorizationId, userId, userSecret, _callback);
}
}
/**
* Manually disable a connection for testing
* Manually disable a connection. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a CONNECTION_BROKEN webhook for the connection. Please contact us in order to use this endpoint as it is disabled by default.
* @param authorizationId The ID of a brokerage authorization object. (required)
* @param userId (required)
* @param userSecret (required)
* @return DisableBrokerageAuthorizationRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Confirmation that the connection has been disabled
-
*/
public ConnectionsApi.DisableBrokerageAuthorizationRequestBuilder disableBrokerageAuthorization(UUID authorizationId, String userId, String userSecret) throws IllegalArgumentException {
if (authorizationId == null) throw new IllegalArgumentException("\"authorizationId\" is required but got null");
if (userId == null) throw new IllegalArgumentException("\"userId\" is required but got null");
if (userSecret == null) throw new IllegalArgumentException("\"userSecret\" is required but got null");
return ((ConnectionsApi) this).new DisableBrokerageAuthorizationRequestBuilder(authorizationId, userId, userSecret);
}
private okhttp3.Call listBrokerageAuthorizationsCall(String userId, String userSecret, 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 = "/authorizations";
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 = {
};
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 listBrokerageAuthorizationsValidateBeforeCall(String userId, String userSecret, 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 listBrokerageAuthorizations(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling listBrokerageAuthorizations(Async)");
}
return listBrokerageAuthorizationsCall(userId, userSecret, _callback);
}
private ApiResponse> listBrokerageAuthorizationsWithHttpInfo(String userId, String userSecret) throws ApiException {
okhttp3.Call localVarCall = listBrokerageAuthorizationsValidateBeforeCall(userId, userSecret, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call listBrokerageAuthorizationsAsync(String userId, String userSecret, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listBrokerageAuthorizationsValidateBeforeCall(userId, userSecret, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class ListBrokerageAuthorizationsRequestBuilderGenerated {
final String userId;
final String userSecret;
public ListBrokerageAuthorizationsRequestBuilderGenerated(String userId, String userSecret) {
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Build call for listBrokerageAuthorizations
* @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
A list of all Authorization objects for the authenticated user.
-
0
Unexpected error.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return listBrokerageAuthorizationsCall(userId, userSecret, _callback);
}
/**
* Execute listBrokerageAuthorizations request
* @return List<BrokerageAuthorization>
* @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
A list of all Authorization objects for the authenticated user.
-
0
Unexpected error.
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = listBrokerageAuthorizationsWithHttpInfo(userId, userSecret);
return localVarResp.getResponseBody();
}
/**
* Execute listBrokerageAuthorizations request with HTTP info returned
* @return ApiResponse<List<BrokerageAuthorization>>
* @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
A list of all Authorization objects for the authenticated user.
-
0
Unexpected error.
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return listBrokerageAuthorizationsWithHttpInfo(userId, userSecret);
}
/**
* Execute listBrokerageAuthorizations 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
A list of all Authorization objects for the authenticated user.
-
0
Unexpected error.
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return listBrokerageAuthorizationsAsync(userId, userSecret, _callback);
}
}
/**
* List all brokerage authorizations for the User
* Returns a list of Brokerage Authorization objects for the user
* @param userId (required)
* @param userSecret (required)
* @return ListBrokerageAuthorizationsRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
A list of all Authorization objects for the authenticated user.
-
0
Unexpected error.
-
*/
public ConnectionsApi.ListBrokerageAuthorizationsRequestBuilder listBrokerageAuthorizations(String userId, String userSecret) throws IllegalArgumentException {
if (userId == null) throw new IllegalArgumentException("\"userId\" is required but got null");
if (userSecret == null) throw new IllegalArgumentException("\"userSecret\" is required but got null");
return ((ConnectionsApi) this).new ListBrokerageAuthorizationsRequestBuilder(userId, userSecret);
}
private okhttp3.Call refreshBrokerageAuthorizationCall(UUID authorizationId, String userId, String userSecret, 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 = "/authorizations/{authorizationId}/refresh"
.replace("{" + "authorizationId" + "}", localVarApiClient.escapeString(authorizationId.toString()));
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 = {
};
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 refreshBrokerageAuthorizationValidateBeforeCall(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'authorizationId' is set
if (authorizationId == null) {
throw new ApiException("Missing the required parameter 'authorizationId' when calling refreshBrokerageAuthorization(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling refreshBrokerageAuthorization(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling refreshBrokerageAuthorization(Async)");
}
return refreshBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
private ApiResponse refreshBrokerageAuthorizationWithHttpInfo(UUID authorizationId, String userId, String userSecret) throws ApiException {
okhttp3.Call localVarCall = refreshBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call refreshBrokerageAuthorizationAsync(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = refreshBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class RefreshBrokerageAuthorizationRequestBuilderGenerated {
final UUID authorizationId;
final String userId;
final String userSecret;
public RefreshBrokerageAuthorizationRequestBuilderGenerated(UUID authorizationId, String userId, String userSecret) {
this.authorizationId = authorizationId;
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Build call for refreshBrokerageAuthorization
* @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
Confirmation that the syncs have been scheduled
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return refreshBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
/**
* Execute refreshBrokerageAuthorization request
* @return BrokerageAuthorizationRefreshConfirmation
* @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
Confirmation that the syncs have been scheduled
-
*/
public BrokerageAuthorizationRefreshConfirmation execute() throws ApiException {
ApiResponse localVarResp = refreshBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
return localVarResp.getResponseBody();
}
/**
* Execute refreshBrokerageAuthorization request with HTTP info returned
* @return ApiResponse<BrokerageAuthorizationRefreshConfirmation>
* @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
Confirmation that the syncs have been scheduled
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return refreshBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
}
/**
* Execute refreshBrokerageAuthorization 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
Confirmation that the syncs have been scheduled
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return refreshBrokerageAuthorizationAsync(authorizationId, userId, userSecret, _callback);
}
}
/**
* Refresh holdings for a connection
* Trigger a holdings update for all accounts under this authorization. Updates will be queued asynchronously. ACCOUNT_HOLDINGS_UPDATED webhook will be sent once the sync completes. Please contact support for access as this endpoint is not enabled by default
* @param authorizationId The ID of a brokerage authorization object. (required)
* @param userId (required)
* @param userSecret (required)
* @return RefreshBrokerageAuthorizationRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Confirmation that the syncs have been scheduled
-
*/
public ConnectionsApi.RefreshBrokerageAuthorizationRequestBuilder refreshBrokerageAuthorization(UUID authorizationId, String userId, String userSecret) throws IllegalArgumentException {
if (authorizationId == null) throw new IllegalArgumentException("\"authorizationId\" is required but got null");
if (userId == null) throw new IllegalArgumentException("\"userId\" is required but got null");
if (userSecret == null) throw new IllegalArgumentException("\"userSecret\" is required but got null");
return ((ConnectionsApi) this).new RefreshBrokerageAuthorizationRequestBuilder(authorizationId, userId, userSecret);
}
private okhttp3.Call removeBrokerageAuthorizationCall(UUID authorizationId, String userId, String userSecret, 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 = "/authorizations/{authorizationId}"
.replace("{" + "authorizationId" + "}", localVarApiClient.escapeString(authorizationId.toString()));
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 = {
};
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 removeBrokerageAuthorizationValidateBeforeCall(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'authorizationId' is set
if (authorizationId == null) {
throw new ApiException("Missing the required parameter 'authorizationId' when calling removeBrokerageAuthorization(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling removeBrokerageAuthorization(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling removeBrokerageAuthorization(Async)");
}
return removeBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
private ApiResponse removeBrokerageAuthorizationWithHttpInfo(UUID authorizationId, String userId, String userSecret) throws ApiException {
okhttp3.Call localVarCall = removeBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, null);
return localVarApiClient.execute(localVarCall);
}
private okhttp3.Call removeBrokerageAuthorizationAsync(UUID authorizationId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = removeBrokerageAuthorizationValidateBeforeCall(authorizationId, userId, userSecret, _callback);
localVarApiClient.executeAsync(localVarCall, _callback);
return localVarCall;
}
public abstract class RemoveBrokerageAuthorizationRequestBuilderGenerated {
final UUID authorizationId;
final String userId;
final String userSecret;
public RemoveBrokerageAuthorizationRequestBuilderGenerated(UUID authorizationId, String userId, String userSecret) {
this.authorizationId = authorizationId;
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Build call for removeBrokerageAuthorization
* @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
204
Brokerage authorization object has been successfully deleted
-
400
The specified authorizationId is invalid (not a UUID string).
-
404
The specified authorizationId was not found.
-
0
Unexpected error.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return removeBrokerageAuthorizationCall(authorizationId, userId, userSecret, _callback);
}
/**
* Execute removeBrokerageAuthorization request
* @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
204
Brokerage authorization object has been successfully deleted
-
400
The specified authorizationId is invalid (not a UUID string).
-
404
The specified authorizationId was not found.
-
0
Unexpected error.
-
*/
public void execute() throws ApiException {
removeBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
}
/**
* Execute removeBrokerageAuthorization request with HTTP info returned
* @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
204
Brokerage authorization object has been successfully deleted
-
400
The specified authorizationId is invalid (not a UUID string).
-
404
The specified authorizationId was not found.
-
0
Unexpected error.
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return removeBrokerageAuthorizationWithHttpInfo(authorizationId, userId, userSecret);
}
/**
* Execute removeBrokerageAuthorization 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
204
Brokerage authorization object has been successfully deleted
-
400
The specified authorizationId is invalid (not a UUID string).
-
404
The specified authorizationId was not found.
-
0
Unexpected error.
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return removeBrokerageAuthorizationAsync(authorizationId, userId, userSecret, _callback);
}
}
/**
* Delete brokerage authorization
* Deletes a specified brokerage authorization given by the ID.
* @param authorizationId The ID of the Authorization to delete. (required)
* @param userId (required)
* @param userSecret (required)
* @return RemoveBrokerageAuthorizationRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
204
Brokerage authorization object has been successfully deleted
-
400
The specified authorizationId is invalid (not a UUID string).
-
404
The specified authorizationId was not found.
-
0
Unexpected error.
-
*/
public ConnectionsApi.RemoveBrokerageAuthorizationRequestBuilder removeBrokerageAuthorization(UUID authorizationId, String userId, String userSecret) throws IllegalArgumentException {
if (authorizationId == null) throw new IllegalArgumentException("\"authorizationId\" is required but got null");
if (userId == null) throw new IllegalArgumentException("\"userId\" is required but got null");
if (userSecret == null) throw new IllegalArgumentException("\"userSecret\" is required but got null");
return ((ConnectionsApi) this).new RemoveBrokerageAuthorizationRequestBuilder(authorizationId, userId, userSecret);
}
private okhttp3.Call sessionEventsCall(String partnerClientId, String userId, String sessionId, 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 = "/sessionEvents";
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (partnerClientId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("PartnerClientId", partnerClientId));
}
if (userId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId));
}
if (sessionId != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("sessionId", sessionId));
}
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 sessionEventsValidateBeforeCall(String partnerClientId, String userId, String sessionId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'partnerClientId' is set
if (partnerClientId == null) {
throw new ApiException("Missing the required parameter 'partnerClientId' when calling sessionEvents(Async)");
}
return sessionEventsCall(partnerClientId, userId, sessionId, _callback);
}
private ApiResponse> sessionEventsWithHttpInfo(String partnerClientId, String userId, String sessionId) throws ApiException {
okhttp3.Call localVarCall = sessionEventsValidateBeforeCall(partnerClientId, userId, sessionId, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call sessionEventsAsync(String partnerClientId, String userId, String sessionId, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = sessionEventsValidateBeforeCall(partnerClientId, userId, sessionId, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class SessionEventsRequestBuilderGenerated {
final String partnerClientId;
String userId;
String sessionId;
public SessionEventsRequestBuilderGenerated(String partnerClientId) {
this.partnerClientId = partnerClientId;
}
/**
* Set userId
* @param userId Optional comma separated list of user IDs used to filter the request on specific users (optional)
* @return ConnectionsApi.SessionEventsRequestBuilder
*/
public ConnectionsApi.SessionEventsRequestBuilder userId(String userId) {
this.userId = userId;
return (ConnectionsApi.SessionEventsRequestBuilder) this;
}
/**
* Set sessionId
* @param sessionId Optional comma separated list of session IDs used to filter the request on specific users (optional)
* @return ConnectionsApi.SessionEventsRequestBuilder
*/
public ConnectionsApi.SessionEventsRequestBuilder sessionId(String sessionId) {
this.sessionId = sessionId;
return (ConnectionsApi.SessionEventsRequestBuilder) this;
}
/**
* Build call for sessionEvents
* @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
A list of all Session Events for the Partner.
-
0
Unexpected error.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return sessionEventsCall(partnerClientId, userId, sessionId, _callback);
}
/**
* Execute sessionEvents request
* @return List<SessionEvent>
* @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
A list of all Session Events for the Partner.
-
0
Unexpected error.
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = sessionEventsWithHttpInfo(partnerClientId, userId, sessionId);
return localVarResp.getResponseBody();
}
/**
* Execute sessionEvents request with HTTP info returned
* @return ApiResponse<List<SessionEvent>>
* @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
A list of all Session Events for the Partner.
-
0
Unexpected error.
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return sessionEventsWithHttpInfo(partnerClientId, userId, sessionId);
}
/**
* Execute sessionEvents 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
A list of all Session Events for the Partner.
-
0
Unexpected error.
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return sessionEventsAsync(partnerClientId, userId, sessionId, _callback);
}
}
/**
* Get all session events for a user
* Returns a list of session events associated with a user.
* @param partnerClientId (required)
* @return SessionEventsRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
A list of all Session Events for the Partner.
-
0
Unexpected error.
-
*/
public ConnectionsApi.SessionEventsRequestBuilder sessionEvents(String partnerClientId) throws IllegalArgumentException {
if (partnerClientId == null) throw new IllegalArgumentException("\"partnerClientId\" is required but got null");
return ((ConnectionsApi) this).new SessionEventsRequestBuilder(partnerClientId);
}
}