All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.konfigthis.client.api.ConnectionsApiGenerated Maven / Gradle / Ivy

Go to download

Connect brokerage accounts to your app for live positions and trading This library was generated by https://konfigthis.com

There is a newer version: 5.0.55
Show newest version
/*
 * 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.RateOfReturnResponse;
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 OK -
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 OK -
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 OK -
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 OK -
0 Unexpected error. -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return detailBrokerageAuthorizationAsync(authorizationId, userId, userSecret, _callback); } } /** * Get connection detail * Returns a single connection for the specified ID. * @param authorizationId (required) * @param userId (required) * @param userSecret (required) * @return DetailBrokerageAuthorizationRequestBuilder * @http.response.details
Status Code Description Response Headers
200 OK -
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 OK -
*/ 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 OK -
*/ 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 OK -
*/ 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 OK -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return disableBrokerageAuthorizationAsync(authorizationId, userId, userSecret, _callback); } } /** * Force disable connection * Manually force the specified connection to become disabled. 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](/docs/webhooks#webhooks-connection_broken) for the connection. *Please contact us in order to use this endpoint as it is disabled by default.* * @param authorizationId (required) * @param userId (required) * @param userSecret (required) * @return DisableBrokerageAuthorizationRequestBuilder * @http.response.details
Status Code Description Response Headers
200 OK -
*/ 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 OK -
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 OK -
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 OK -
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 OK -
0 Unexpected error. -
*/ public okhttp3.Call executeAsync(final ApiCallback> _callback) throws ApiException { return listBrokerageAuthorizationsAsync(userId, userSecret, _callback); } } /** * List all connections * Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency. A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts. SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one. * @param userId (required) * @param userSecret (required) * @return ListBrokerageAuthorizationsRequestBuilder * @http.response.details
Status Code Description Response Headers
200 OK -
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 OK -
*/ 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 OK -
*/ 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 OK -
*/ 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 OK -
*/ 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 connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. *Please contact support for access as this endpoint is not enabled by default.* * @param authorizationId (required) * @param userId (required) * @param userSecret (required) * @return RefreshBrokerageAuthorizationRequestBuilder * @http.response.details
Status Code Description Response Headers
200 OK -
*/ 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 OK -
400 Bad Request -
404 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 OK -
400 Bad Request -
404 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 OK -
400 Bad Request -
404 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 OK -
400 Bad Request -
404 Not Found -
0 Unexpected error -
*/ public okhttp3.Call executeAsync(final ApiCallback _callback) throws ApiException { return removeBrokerageAuthorizationAsync(authorizationId, userId, userSecret, _callback); } } /** * Delete connection * Deletes the connection specified by the ID. This will also delete all accounts and holdings associated with the connection. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the connection has been successfully deleted. * @param authorizationId (required) * @param userId (required) * @param userSecret (required) * @return RemoveBrokerageAuthorizationRequestBuilder * @http.response.details
Status Code Description Response Headers
204 OK -
400 Bad Request -
404 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 returnRatesCall(String userId, String userSecret, UUID authorizationId, 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}/returnRates" .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 returnRatesValidateBeforeCall(String userId, String userSecret, UUID authorizationId, 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 returnRates(Async)"); } // verify the required parameter 'userSecret' is set if (userSecret == null) { throw new ApiException("Missing the required parameter 'userSecret' when calling returnRates(Async)"); } // verify the required parameter 'authorizationId' is set if (authorizationId == null) { throw new ApiException("Missing the required parameter 'authorizationId' when calling returnRates(Async)"); } return returnRatesCall(userId, userSecret, authorizationId, _callback); } private ApiResponse returnRatesWithHttpInfo(String userId, String userSecret, UUID authorizationId) throws ApiException { okhttp3.Call localVarCall = returnRatesValidateBeforeCall(userId, userSecret, authorizationId, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } private okhttp3.Call returnRatesAsync(String userId, String userSecret, UUID authorizationId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = returnRatesValidateBeforeCall(userId, userSecret, authorizationId, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } public abstract class ReturnRatesRequestBuilderGenerated { final String userId; final String userSecret; final UUID authorizationId; public ReturnRatesRequestBuilderGenerated(String userId, String userSecret, UUID authorizationId) { this.userId = userId; this.userSecret = userSecret; this.authorizationId = authorizationId; } /** * Build call for returnRates * @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 returnRatesCall(userId, userSecret, authorizationId, _callback); } /** * Execute returnRates request * @return RateOfReturnResponse * @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 RateOfReturnResponse execute() throws ApiException { ApiResponse localVarResp = returnRatesWithHttpInfo(userId, userSecret, authorizationId); return localVarResp.getResponseBody(); } /** * Execute returnRates request with HTTP info returned * @return ApiResponse<RateOfReturnResponse> * @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 returnRatesWithHttpInfo(userId, userSecret, authorizationId); } /** * Execute returnRates 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 returnRatesAsync(userId, userSecret, authorizationId, _callback); } } /** * List connection rate of returns * Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example \"ALL\", \"1Y\", \"6M\", \"3M\", \"1M\" * @param userId (required) * @param userSecret (required) * @param authorizationId (required) * @return ReturnRatesRequestBuilder * @http.response.details
Status Code Description Response Headers
200 OK -
*/ public ConnectionsApi.ReturnRatesRequestBuilder returnRates(String userId, String userSecret, UUID authorizationId) 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 (authorizationId == null) throw new IllegalArgumentException("\"authorizationId\" is required but got null"); return ((ConnectionsApi) this).new ReturnRatesRequestBuilder(userId, userSecret, authorizationId); } 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); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy