sdks/java/src/test/java/com/konfigthis/client/api/PortfolioManagementApiTest.java
<gh_stars>0/*
 * SnapTrade
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: envkt@example.com
 *
 * 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.ApiException;
import com.konfigthis.client.ApiClient;
import com.konfigthis.client.ApiException;
import com.konfigthis.client.Configuration;
import com.konfigthis.client.model.Account;
import com.konfigthis.client.model.Balance;
import com.konfigthis.client.model.CalculatedTrade;
import com.konfigthis.client.model.Currency;
import com.konfigthis.client.model.Exchange;
import com.konfigthis.client.model.ExcludedAsset;
import com.konfigthis.client.model.ModelAssetClass;
import com.konfigthis.client.model.ModelAssetClassDetails;
import com.konfigthis.client.model.ModelAssetClassTarget;
import com.konfigthis.client.model.ModelPortfolio;
import com.konfigthis.client.model.ModelPortfolioAssetClass;
import com.konfigthis.client.model.ModelPortfolioDetails;
import com.konfigthis.client.model.ModelPortfolioSecurity;
import com.konfigthis.client.model.PortfolioGroup;
import com.konfigthis.client.model.PortfolioGroupInfo;
import com.konfigthis.client.model.PortfolioGroupSettings;
import com.konfigthis.client.model.SecurityType;
import com.konfigthis.client.model.SymbolQuery;
import com.konfigthis.client.model.TargetAsset;
import com.konfigthis.client.model.Trade;
import java.util.UUID;
import com.konfigthis.client.model.UniversalSymbol;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.BeforeAll;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * API tests for PortfolioManagementApi
 */
@Disabled
public class PortfolioManagementApiTest {

    private static PortfolioManagementApi api;

    
    @BeforeAll
    public static void beforeClass() {
        ApiClient apiClient = Configuration.getDefaultApiClient();
        api = new PortfolioManagementApi(apiClient);
    }

    /**
     * Adds an asset to exclude to a portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void addPortfolioExcludedAssetTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID id = null;
        String symbol = null;
        String rawSymbol = null;
        String description = null;
        Currency currency = null;
        Exchange exchange = null;
        SecurityType type = null;
        List<Currency> currencies = null;
        ExcludedAsset response = api.addPortfolioExcludedAsset(portfolioGroupId)
                .id(id)
                .symbol(symbol)
                .rawSymbol(rawSymbol)
                .description(description)
                .currency(currency)
                .exchange(exchange)
                .type(type)
                .currencies(currencies)
                .execute();
        // TODO: test validations
    }

    /**
     * Create new portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void createTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        UUID id = null;
        String name = null;
        List<PortfolioGroup> response = api.create(userId, userSecret)
                .id(id)
                .name(name)
                .execute();
        // TODO: test validations
    }

    /**
     * Create a new model asset class
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void createAssetClassTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        ModelAssetClassDetails response = api.createAssetClass(userId, userSecret)
                .execute();
        // TODO: test validations
    }

    /**
     * Creates a new model portfolio
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void createModelPortfolioTest() throws ApiException {
        ModelPortfolioDetails response = api.createModelPortfolio()
                .execute();
        // TODO: test validations
    }

    /**
     * Deletes a model asset class
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void deleteAssetClassTest() throws ApiException {
        UUID modelAssetClassId = null;
        api.deleteAssetClass(modelAssetClassId)
                .execute();
        // TODO: test validations
    }

    /**
     * Unexclude an asset from a portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void deleteExcludedAssetTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID symbolId = null;
        api.deleteExcludedAsset(portfolioGroupId, symbolId)
                .execute();
        // TODO: test validations
    }

    /**
     * Deletes a model portfolio
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void deleteModelPortfolioByIdTest() throws ApiException {
        UUID modelPortfolioId = null;
        api.deleteModelPortfolioById(modelPortfolioId)
                .execute();
        // TODO: test validations
    }

    /**
     * Remove a target portfolio.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void deletePortfoliTest() throws ApiException {
        UUID portfolioGroupId = null;
        PortfolioGroup response = api.deletePortfoli(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Remove a TargetAsset.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void deletePortfolioTargetByIdTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID targetAssetId = null;
        TargetAsset response = api.deletePortfolioTargetById(portfolioGroupId, targetAssetId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get details of a model asset class
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void detailAssetClassTest() throws ApiException {
        UUID modelAssetClassId = null;
        String userId = null;
        String userSecret = null;
        ModelAssetClassDetails response = api.detailAssetClass(modelAssetClassId, userId, userSecret)
                .execute();
        // TODO: test validations
    }

    /**
     * Return an individual trade
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getCalculatedTradeByIdTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID calculatedTradeId = null;
        UUID tradeId = null;
        List<Trade> response = api.getCalculatedTradeById(portfolioGroupId, calculatedTradeId, tradeId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get details of a model portfolio
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getModelDetailsByIdTest() throws ApiException {
        UUID modelPortfolioId = null;
        ModelPortfolioDetails response = api.getModelDetailsById(modelPortfolioId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get sum of cash balances in portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPortfolioBalancesTest() throws ApiException {
        UUID portfolioGroupId = null;
        List<Balance> response = api.getPortfolioBalances(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get details of a target portfolio
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPortfolioDetailsByIdTest() throws ApiException {
        UUID portfolioGroupId = null;
        PortfolioGroup response = api.getPortfolioDetailsById(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Return a whole bunch of relevant information relating to a portfolio group.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPortfolioInfoTest() throws ApiException {
        UUID portfolioGroupId = null;
        PortfolioGroupInfo response = api.getPortfolioInfo(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get portfolio group settings
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPortfolioSettingsTest() throws ApiException {
        UUID portfolioGroupId = null;
        PortfolioGroupSettings response = api.getPortfolioSettings(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get a specific target from a portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPortfolioTargetByIdTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID targetAssetId = null;
        TargetAsset response = api.getPortfolioTargetById(portfolioGroupId, targetAssetId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get all target assets under the specified PortfolioGroup.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPortfolioTargetsTest() throws ApiException {
        UUID portfolioGroupId = null;
        List<TargetAsset> response = api.getPortfolioTargets(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get an array of excluded assets associated with a portfolio group\\
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getPortoflioExcludedAssetsTest() throws ApiException {
        UUID portfolioGroupId = null;
        List<ExcludedAsset> response = api.getPortoflioExcludedAssets(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Import target allocation based on portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void importModelPortfolioTest() throws ApiException {
        UUID portfolioGroupId = null;
        List<TargetAsset> response = api.importModelPortfolio(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * List all portfolio groups
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void listTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        List<PortfolioGroup> response = api.list(userId, userSecret)
                .execute();
        // TODO: test validations
    }

    /**
     * List of model asset class
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void listAssetClassesTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        List<ModelAssetClassDetails> response = api.listAssetClasses(userId, userSecret)
                .execute();
        // TODO: test validations
    }

    /**
     * List of trades to make to rebalance portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void listCalculatedTradesTest() throws ApiException {
        UUID portfolioGroupId = null;
        CalculatedTrade response = api.listCalculatedTrades(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * List of model portfolio
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void listModelPortfolioTest() throws ApiException {
        List<ModelPortfolioDetails> response = api.listModelPortfolio()
                .execute();
        // TODO: test validations
    }

    /**
     * Get all accounts associated with a portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void listPortfolioAccountsTest() throws ApiException {
        UUID portfolioGroupId = null;
        List<Account> response = api.listPortfolioAccounts(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Updates model portfolio object
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void modifyModelPortfolioByIdTest() throws ApiException {
        UUID modelPortfolioId = null;
        ModelPortfolio modelPortfolio = null;
        List<ModelPortfolioSecurity> modelPortfolioSecurity = null;
        List<ModelPortfolioAssetClass> modelPortfolioAssetClass = null;
        api.modifyModelPortfolioById(modelPortfolioId)
                .modelPortfolio(modelPortfolio)
                .modelPortfolioSecurity(modelPortfolioSecurity)
                .modelPortfolioAssetClass(modelPortfolioAssetClass)
                .execute();
        // TODO: test validations
    }

    /**
     * Update an existing target portfolio.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void savePortfolioTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID id = null;
        String name = null;
        PortfolioGroup response = api.savePortfolio(portfolioGroupId)
                .id(id)
                .name(name)
                .execute();
        // TODO: test validations
    }

    /**
     * Search for symbols limited to brokerages under the specified portfolio group
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void searchPortfolioSymbolsTest() throws ApiException {
        UUID portfolioGroupId = null;
        String substring = null;
        List<UniversalSymbol> response = api.searchPortfolioSymbols(portfolioGroupId)
                .substring(substring)
                .execute();
        // TODO: test validations
    }

    /**
     * Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void setPortfolioTargetsTest() throws ApiException {
        UUID portfolioGroupId = null;
        List<TargetAsset> response = api.setPortfolioTargets(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Updates model asset class objects
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void updateAssetClassTest() throws ApiException {
        UUID modelAssetClassId = null;
        String userId = null;
        String userSecret = null;
        ModelAssetClass modelAssetClass = null;
        List<ModelAssetClassTarget> modelAssetClassTarget = null;
        api.updateAssetClass(modelAssetClassId, userId, userSecret)
                .modelAssetClass(modelAssetClass)
                .modelAssetClassTarget(modelAssetClassTarget)
                .execute();
        // TODO: test validations
    }

    /**
     * Updates portfolio group settings
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void updatePortfolioSettingsTest() throws ApiException {
        UUID portfolioGroupId = null;
        PortfolioGroupSettings response = api.updatePortfolioSettings(portfolioGroupId)
                .execute();
        // TODO: test validations
    }

    /**
     * Update a TargetAsset under the specified PortfolioGroup.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void updatePortfolioTargetByIdTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID targetAssetId = null;
        UUID id = null;
        UniversalSymbol symbol = null;
        Double percent = null;
        Boolean isSupported = null;
        Boolean isExcluded = null;
        Map<String, Object> meta = null;
        TargetAsset response = api.updatePortfolioTargetById(portfolioGroupId, targetAssetId)
                .id(id)
                .symbol(symbol)
                .percent(percent)
                .isSupported(isSupported)
                .isExcluded(isExcluded)
                .meta(meta)
                .execute();
        // TODO: test validations
    }

}
