/*
 * SnapTrade
 *
 * Connect brokerage accounts to your app for live positions and trading
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: nnheo@example.com
 * Generated by: https://konfigthis.com
 */


using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using System.Net.Mime;
using SnapTrade.Net.Client;
using SnapTrade.Net.Model;

namespace SnapTrade.Net.Api
{

    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public interface IAccountInformationApiSync : IApiAccessor
    {
        #region Synchronous Operations
        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account.
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;AccountHoldings&gt;</returns>
        List<AccountHoldings> GetAllUserHoldings(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0);

        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;AccountHoldings&gt;</returns>
        ApiResponse<List<AccountHoldings>> GetAllUserHoldingsWithHttpInfo(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0);
        /// <summary>
        /// Get all cash balances of an investment account
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Balance&gt;</returns>
        List<Balance> GetUserAccountBalance(string userId, string userSecret, Guid accountId, int operationIndex = 0);

        /// <summary>
        /// Get all cash balances of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Balance&gt;</returns>
        ApiResponse<List<Balance>> GetUserAccountBalanceWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0);
        /// <summary>
        /// Return details of a specific investment account
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Account&gt;</returns>
        List<Account> GetUserAccountDetails(string userId, string userSecret, Guid accountId, int operationIndex = 0);

        /// <summary>
        /// Return details of a specific investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Account&gt;</returns>
        ApiResponse<List<Account>> GetUserAccountDetailsWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0);
        /// <summary>
        /// Get all history of orders placed in account
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;AccountOrderRecord&gt;</returns>
        List<AccountOrderRecord> GetUserAccountOrders(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0);

        /// <summary>
        /// Get all history of orders placed in account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;AccountOrderRecord&gt;</returns>
        ApiResponse<List<AccountOrderRecord>> GetUserAccountOrdersWithHttpInfo(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0);
        /// <summary>
        /// Get all positions of an investment account
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Position&gt;</returns>
        List<Position> GetUserAccountPositions(string userId, string userSecret, Guid accountId, int operationIndex = 0);

        /// <summary>
        /// Get all positions of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Position&gt;</returns>
        ApiResponse<List<Position>> GetUserAccountPositionsWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0);
        /// <summary>
        /// List balances, positions and orders for the specified account.
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>AccountHoldingsAccount</returns>
        AccountHoldingsAccount GetUserHoldings(Guid accountId, string userId, string userSecret, int operationIndex = 0);

        /// <summary>
        /// List balances, positions and orders for the specified account.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of AccountHoldingsAccount</returns>
        ApiResponse<AccountHoldingsAccount> GetUserHoldingsWithHttpInfo(Guid accountId, string userId, string userSecret, int operationIndex = 0);
        /// <summary>
        /// List all investment accounts for the user
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Account&gt;</returns>
        List<Account> ListUserAccounts(string userId, string userSecret, int operationIndex = 0);

        /// <summary>
        /// List all investment accounts for the user
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Account&gt;</returns>
        ApiResponse<List<Account>> ListUserAccountsWithHttpInfo(string userId, string userSecret, int operationIndex = 0);
        /// <summary>
        /// Update details of an investment account
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Account&gt;</returns>
        List<Account> UpdateUserAccount(string userId, string userSecret, Guid accountId, int operationIndex = 0);

        /// <summary>
        /// Update details of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Account&gt;</returns>
        ApiResponse<List<Account>> UpdateUserAccountWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0);
        #endregion Synchronous Operations
    }

    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public interface IAccountInformationApiAsync : IApiAccessor
    {
        #region Asynchronous Operations
        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;AccountHoldings&gt;</returns>
        System.Threading.Tasks.Task<List<AccountHoldings>> GetAllUserHoldingsAsync(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;AccountHoldings&gt;)</returns>
        System.Threading.Tasks.Task<ApiResponse<List<AccountHoldings>>> GetAllUserHoldingsWithHttpInfoAsync(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Get all cash balances of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Balance&gt;</returns>
        System.Threading.Tasks.Task<List<Balance>> GetUserAccountBalanceAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Get all cash balances of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Balance&gt;)</returns>
        System.Threading.Tasks.Task<ApiResponse<List<Balance>>> GetUserAccountBalanceWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return details of a specific investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Account&gt;</returns>
        System.Threading.Tasks.Task<List<Account>> GetUserAccountDetailsAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Return details of a specific investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Account&gt;)</returns>
        System.Threading.Tasks.Task<ApiResponse<List<Account>>> GetUserAccountDetailsWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Get all history of orders placed in account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;AccountOrderRecord&gt;</returns>
        System.Threading.Tasks.Task<List<AccountOrderRecord>> GetUserAccountOrdersAsync(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Get all history of orders placed in account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;AccountOrderRecord&gt;)</returns>
        System.Threading.Tasks.Task<ApiResponse<List<AccountOrderRecord>>> GetUserAccountOrdersWithHttpInfoAsync(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Get all positions of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Position&gt;</returns>
        System.Threading.Tasks.Task<List<Position>> GetUserAccountPositionsAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Get all positions of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Position&gt;)</returns>
        System.Threading.Tasks.Task<ApiResponse<List<Position>>> GetUserAccountPositionsWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// List balances, positions and orders for the specified account.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of AccountHoldingsAccount</returns>
        System.Threading.Tasks.Task<AccountHoldingsAccount> GetUserHoldingsAsync(Guid accountId, string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// List balances, positions and orders for the specified account.
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (AccountHoldingsAccount)</returns>
        System.Threading.Tasks.Task<ApiResponse<AccountHoldingsAccount>> GetUserHoldingsWithHttpInfoAsync(Guid accountId, string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// List all investment accounts for the user
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Account&gt;</returns>
        System.Threading.Tasks.Task<List<Account>> ListUserAccountsAsync(string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// List all investment accounts for the user
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Account&gt;)</returns>
        System.Threading.Tasks.Task<ApiResponse<List<Account>>> ListUserAccountsWithHttpInfoAsync(string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Update details of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Account&gt;</returns>
        System.Threading.Tasks.Task<List<Account>> UpdateUserAccountAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));

        /// <summary>
        /// Update details of an investment account
        /// </summary>
        /// <remarks>
        /// 
        /// </remarks>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Account&gt;)</returns>
        System.Threading.Tasks.Task<ApiResponse<List<Account>>> UpdateUserAccountWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        #endregion Asynchronous Operations
    }

    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public interface IAccountInformationApi : IAccountInformationApiSync, IAccountInformationApiAsync
    {

    }

    /// <summary>
    /// Represents a collection of functions to interact with the API endpoints
    /// </summary>
    public partial class AccountInformationApi : IAccountInformationApi
    {
        private SnapTrade.Net.Client.ExceptionFactory _exceptionFactory = (name, response) => null;

        /// <summary>
        /// Initializes a new instance of the <see cref="AccountInformationApi"/> class.
        /// </summary>
        /// <returns></returns>
        public AccountInformationApi() : this((string)null)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AccountInformationApi"/> class.
        /// </summary>
        /// <returns></returns>
        public AccountInformationApi(string basePath)
        {
            this.Configuration = SnapTrade.Net.Client.Configuration.MergeConfigurations(
                SnapTrade.Net.Client.GlobalConfiguration.Instance,
                new SnapTrade.Net.Client.Configuration { BasePath = basePath }
            );
            this.Client = new SnapTrade.Net.Client.ApiClient(this.Configuration);
            this.AsynchronousClient = new SnapTrade.Net.Client.ApiClient(this.Configuration);
            this.ExceptionFactory = SnapTrade.Net.Client.Configuration.DefaultExceptionFactory;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AccountInformationApi"/> class
        /// using Configuration object
        /// </summary>
        /// <param name="configuration">An instance of Configuration</param>
        /// <returns></returns>
        public AccountInformationApi(SnapTrade.Net.Client.Configuration configuration)
        {
            if (configuration == null) throw new ArgumentNullException("configuration");

            this.Configuration = SnapTrade.Net.Client.Configuration.MergeConfigurations(
                SnapTrade.Net.Client.GlobalConfiguration.Instance,
                configuration
            );
            this.Client = new SnapTrade.Net.Client.ApiClient(this.Configuration);
            this.AsynchronousClient = new SnapTrade.Net.Client.ApiClient(this.Configuration);
            this.ExceptionFactory = SnapTrade.Net.Client.Configuration.DefaultExceptionFactory;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AccountInformationApi"/> class
        /// using a Configuration object and client instance.
        /// </summary>
        /// <param name="client">The client interface for synchronous API access.</param>
        /// <param name="asyncClient">The client interface for asynchronous API access.</param>
        /// <param name="configuration">The configuration object.</param>
        public AccountInformationApi(SnapTrade.Net.Client.ISynchronousClient client, SnapTrade.Net.Client.IAsynchronousClient asyncClient, SnapTrade.Net.Client.IReadableConfiguration configuration)
        {
            if (client == null) throw new ArgumentNullException("client");
            if (asyncClient == null) throw new ArgumentNullException("asyncClient");
            if (configuration == null) throw new ArgumentNullException("configuration");

            this.Client = client;
            this.AsynchronousClient = asyncClient;
            this.Configuration = configuration;
            this.ExceptionFactory = SnapTrade.Net.Client.Configuration.DefaultExceptionFactory;
        }

        /// <summary>
        /// The client for accessing this underlying API asynchronously.
        /// </summary>
        public SnapTrade.Net.Client.IAsynchronousClient AsynchronousClient { get; set; }

        /// <summary>
        /// The client for accessing this underlying API synchronously.
        /// </summary>
        public SnapTrade.Net.Client.ISynchronousClient Client { get; set; }

        /// <summary>
        /// Gets the base path of the API client.
        /// </summary>
        /// <value>The base path</value>
        public string GetBasePath()
        {
            return this.Configuration.BasePath;
        }

        /// <summary>
        /// Gets or sets the configuration object
        /// </summary>
        /// <value>An instance of the Configuration</value>
        public SnapTrade.Net.Client.IReadableConfiguration Configuration { get; set; }

        /// <summary>
        /// Provides a factory method hook for the creation of exceptions.
        /// </summary>
        public SnapTrade.Net.Client.ExceptionFactory ExceptionFactory
        {
            get
            {
                if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
                {
                    throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
                }
                return _exceptionFactory;
            }
            set { _exceptionFactory = value; }
        }

        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;AccountHoldings&gt;</returns>
        public List<AccountHoldings> GetAllUserHoldings(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<List<AccountHoldings>> localVarResponse = GetAllUserHoldingsWithHttpInfo(userId, userSecret, brokerageAuthorizations);
            return localVarResponse.Data;
        }

        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;AccountHoldings&gt;</returns>
        public SnapTrade.Net.Client.ApiResponse<List<AccountHoldings>> GetAllUserHoldingsWithHttpInfo(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetAllUserHoldings");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetAllUserHoldings");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));
            if (brokerageAuthorizations != null)
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "brokerage_authorizations", brokerageAuthorizations, "uuid"));
            }

            localVarRequestOptions.Operation = "AccountInformationApi.GetAllUserHoldings";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get<List<AccountHoldings>>("/holdings", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetAllUserHoldings", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;AccountHoldings&gt;</returns>
        public async System.Threading.Tasks.Task<List<AccountHoldings>> GetAllUserHoldingsAsync(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<List<AccountHoldings>> localVarResponse = await GetAllUserHoldingsWithHttpInfoAsync(userId, userSecret, brokerageAuthorizations, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// List all accounts for the user, plus balances and positions for each account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="brokerageAuthorizations">Optional. Comma seperated list of authorization IDs (only use if filtering is needed on one or more authorizations). (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;AccountHoldings&gt;)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<List<AccountHoldings>>> GetAllUserHoldingsWithHttpInfoAsync(string userId, string userSecret, Guid? brokerageAuthorizations = default(Guid?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetAllUserHoldings");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetAllUserHoldings");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));
            if (brokerageAuthorizations != null)
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "brokerage_authorizations", brokerageAuthorizations, "uuid"));
            }

            localVarRequestOptions.Operation = "AccountInformationApi.GetAllUserHoldings";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.GetAsync<List<AccountHoldings>>("/holdings", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetAllUserHoldings", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Get all cash balances of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Balance&gt;</returns>
        public List<Balance> GetUserAccountBalance(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<List<Balance>> localVarResponse = GetUserAccountBalanceWithHttpInfo(userId, userSecret, accountId);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Get all cash balances of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Balance&gt;</returns>
        public SnapTrade.Net.Client.ApiResponse<List<Balance>> GetUserAccountBalanceWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountBalance");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountBalance");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "*/*"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountBalance";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get<List<Balance>>("/accounts/{accountId}/balances", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountBalance", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Get all cash balances of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Balance&gt;</returns>
        public async System.Threading.Tasks.Task<List<Balance>> GetUserAccountBalanceAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<List<Balance>> localVarResponse = await GetUserAccountBalanceWithHttpInfoAsync(userId, userSecret, accountId, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Get all cash balances of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Balance&gt;)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<List<Balance>>> GetUserAccountBalanceWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountBalance");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountBalance");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "*/*"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountBalance";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.GetAsync<List<Balance>>("/accounts/{accountId}/balances", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountBalance", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Return details of a specific investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Account&gt;</returns>
        public List<Account> GetUserAccountDetails(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<List<Account>> localVarResponse = GetUserAccountDetailsWithHttpInfo(userId, userSecret, accountId);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Return details of a specific investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Account&gt;</returns>
        public SnapTrade.Net.Client.ApiResponse<List<Account>> GetUserAccountDetailsWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountDetails");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountDetails");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountDetails";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get<List<Account>>("/accounts/{accountId}", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountDetails", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Return details of a specific investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Account&gt;</returns>
        public async System.Threading.Tasks.Task<List<Account>> GetUserAccountDetailsAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<List<Account>> localVarResponse = await GetUserAccountDetailsWithHttpInfoAsync(userId, userSecret, accountId, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Return details of a specific investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to get detail of.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Account&gt;)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<List<Account>>> GetUserAccountDetailsWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountDetails");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountDetails");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountDetails";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.GetAsync<List<Account>>("/accounts/{accountId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountDetails", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Get all history of orders placed in account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;AccountOrderRecord&gt;</returns>
        public List<AccountOrderRecord> GetUserAccountOrders(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<List<AccountOrderRecord>> localVarResponse = GetUserAccountOrdersWithHttpInfo(userId, userSecret, accountId, state);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Get all history of orders placed in account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;AccountOrderRecord&gt;</returns>
        public SnapTrade.Net.Client.ApiResponse<List<AccountOrderRecord>> GetUserAccountOrdersWithHttpInfo(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountOrders");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountOrders");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));
            if (state != null)
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "state", state, ""));
            }

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountOrders";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get<List<AccountOrderRecord>>("/accounts/{accountId}/orders", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountOrders", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Get all history of orders placed in account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;AccountOrderRecord&gt;</returns>
        public async System.Threading.Tasks.Task<List<AccountOrderRecord>> GetUserAccountOrdersAsync(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<List<AccountOrderRecord>> localVarResponse = await GetUserAccountOrdersWithHttpInfoAsync(userId, userSecret, accountId, state, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Get all history of orders placed in account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="state">defaults value is set to \&quot;all\&quot; (optional)</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;AccountOrderRecord&gt;)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<List<AccountOrderRecord>>> GetUserAccountOrdersWithHttpInfoAsync(string userId, string userSecret, Guid accountId, string state = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountOrders");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountOrders");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));
            if (state != null)
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "state", state, ""));
            }

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountOrders";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.GetAsync<List<AccountOrderRecord>>("/accounts/{accountId}/orders", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountOrders", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Get all positions of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Position&gt;</returns>
        public List<Position> GetUserAccountPositions(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<List<Position>> localVarResponse = GetUserAccountPositionsWithHttpInfo(userId, userSecret, accountId);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Get all positions of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Position&gt;</returns>
        public SnapTrade.Net.Client.ApiResponse<List<Position>> GetUserAccountPositionsWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountPositions");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountPositions");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "*/*"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountPositions";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get<List<Position>>("/accounts/{accountId}/positions", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountPositions", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Get all positions of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Position&gt;</returns>
        public async System.Threading.Tasks.Task<List<Position>> GetUserAccountPositionsAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<List<Position>> localVarResponse = await GetUserAccountPositionsWithHttpInfoAsync(userId, userSecret, accountId, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Get all positions of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account get positions.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Position&gt;)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<List<Position>>> GetUserAccountPositionsWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserAccountPositions");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserAccountPositions");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "*/*"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserAccountPositions";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.GetAsync<List<Position>>("/accounts/{accountId}/positions", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserAccountPositions", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// List balances, positions and orders for the specified account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>AccountHoldingsAccount</returns>
        public AccountHoldingsAccount GetUserHoldings(Guid accountId, string userId, string userSecret, int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<AccountHoldingsAccount> localVarResponse = GetUserHoldingsWithHttpInfo(accountId, userId, userSecret);
            return localVarResponse.Data;
        }

        /// <summary>
        /// List balances, positions and orders for the specified account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of AccountHoldingsAccount</returns>
        public SnapTrade.Net.Client.ApiResponse<AccountHoldingsAccount> GetUserHoldingsWithHttpInfo(Guid accountId, string userId, string userSecret, int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserHoldings");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserHoldings");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserHoldings";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get<AccountHoldingsAccount>("/accounts/{accountId}/holdings", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserHoldings", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// List balances, positions and orders for the specified account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of AccountHoldingsAccount</returns>
        public async System.Threading.Tasks.Task<AccountHoldingsAccount> GetUserHoldingsAsync(Guid accountId, string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<AccountHoldingsAccount> localVarResponse = await GetUserHoldingsWithHttpInfoAsync(accountId, userId, userSecret, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// List balances, positions and orders for the specified account. 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The ID of the account to fetch holdings for.</param>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (AccountHoldingsAccount)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<AccountHoldingsAccount>> GetUserHoldingsWithHttpInfoAsync(Guid accountId, string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->GetUserHoldings");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->GetUserHoldings");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.GetUserHoldings";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.GetAsync<AccountHoldingsAccount>("/accounts/{accountId}/holdings", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUserHoldings", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// List all investment accounts for the user 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Account&gt;</returns>
        public List<Account> ListUserAccounts(string userId, string userSecret, int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<List<Account>> localVarResponse = ListUserAccountsWithHttpInfo(userId, userSecret);
            return localVarResponse.Data;
        }

        /// <summary>
        /// List all investment accounts for the user 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Account&gt;</returns>
        public SnapTrade.Net.Client.ApiResponse<List<Account>> ListUserAccountsWithHttpInfo(string userId, string userSecret, int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->ListUserAccounts");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->ListUserAccounts");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.ListUserAccounts";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get<List<Account>>("/accounts", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ListUserAccounts", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// List all investment accounts for the user 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Account&gt;</returns>
        public async System.Threading.Tasks.Task<List<Account>> ListUserAccountsAsync(string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<List<Account>> localVarResponse = await ListUserAccountsWithHttpInfoAsync(userId, userSecret, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// List all investment accounts for the user 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Account&gt;)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<List<Account>>> ListUserAccountsWithHttpInfoAsync(string userId, string userSecret, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->ListUserAccounts");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->ListUserAccounts");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.ListUserAccounts";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.GetAsync<List<Account>>("/accounts", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ListUserAccounts", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Update details of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>List&lt;Account&gt;</returns>
        public List<Account> UpdateUserAccount(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            SnapTrade.Net.Client.ApiResponse<List<Account>> localVarResponse = UpdateUserAccountWithHttpInfo(userId, userSecret, accountId);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Update details of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <returns>ApiResponse of List&lt;Account&gt;</returns>
        public SnapTrade.Net.Client.ApiResponse<List<Account>> UpdateUserAccountWithHttpInfo(string userId, string userSecret, Guid accountId, int operationIndex = 0)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->UpdateUserAccount");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->UpdateUserAccount");
            }

            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.UpdateUserAccount";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Put<List<Account>>("/accounts/{accountId}", localVarRequestOptions, this.Configuration);
            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("UpdateUserAccount", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

        /// <summary>
        /// Update details of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of List&lt;Account&gt;</returns>
        public async System.Threading.Tasks.Task<List<Account>> UpdateUserAccountAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            SnapTrade.Net.Client.ApiResponse<List<Account>> localVarResponse = await UpdateUserAccountWithHttpInfoAsync(userId, userSecret, accountId, operationIndex, cancellationToken).ConfigureAwait(false);
            return localVarResponse.Data;
        }

        /// <summary>
        /// Update details of an investment account 
        /// </summary>
        /// <exception cref="SnapTrade.Net.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId"></param>
        /// <param name="userSecret"></param>
        /// <param name="accountId">The ID of the account to update.</param>
        /// <param name="operationIndex">Index associated with the operation.</param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (List&lt;Account&gt;)</returns>
        public async System.Threading.Tasks.Task<SnapTrade.Net.Client.ApiResponse<List<Account>>> UpdateUserAccountWithHttpInfoAsync(string userId, string userSecret, Guid accountId, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userId' when calling AccountInformationApi->UpdateUserAccount");
            }

            // verify the required parameter 'userSecret' is set
            if (userSecret == null)
            {
                throw new SnapTrade.Net.Client.ApiException(400, "Missing required parameter 'userSecret' when calling AccountInformationApi->UpdateUserAccount");
            }


            SnapTrade.Net.Client.RequestOptions localVarRequestOptions = new SnapTrade.Net.Client.RequestOptions();

            string[] _contentTypes = new string[] {
            };

            // to determine the Accept header
            string[] _accepts = new string[] {
                "application/json"
            };

            var localVarContentType = SnapTrade.Net.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = SnapTrade.Net.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("accountId", SnapTrade.Net.Client.ClientUtils.ParameterToString(accountId)); // path parameter
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userId", userId, ""));
            localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "userSecret", userSecret, ""));

            localVarRequestOptions.Operation = "AccountInformationApi.UpdateUserAccount";
            localVarRequestOptions.OperationIndex = operationIndex;

            // authentication (PartnerClientId) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("clientId")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "clientId", this.Configuration.GetApiKeyWithPrefix("clientId")));
            }
            // authentication (PartnerSignature) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Signature")))
            {
                localVarRequestOptions.HeaderParameters.Add("Signature", this.Configuration.GetApiKeyWithPrefix("Signature"));
            }
            // authentication (PartnerTimestamp) required
            if (!string.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("timestamp")))
            {
                localVarRequestOptions.QueryParameters.Add(SnapTrade.Net.Client.ClientUtils.ParameterToMultiMap("", "timestamp", this.Configuration.GetApiKeyWithPrefix("timestamp")));
            }

            // make the HTTP request
            var localVarResponse = await this.AsynchronousClient.PutAsync<List<Account>>("/accounts/{accountId}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("UpdateUserAccount", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return localVarResponse;
        }

    }
}
