/* tslint:disable */
/* eslint-disable */
/**
 * UCX Proxy
 * A single use API for the UCX Proxy.
 *
 * The version of the OpenAPI document: 0.0.12
 * Contact: customersuccess@equisoft.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
import * as runtime from '../runtime';
import { InvestmentSourceResultSchemaFromJSON, } from '../models/index';
/**
 *
 */
export class InvestmentApi extends runtime.BaseAPI {
    /**
     * Creates request options for getInvestmentAccounts without sending the request
     */
    getInvestmentAccountsRequestOpts(requestParameters) {
        return __awaiter(this, void 0, void 0, function* () {
            if (requestParameters['uniqueIdentifier'] == null) {
                throw new runtime.RequiredError('uniqueIdentifier', 'Required parameter "uniqueIdentifier" was null or undefined when calling getInvestmentAccounts().');
            }
            const queryParameters = {};
            if (requestParameters['organizationId'] != null) {
                queryParameters['organizationId'] = requestParameters['organizationId'];
            }
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                // oauth required
                const token = this.configuration.accessToken;
                const tokenString = yield token("default", ["ucx:read"]);
                if (tokenString) {
                    headerParameters["Authorization"] = `Bearer ${tokenString}`;
                }
            }
            let urlPath = `/contacts/{uniqueIdentifier}/investments`;
            urlPath = urlPath.replace(`{${"uniqueIdentifier"}}`, encodeURIComponent(String(requestParameters['uniqueIdentifier'])));
            return {
                path: urlPath,
                method: 'GET',
                headers: headerParameters,
                query: queryParameters,
            };
        });
    }
    /**
     * Get investment accounts for a specific contact
     */
    getInvestmentAccountsRaw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const requestOptions = yield this.getInvestmentAccountsRequestOpts(requestParameters);
            const response = yield this.request(requestOptions, initOverrides);
            return new runtime.JSONApiResponse(response, (jsonValue) => InvestmentSourceResultSchemaFromJSON(jsonValue));
        });
    }
    /**
     * Get investment accounts for a specific contact
     */
    getInvestmentAccounts(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const response = yield this.getInvestmentAccountsRaw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
    /**
     * Creates request options for getInvestmentAccounts1 without sending the request
     */
    getInvestmentAccounts1RequestOpts(requestParameters) {
        return __awaiter(this, void 0, void 0, function* () {
            if (requestParameters['uniqueIdentifier'] == null) {
                throw new runtime.RequiredError('uniqueIdentifier', 'Required parameter "uniqueIdentifier" was null or undefined when calling getInvestmentAccounts1().');
            }
            if (requestParameters['investmentAccountId'] == null) {
                throw new runtime.RequiredError('investmentAccountId', 'Required parameter "investmentAccountId" was null or undefined when calling getInvestmentAccounts1().');
            }
            const queryParameters = {};
            if (requestParameters['organizationId'] != null) {
                queryParameters['organizationId'] = requestParameters['organizationId'];
            }
            const headerParameters = {};
            if (this.configuration && this.configuration.accessToken) {
                // oauth required
                const token = this.configuration.accessToken;
                const tokenString = yield token("default", ["ucx:read"]);
                if (tokenString) {
                    headerParameters["Authorization"] = `Bearer ${tokenString}`;
                }
            }
            let urlPath = `/contacts/{uniqueIdentifier}/investments/{investmentAccountId}`;
            urlPath = urlPath.replace(`{${"uniqueIdentifier"}}`, encodeURIComponent(String(requestParameters['uniqueIdentifier'])));
            urlPath = urlPath.replace(`{${"investmentAccountId"}}`, encodeURIComponent(String(requestParameters['investmentAccountId'])));
            return {
                path: urlPath,
                method: 'GET',
                headers: headerParameters,
                query: queryParameters,
            };
        });
    }
    /**
     * Get investment accounts for a specific contact
     */
    getInvestmentAccounts1Raw(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const requestOptions = yield this.getInvestmentAccounts1RequestOpts(requestParameters);
            const response = yield this.request(requestOptions, initOverrides);
            return new runtime.JSONApiResponse(response, (jsonValue) => InvestmentSourceResultSchemaFromJSON(jsonValue));
        });
    }
    /**
     * Get investment accounts for a specific contact
     */
    getInvestmentAccounts1(requestParameters, initOverrides) {
        return __awaiter(this, void 0, void 0, function* () {
            const response = yield this.getInvestmentAccounts1Raw(requestParameters, initOverrides);
            return yield response.value();
        });
    }
}
