/* 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.
 */

import { mapValues } from '../runtime';
import type { Status } from './Status';
import {
    StatusFromJSON,
    StatusFromJSONTyped,
    StatusToJSON,
    StatusToJSONTyped,
} from './Status';
import type { InvestmentAccountSchema } from './InvestmentAccountSchema';
import {
    InvestmentAccountSchemaFromJSON,
    InvestmentAccountSchemaFromJSONTyped,
    InvestmentAccountSchemaToJSON,
    InvestmentAccountSchemaToJSONTyped,
} from './InvestmentAccountSchema';
import type { ErrorResponse } from './ErrorResponse';
import {
    ErrorResponseFromJSON,
    ErrorResponseFromJSONTyped,
    ErrorResponseToJSON,
    ErrorResponseToJSONTyped,
} from './ErrorResponse';

/**
 * 
 * @export
 * @interface InvestmentSourceResultSchema
 */
export interface InvestmentSourceResultSchema {
    /**
     * 
     * @type {Status}
     * @memberof InvestmentSourceResultSchema
     */
    status: Status;
    /**
     * 
     * @type {string}
     * @memberof InvestmentSourceResultSchema
     */
    sourceKey: string;
    /**
     * 
     * @type {ErrorResponse}
     * @memberof InvestmentSourceResultSchema
     */
    errorResponse?: ErrorResponse | null;
    /**
     * 
     * @type {Array<InvestmentAccountSchema>}
     * @memberof InvestmentSourceResultSchema
     */
    investmentResults?: Array<InvestmentAccountSchema> | null;
}



/**
 * Check if a given object implements the InvestmentSourceResultSchema interface.
 */
export function instanceOfInvestmentSourceResultSchema(value: object): value is InvestmentSourceResultSchema {
    if (!('status' in value) || value['status'] === undefined) return false;
    if (!('sourceKey' in value) || value['sourceKey'] === undefined) return false;
    return true;
}

export function InvestmentSourceResultSchemaFromJSON(json: any): InvestmentSourceResultSchema {
    return InvestmentSourceResultSchemaFromJSONTyped(json, false);
}

export function InvestmentSourceResultSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): InvestmentSourceResultSchema {
    if (json == null) {
        return json;
    }
    return {
        
        'status': StatusFromJSON(json['status']),
        'sourceKey': json['sourceKey'],
        'errorResponse': json['errorResponse'] == null ? undefined : ErrorResponseFromJSON(json['errorResponse']),
        'investmentResults': json['investmentResults'] == null ? undefined : ((json['investmentResults'] as Array<any>).map(InvestmentAccountSchemaFromJSON)),
    };
}

export function InvestmentSourceResultSchemaToJSON(json: any): InvestmentSourceResultSchema {
    return InvestmentSourceResultSchemaToJSONTyped(json, false);
}

export function InvestmentSourceResultSchemaToJSONTyped(value?: InvestmentSourceResultSchema | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'status': StatusToJSON(value['status']),
        'sourceKey': value['sourceKey'],
        'errorResponse': ErrorResponseToJSON(value['errorResponse']),
        'investmentResults': value['investmentResults'] == null ? undefined : ((value['investmentResults'] as Array<any>).map(InvestmentAccountSchemaToJSON)),
    };
}

