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.Account;
import com.konfigthis.client.model.AccountHoldings;
import com.konfigthis.client.model.AccountHoldingsAccount;
import com.konfigthis.client.model.AccountOrderRecord;
import com.konfigthis.client.model.Balance;
import com.konfigthis.client.model.Position;
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 AccountInformationApiGenerated {
private ApiClient localVarApiClient;
private int localHostIndex;
private String localCustomBaseUrl;
public AccountInformationApiGenerated() throws IllegalArgumentException {
this(Configuration.getDefaultApiClient());
}
public AccountInformationApiGenerated(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 getAllUserHoldingsCall(String userId, String userSecret, UUID brokerageAuthorizations, 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 = "/holdings";
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));
}
if (brokerageAuthorizations != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("brokerage_authorizations", brokerageAuthorizations));
}
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);
}
@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call getAllUserHoldingsValidateBeforeCall(String userId, String userSecret, UUID brokerageAuthorizations, 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 getAllUserHoldings(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling getAllUserHoldings(Async)");
}
return getAllUserHoldingsCall(userId, userSecret, brokerageAuthorizations, _callback);
}
private ApiResponse> getAllUserHoldingsWithHttpInfo(String userId, String userSecret, UUID brokerageAuthorizations) throws ApiException {
okhttp3.Call localVarCall = getAllUserHoldingsValidateBeforeCall(userId, userSecret, brokerageAuthorizations, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getAllUserHoldingsAsync(String userId, String userSecret, UUID brokerageAuthorizations, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getAllUserHoldingsValidateBeforeCall(userId, userSecret, brokerageAuthorizations, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class GetAllUserHoldingsRequestBuilderGenerated {
final String userId;
final String userSecret;
UUID brokerageAuthorizations;
public GetAllUserHoldingsRequestBuilderGenerated(String userId, String userSecret) {
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Set brokerageAuthorizations
* @param brokerageAuthorizations Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)
* @return AccountInformationApi.GetAllUserHoldingsRequestBuilder
*/
public AccountInformationApi.GetAllUserHoldingsRequestBuilder brokerageAuthorizations(UUID brokerageAuthorizations) {
this.brokerageAuthorizations = brokerageAuthorizations;
return (AccountInformationApi.GetAllUserHoldingsRequestBuilder) this;
}
/**
* Build call for getAllUserHoldings
* @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
Returns list of accounts and holdings
-
500
Unexpected Error
-
* @deprecated
*/
@Deprecated
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getAllUserHoldingsCall(userId, userSecret, brokerageAuthorizations, _callback);
}
/**
* Execute getAllUserHoldings request
* @return List<AccountHoldings>
* @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
Returns list of accounts and holdings
-
500
Unexpected Error
-
* @deprecated
*/
@Deprecated
public List execute() throws ApiException {
ApiResponse> localVarResp = getAllUserHoldingsWithHttpInfo(userId, userSecret, brokerageAuthorizations);
return localVarResp.getResponseBody();
}
/**
* Execute getAllUserHoldings request with HTTP info returned
* @return ApiResponse<List<AccountHoldings>>
* @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
Returns list of accounts and holdings
-
500
Unexpected Error
-
* @deprecated
*/
@Deprecated
public ApiResponse> executeWithHttpInfo() throws ApiException {
return getAllUserHoldingsWithHttpInfo(userId, userSecret, brokerageAuthorizations);
}
/**
* Execute getAllUserHoldings 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
Returns list of accounts and holdings
-
500
Unexpected Error
-
* @deprecated
*/
@Deprecated
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return getAllUserHoldingsAsync(userId, userSecret, brokerageAuthorizations, _callback);
}
}
/**
* List all accounts for the user, plus balances, positions, and orders for each account.
* **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account.
* @param userId (required)
* @param userSecret (required)
* @return GetAllUserHoldingsRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Returns list of accounts and holdings
-
500
Unexpected Error
-
* @deprecated
*/
@Deprecated
public AccountInformationApi.GetAllUserHoldingsRequestBuilder getAllUserHoldings(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 ((AccountInformationApi) this).new GetAllUserHoldingsRequestBuilder(userId, userSecret);
}
private okhttp3.Call getUserAccountBalanceCall(String userId, String userSecret, UUID accountId, 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 = "/accounts/{accountId}/balances"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.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 getUserAccountBalanceValidateBeforeCall(String userId, String userSecret, UUID accountId, 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 getUserAccountBalance(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling getUserAccountBalance(Async)");
}
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling getUserAccountBalance(Async)");
}
return getUserAccountBalanceCall(userId, userSecret, accountId, _callback);
}
private ApiResponse> getUserAccountBalanceWithHttpInfo(String userId, String userSecret, UUID accountId) throws ApiException {
okhttp3.Call localVarCall = getUserAccountBalanceValidateBeforeCall(userId, userSecret, accountId, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getUserAccountBalanceAsync(String userId, String userSecret, UUID accountId, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getUserAccountBalanceValidateBeforeCall(userId, userSecret, accountId, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class GetUserAccountBalanceRequestBuilderGenerated {
final String userId;
final String userSecret;
final UUID accountId;
public GetUserAccountBalanceRequestBuilderGenerated(String userId, String userSecret, UUID accountId) {
this.userId = userId;
this.userSecret = userSecret;
this.accountId = accountId;
}
/**
* Build call for getUserAccountBalance
* @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
-
0
Unexpected error
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getUserAccountBalanceCall(userId, userSecret, accountId, _callback);
}
/**
* Execute getUserAccountBalance request
* @return List<Balance>
* @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
-
0
Unexpected error
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = getUserAccountBalanceWithHttpInfo(userId, userSecret, accountId);
return localVarResp.getResponseBody();
}
/**
* Execute getUserAccountBalance request with HTTP info returned
* @return ApiResponse<List<Balance>>
* @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
-
0
Unexpected error
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return getUserAccountBalanceWithHttpInfo(userId, userSecret, accountId);
}
/**
* Execute getUserAccountBalance 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
-
0
Unexpected error
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return getUserAccountBalanceAsync(userId, userSecret, accountId, _callback);
}
}
/**
* List account balances
* Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
* @param userId (required)
* @param userSecret (required)
* @param accountId (required)
* @return GetUserAccountBalanceRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
0
Unexpected error
-
*/
public AccountInformationApi.GetUserAccountBalanceRequestBuilder getUserAccountBalance(String userId, String userSecret, UUID accountId) 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");
if (accountId == null) throw new IllegalArgumentException("\"accountId\" is required but got null");
return ((AccountInformationApi) this).new GetUserAccountBalanceRequestBuilder(userId, userSecret, accountId);
}
private okhttp3.Call getUserAccountDetailsCall(String userId, String userSecret, UUID accountId, 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 = "/accounts/{accountId}"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.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 getUserAccountDetailsValidateBeforeCall(String userId, String userSecret, UUID accountId, 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 getUserAccountDetails(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling getUserAccountDetails(Async)");
}
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling getUserAccountDetails(Async)");
}
return getUserAccountDetailsCall(userId, userSecret, accountId, _callback);
}
private ApiResponse getUserAccountDetailsWithHttpInfo(String userId, String userSecret, UUID accountId) throws ApiException {
okhttp3.Call localVarCall = getUserAccountDetailsValidateBeforeCall(userId, userSecret, accountId, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getUserAccountDetailsAsync(String userId, String userSecret, UUID accountId, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getUserAccountDetailsValidateBeforeCall(userId, userSecret, accountId, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class GetUserAccountDetailsRequestBuilderGenerated {
final String userId;
final String userSecret;
final UUID accountId;
public GetUserAccountDetailsRequestBuilderGenerated(String userId, String userSecret, UUID accountId) {
this.userId = userId;
this.userSecret = userSecret;
this.accountId = accountId;
}
/**
* Build call for getUserAccountDetails
* @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
-
0
Unexpected error
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getUserAccountDetailsCall(userId, userSecret, accountId, _callback);
}
/**
* Execute getUserAccountDetails request
* @return Account
* @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
-
0
Unexpected error
-
*/
public Account execute() throws ApiException {
ApiResponse localVarResp = getUserAccountDetailsWithHttpInfo(userId, userSecret, accountId);
return localVarResp.getResponseBody();
}
/**
* Execute getUserAccountDetails request with HTTP info returned
* @return ApiResponse<Account>
* @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
-
0
Unexpected error
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return getUserAccountDetailsWithHttpInfo(userId, userSecret, accountId);
}
/**
* Execute getUserAccountDetails 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
-
0
Unexpected error
-
*/
public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException {
return getUserAccountDetailsAsync(userId, userSecret, accountId, _callback);
}
}
/**
* Get account detail
* Returns account detail known to SnapTrade for the specified account. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
* @param userId (required)
* @param userSecret (required)
* @param accountId (required)
* @return GetUserAccountDetailsRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
0
Unexpected error
-
*/
public AccountInformationApi.GetUserAccountDetailsRequestBuilder getUserAccountDetails(String userId, String userSecret, UUID accountId) 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");
if (accountId == null) throw new IllegalArgumentException("\"accountId\" is required but got null");
return ((AccountInformationApi) this).new GetUserAccountDetailsRequestBuilder(userId, userSecret, accountId);
}
private okhttp3.Call getUserAccountOrdersCall(String userId, String userSecret, UUID accountId, String state, Integer days, 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 = "/accounts/{accountId}/orders"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.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));
}
if (state != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("state", state));
}
if (days != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("days", days));
}
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 getUserAccountOrdersValidateBeforeCall(String userId, String userSecret, UUID accountId, String state, Integer days, 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 getUserAccountOrders(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling getUserAccountOrders(Async)");
}
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling getUserAccountOrders(Async)");
}
return getUserAccountOrdersCall(userId, userSecret, accountId, state, days, _callback);
}
private ApiResponse> getUserAccountOrdersWithHttpInfo(String userId, String userSecret, UUID accountId, String state, Integer days) throws ApiException {
okhttp3.Call localVarCall = getUserAccountOrdersValidateBeforeCall(userId, userSecret, accountId, state, days, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getUserAccountOrdersAsync(String userId, String userSecret, UUID accountId, String state, Integer days, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getUserAccountOrdersValidateBeforeCall(userId, userSecret, accountId, state, days, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class GetUserAccountOrdersRequestBuilderGenerated {
final String userId;
final String userSecret;
final UUID accountId;
String state;
Integer days;
public GetUserAccountOrdersRequestBuilderGenerated(String userId, String userSecret, UUID accountId) {
this.userId = userId;
this.userSecret = userSecret;
this.accountId = accountId;
}
/**
* Set state
* @param state defaults value is set to \"all\" (optional)
* @return AccountInformationApi.GetUserAccountOrdersRequestBuilder
*/
public AccountInformationApi.GetUserAccountOrdersRequestBuilder state(String state) {
this.state = state;
return (AccountInformationApi.GetUserAccountOrdersRequestBuilder) this;
}
/**
* Set days
* @param days Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. (optional)
* @return AccountInformationApi.GetUserAccountOrdersRequestBuilder
*/
public AccountInformationApi.GetUserAccountOrdersRequestBuilder days(Integer days) {
this.days = days;
return (AccountInformationApi.GetUserAccountOrdersRequestBuilder) this;
}
/**
* Build call for getUserAccountOrders
* @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 getUserAccountOrdersCall(userId, userSecret, accountId, state, days, _callback);
}
/**
* Execute getUserAccountOrders request
* @return List<AccountOrderRecord>
* @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 = getUserAccountOrdersWithHttpInfo(userId, userSecret, accountId, state, days);
return localVarResp.getResponseBody();
}
/**
* Execute getUserAccountOrders request with HTTP info returned
* @return ApiResponse<List<AccountOrderRecord>>
* @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 getUserAccountOrdersWithHttpInfo(userId, userSecret, accountId, state, days);
}
/**
* Execute getUserAccountOrders 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 getUserAccountOrdersAsync(userId, userSecret, accountId, state, days, _callback);
}
}
/**
* List account recent orders
* Returns a list of recent orders in the specified account. The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
* @param userId (required)
* @param userSecret (required)
* @param accountId (required)
* @return GetUserAccountOrdersRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
*/
public AccountInformationApi.GetUserAccountOrdersRequestBuilder getUserAccountOrders(String userId, String userSecret, UUID accountId) 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");
if (accountId == null) throw new IllegalArgumentException("\"accountId\" is required but got null");
return ((AccountInformationApi) this).new GetUserAccountOrdersRequestBuilder(userId, userSecret, accountId);
}
private okhttp3.Call getUserAccountPositionsCall(String userId, String userSecret, UUID accountId, 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 = "/accounts/{accountId}/positions"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.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 getUserAccountPositionsValidateBeforeCall(String userId, String userSecret, UUID accountId, 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 getUserAccountPositions(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling getUserAccountPositions(Async)");
}
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling getUserAccountPositions(Async)");
}
return getUserAccountPositionsCall(userId, userSecret, accountId, _callback);
}
private ApiResponse> getUserAccountPositionsWithHttpInfo(String userId, String userSecret, UUID accountId) throws ApiException {
okhttp3.Call localVarCall = getUserAccountPositionsValidateBeforeCall(userId, userSecret, accountId, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getUserAccountPositionsAsync(String userId, String userSecret, UUID accountId, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = getUserAccountPositionsValidateBeforeCall(userId, userSecret, accountId, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class GetUserAccountPositionsRequestBuilderGenerated {
final String userId;
final String userSecret;
final UUID accountId;
public GetUserAccountPositionsRequestBuilderGenerated(String userId, String userSecret, UUID accountId) {
this.userId = userId;
this.userSecret = userSecret;
this.accountId = accountId;
}
/**
* Build call for getUserAccountPositions
* @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
-
0
Unexpected error
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return getUserAccountPositionsCall(userId, userSecret, accountId, _callback);
}
/**
* Execute getUserAccountPositions request
* @return List<Position>
* @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
-
0
Unexpected error
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = getUserAccountPositionsWithHttpInfo(userId, userSecret, accountId);
return localVarResp.getResponseBody();
}
/**
* Execute getUserAccountPositions request with HTTP info returned
* @return ApiResponse<List<Position>>
* @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
-
0
Unexpected error
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return getUserAccountPositionsWithHttpInfo(userId, userSecret, accountId);
}
/**
* Execute getUserAccountPositions 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
-
0
Unexpected error
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return getUserAccountPositionsAsync(userId, userSecret, accountId, _callback);
}
}
/**
* List account positions
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
* @param userId (required)
* @param userSecret (required)
* @param accountId (required)
* @return GetUserAccountPositionsRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
0
Unexpected error
-
*/
public AccountInformationApi.GetUserAccountPositionsRequestBuilder getUserAccountPositions(String userId, String userSecret, UUID accountId) 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");
if (accountId == null) throw new IllegalArgumentException("\"accountId\" is required but got null");
return ((AccountInformationApi) this).new GetUserAccountPositionsRequestBuilder(userId, userSecret, accountId);
}
private okhttp3.Call getUserHoldingsCall(UUID accountId, 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 = "/accounts/{accountId}/holdings"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.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 getUserHoldingsValidateBeforeCall(UUID accountId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling getUserHoldings(Async)");
}
// verify the required parameter 'userId' is set
if (userId == null) {
throw new ApiException("Missing the required parameter 'userId' when calling getUserHoldings(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling getUserHoldings(Async)");
}
return getUserHoldingsCall(accountId, userId, userSecret, _callback);
}
private ApiResponse getUserHoldingsWithHttpInfo(UUID accountId, String userId, String userSecret) throws ApiException {
okhttp3.Call localVarCall = getUserHoldingsValidateBeforeCall(accountId, userId, userSecret, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call getUserHoldingsAsync(UUID accountId, String userId, String userSecret, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getUserHoldingsValidateBeforeCall(accountId, userId, userSecret, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class GetUserHoldingsRequestBuilderGenerated {
final UUID accountId;
final String userId;
final String userSecret;
public GetUserHoldingsRequestBuilderGenerated(UUID accountId, String userId, String userSecret) {
this.accountId = accountId;
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Build call for getUserHoldings
* @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 getUserHoldingsCall(accountId, userId, userSecret, _callback);
}
/**
* Execute getUserHoldings request
* @return AccountHoldingsAccount
* @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 AccountHoldingsAccount execute() throws ApiException {
ApiResponse localVarResp = getUserHoldingsWithHttpInfo(accountId, userId, userSecret);
return localVarResp.getResponseBody();
}
/**
* Execute getUserHoldings request with HTTP info returned
* @return ApiResponse<AccountHoldingsAccount>
* @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 getUserHoldingsWithHttpInfo(accountId, userId, userSecret);
}
/**
* Execute getUserHoldings 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 getUserHoldingsAsync(accountId, userId, userSecret, _callback);
}
}
/**
* List account holdings
* Returns a list of balances, positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
* @param accountId (required)
* @param userId (required)
* @param userSecret (required)
* @return GetUserHoldingsRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
500
Unexpected Error
-
*/
public AccountInformationApi.GetUserHoldingsRequestBuilder getUserHoldings(UUID accountId, String userId, String userSecret) throws IllegalArgumentException {
if (accountId == null) throw new IllegalArgumentException("\"accountId\" 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 ((AccountInformationApi) this).new GetUserHoldingsRequestBuilder(accountId, userId, userSecret);
}
private okhttp3.Call listUserAccountsCall(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 = "/accounts";
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 listUserAccountsValidateBeforeCall(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 listUserAccounts(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling listUserAccounts(Async)");
}
return listUserAccountsCall(userId, userSecret, _callback);
}
private ApiResponse> listUserAccountsWithHttpInfo(String userId, String userSecret) throws ApiException {
okhttp3.Call localVarCall = listUserAccountsValidateBeforeCall(userId, userSecret, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call listUserAccountsAsync(String userId, String userSecret, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = listUserAccountsValidateBeforeCall(userId, userSecret, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class ListUserAccountsRequestBuilderGenerated {
final String userId;
final String userSecret;
public ListUserAccountsRequestBuilderGenerated(String userId, String userSecret) {
this.userId = userId;
this.userSecret = userSecret;
}
/**
* Build call for listUserAccounts
* @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
-
0
Unexpected error.
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return listUserAccountsCall(userId, userSecret, _callback);
}
/**
* Execute listUserAccounts request
* @return List<Account>
* @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
-
0
Unexpected error.
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = listUserAccountsWithHttpInfo(userId, userSecret);
return localVarResp.getResponseBody();
}
/**
* Execute listUserAccounts request with HTTP info returned
* @return ApiResponse<List<Account>>
* @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
-
0
Unexpected error.
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return listUserAccountsWithHttpInfo(userId, userSecret);
}
/**
* Execute listUserAccounts 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
-
0
Unexpected error.
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return listUserAccountsAsync(userId, userSecret, _callback);
}
}
/**
* List accounts
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. The data returned here is always cached and refreshed once a day. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
* @param userId (required)
* @param userSecret (required)
* @return ListUserAccountsRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
OK
-
0
Unexpected error.
-
*/
public AccountInformationApi.ListUserAccountsRequestBuilder listUserAccounts(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 ((AccountInformationApi) this).new ListUserAccountsRequestBuilder(userId, userSecret);
}
private okhttp3.Call updateUserAccountCall(String userId, String userSecret, UUID accountId, 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 = "/accounts/{accountId}"
.replace("{" + "accountId" + "}", localVarApiClient.escapeString(accountId.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, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call updateUserAccountValidateBeforeCall(String userId, String userSecret, UUID accountId, 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 updateUserAccount(Async)");
}
// verify the required parameter 'userSecret' is set
if (userSecret == null) {
throw new ApiException("Missing the required parameter 'userSecret' when calling updateUserAccount(Async)");
}
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException("Missing the required parameter 'accountId' when calling updateUserAccount(Async)");
}
return updateUserAccountCall(userId, userSecret, accountId, _callback);
}
private ApiResponse> updateUserAccountWithHttpInfo(String userId, String userSecret, UUID accountId) throws ApiException {
okhttp3.Call localVarCall = updateUserAccountValidateBeforeCall(userId, userSecret, accountId, null);
Type localVarReturnType = new TypeToken>(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
private okhttp3.Call updateUserAccountAsync(String userId, String userSecret, UUID accountId, final ApiCallback> _callback) throws ApiException {
okhttp3.Call localVarCall = updateUserAccountValidateBeforeCall(userId, userSecret, accountId, _callback);
Type localVarReturnType = new TypeToken>(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
public abstract class UpdateUserAccountRequestBuilderGenerated {
final String userId;
final String userSecret;
final UUID accountId;
public UpdateUserAccountRequestBuilderGenerated(String userId, String userSecret, UUID accountId) {
this.userId = userId;
this.userSecret = userSecret;
this.accountId = accountId;
}
/**
* Build call for updateUserAccount
* @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
Successfully updated details of an investment account
-
0
Unexpected error
-
*/
public okhttp3.Call buildCall(final ApiCallback _callback) throws ApiException {
return updateUserAccountCall(userId, userSecret, accountId, _callback);
}
/**
* Execute updateUserAccount request
* @return List<Account>
* @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 updated details of an investment account
-
0
Unexpected error
-
*/
public List execute() throws ApiException {
ApiResponse> localVarResp = updateUserAccountWithHttpInfo(userId, userSecret, accountId);
return localVarResp.getResponseBody();
}
/**
* Execute updateUserAccount request with HTTP info returned
* @return ApiResponse<List<Account>>
* @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 updated details of an investment account
-
0
Unexpected error
-
*/
public ApiResponse> executeWithHttpInfo() throws ApiException {
return updateUserAccountWithHttpInfo(userId, userSecret, accountId);
}
/**
* Execute updateUserAccount 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
Successfully updated details of an investment account
-
0
Unexpected error
-
*/
public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException {
return updateUserAccountAsync(userId, userSecret, accountId, _callback);
}
}
/**
* Update details of an investment account
* Updates various properties of a specified account.
* @param userId (required)
* @param userSecret (required)
* @param accountId The ID of the account to update. (required)
* @return UpdateUserAccountRequestBuilder
* @http.response.details
Status Code
Description
Response Headers
200
Successfully updated details of an investment account
-
0
Unexpected error
-
*/
public AccountInformationApi.UpdateUserAccountRequestBuilder updateUserAccount(String userId, String userSecret, UUID accountId) 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");
if (accountId == null) throw new IllegalArgumentException("\"accountId\" is required but got null");
return ((AccountInformationApi) this).new UpdateUserAccountRequestBuilder(userId, userSecret, accountId);
}
}