sdks/java/src/test/java/com/konfigthis/client/api/TradingApiTest.java
/*
 * SnapTrade
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: efpyi@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.AccountOrderRecord;
import com.konfigthis.client.model.Action;
import com.konfigthis.client.model.BrokerageSymbol;
import com.konfigthis.client.model.ManualTradeAndImpact;
import com.konfigthis.client.model.ManualTradeForm;
import com.konfigthis.client.model.OrderType;
import com.konfigthis.client.model.SymbolsQuotesInner;
import com.konfigthis.client.model.TimeInForce;
import com.konfigthis.client.model.Trade;
import com.konfigthis.client.model.TradeExecutionStatus;
import com.konfigthis.client.model.TradeImpact;
import com.konfigthis.client.model.TradingCancelUserAccountOrderRequest;
import com.konfigthis.client.model.TradingPlaceOCOOrderRequest;
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 TradingApi
 */
@Disabled
public class TradingApiTest {

    private static TradingApi api;

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

    /**
     * Cancel open order in account
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void cancelUserAccountOrderTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        UUID accountId = null;
        UUID brokerageOrderId = null;
        AccountOrderRecord response = api.cancelUserAccountOrder(userId, userSecret, accountId)
                .brokerageOrderId(brokerageOrderId)
                .execute();
        // TODO: test validations
    }

    /**
     * Return details of a specific trade before it&#39;s placed
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getCalculatedTradeImpactByIdTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID calculatedTradeId = null;
        UUID tradeId = null;
        Trade response = api.getCalculatedTradeImpactById(portfolioGroupId, calculatedTradeId, tradeId)
                .execute();
        // TODO: test validations
    }

    /**
     * Return the impact of placing a series of trades on the portfolio
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getCalculatedTradesImpactTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID calculatedTradeId = null;
        List<TradeImpact> response = api.getCalculatedTradesImpact(portfolioGroupId, calculatedTradeId)
                .execute();
        // TODO: test validations
    }

    /**
     * Check impact of trades on account.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getOrderImpactTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        UUID accountId = null;
        Action action = null;
        OrderType orderType = null;
        Double price = null;
        Double stop = null;
        TimeInForce timeInForce = null;
        Double units = null;
        UUID universalSymbolId = null;
        ManualTradeAndImpact response = api.getOrderImpact(userId, userSecret)
                .accountId(accountId)
                .action(action)
                .orderType(orderType)
                .price(price)
                .stop(stop)
                .timeInForce(timeInForce)
                .units(units)
                .universalSymbolId(universalSymbolId)
                .execute();
        // TODO: test validations
    }

    /**
     * Get symbol quotes
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void getUserAccountQuotesTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        String symbols = null;
        String accountId = null;
        Boolean useTicker = null;
        List<SymbolsQuotesInner> response = api.getUserAccountQuotes(userId, userSecret, symbols, accountId)
                .useTicker(useTicker)
                .execute();
        // TODO: test validations
    }

    /**
     * Modify units of a trade before it is placed
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void modifyCalculatedTradeByIdTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID calculatedTradeId = null;
        UUID tradeId = null;
        UUID id = null;
        Account account = null;
        BrokerageSymbol symbol = null;
        UniversalSymbol universalSymbol = null;
        String action = null;
        Integer units = null;
        Double price = null;
        Integer sequence = null;
        Trade response = api.modifyCalculatedTradeById(portfolioGroupId, calculatedTradeId, tradeId)
                .id(id)
                .account(account)
                .symbol(symbol)
                .universalSymbol(universalSymbol)
                .action(action)
                .units(units)
                .price(price)
                .sequence(sequence)
                .execute();
        // TODO: test validations
    }

    /**
     * Place orders for the CalculatedTrades in series
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void placeCalculatedTradesTest() throws ApiException {
        UUID portfolioGroupId = null;
        UUID calculatedTradeId = null;
        List<TradeExecutionStatus> response = api.placeCalculatedTrades(portfolioGroupId, calculatedTradeId)
                .execute();
        // TODO: test validations
    }

    /**
     * Place a trade with NO validation.
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void placeForceOrderTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        UUID accountId = null;
        Action action = null;
        OrderType orderType = null;
        Double price = null;
        Double stop = null;
        TimeInForce timeInForce = null;
        Double units = null;
        UUID universalSymbolId = null;
        AccountOrderRecord response = api.placeForceOrder(userId, userSecret)
                .accountId(accountId)
                .action(action)
                .orderType(orderType)
                .price(price)
                .stop(stop)
                .timeInForce(timeInForce)
                .units(units)
                .universalSymbolId(universalSymbolId)
                .execute();
        // TODO: test validations
    }

    /**
     * Place a OCO (One Cancels Other) order
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void placeOCOOrderTest() throws ApiException {
        String userId = null;
        String userSecret = null;
        Object firstTradeId = null;
        Object secondTradeId = null;
        AccountOrderRecord response = api.placeOCOOrder(userId, userSecret)
                .firstTradeId(firstTradeId)
                .secondTradeId(secondTradeId)
                .execute();
        // TODO: test validations
    }

    /**
     * Place order
     *
     * @throws ApiException if the Api call fails
     */
    @Test
    public void placeOrderTest() throws ApiException {
        UUID tradeId = null;
        String userId = null;
        String userSecret = null;
        AccountOrderRecord response = api.placeOrder(tradeId, userId, userSecret)
                .execute();
        // TODO: test validations
    }

}
