/* 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 { SymbolsSchema } from './SymbolsSchema';
import {
    SymbolsSchemaFromJSON,
    SymbolsSchemaFromJSONTyped,
    SymbolsSchemaToJSON,
    SymbolsSchemaToJSONTyped,
} from './SymbolsSchema';
import type { HoldingExchange } from './HoldingExchange';
import {
    HoldingExchangeFromJSON,
    HoldingExchangeFromJSONTyped,
    HoldingExchangeToJSON,
    HoldingExchangeToJSONTyped,
} from './HoldingExchange';
import type { HoldingType } from './HoldingType';
import {
    HoldingTypeFromJSON,
    HoldingTypeFromJSONTyped,
    HoldingTypeToJSON,
    HoldingTypeToJSONTyped,
} from './HoldingType';

/**
 * 
 * @export
 * @interface HoldingSchema
 */
export interface HoldingSchema {
    /**
     * 
     * @type {SymbolsSchema}
     * @memberof HoldingSchema
     */
    symbols: SymbolsSchema;
    /**
     * 
     * @type {string}
     * @memberof HoldingSchema
     */
    description?: string | null;
    /**
     * 
     * @type {HoldingType}
     * @memberof HoldingSchema
     */
    type?: HoldingType | null;
    /**
     * 
     * @type {HoldingExchange}
     * @memberof HoldingSchema
     */
    exchange?: HoldingExchange | null;
    /**
     * 
     * @type {number}
     * @memberof HoldingSchema
     */
    quantity?: number | null;
    /**
     * 
     * @type {string}
     * @memberof HoldingSchema
     */
    currency?: string | null;
    /**
     * 
     * @type {number}
     * @memberof HoldingSchema
     */
    marketValue?: number | null;
    /**
     * 
     * @type {{ [key: string]: object; }}
     * @memberof HoldingSchema
     */
    sourceMetadata: { [key: string]: object; };
}



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

export function HoldingSchemaFromJSON(json: any): HoldingSchema {
    return HoldingSchemaFromJSONTyped(json, false);
}

export function HoldingSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): HoldingSchema {
    if (json == null) {
        return json;
    }
    return {
        
        'symbols': SymbolsSchemaFromJSON(json['symbols']),
        'description': json['description'] == null ? undefined : json['description'],
        'type': json['type'] == null ? undefined : HoldingTypeFromJSON(json['type']),
        'exchange': json['exchange'] == null ? undefined : HoldingExchangeFromJSON(json['exchange']),
        'quantity': json['quantity'] == null ? undefined : json['quantity'],
        'currency': json['currency'] == null ? undefined : json['currency'],
        'marketValue': json['marketValue'] == null ? undefined : json['marketValue'],
        'sourceMetadata': json['sourceMetadata'],
    };
}

export function HoldingSchemaToJSON(json: any): HoldingSchema {
    return HoldingSchemaToJSONTyped(json, false);
}

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

    return {
        
        'symbols': SymbolsSchemaToJSON(value['symbols']),
        'description': value['description'],
        'type': HoldingTypeToJSON(value['type']),
        'exchange': HoldingExchangeToJSON(value['exchange']),
        'quantity': value['quantity'],
        'currency': value['currency'],
        'marketValue': value['marketValue'],
        'sourceMetadata': value['sourceMetadata'],
    };
}

