"use strict";
/* 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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfInvestmentAccountSchema = instanceOfInvestmentAccountSchema;
exports.InvestmentAccountSchemaFromJSON = InvestmentAccountSchemaFromJSON;
exports.InvestmentAccountSchemaFromJSONTyped = InvestmentAccountSchemaFromJSONTyped;
exports.InvestmentAccountSchemaToJSON = InvestmentAccountSchemaToJSON;
exports.InvestmentAccountSchemaToJSONTyped = InvestmentAccountSchemaToJSONTyped;
const ContactReferenceSchema_1 = require("./ContactReferenceSchema");
const HoldingSchema_1 = require("./HoldingSchema");
const InvestmentStatus_1 = require("./InvestmentStatus");
const RegistrationType_1 = require("./RegistrationType");
const AccountType_1 = require("./AccountType");
/**
 * Check if a given object implements the InvestmentAccountSchema interface.
 */
function instanceOfInvestmentAccountSchema(value) {
    if (!('uniqueIdentifier' in value) || value['uniqueIdentifier'] === undefined)
        return false;
    if (!('externalIdentifier' in value) || value['externalIdentifier'] === undefined)
        return false;
    if (!('accountNumber' in value) || value['accountNumber'] === undefined)
        return false;
    if (!('sourceMetadata' in value) || value['sourceMetadata'] === undefined)
        return false;
    return true;
}
function InvestmentAccountSchemaFromJSON(json) {
    return InvestmentAccountSchemaFromJSONTyped(json, false);
}
function InvestmentAccountSchemaFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'uniqueIdentifier': json['uniqueIdentifier'],
        'externalIdentifier': json['externalIdentifier'],
        'accountNumber': json['accountNumber'],
        'status': json['status'] == null ? undefined : (0, InvestmentStatus_1.InvestmentStatusFromJSON)(json['status']),
        'description': json['description'] == null ? undefined : json['description'],
        'accountType': json['accountType'] == null ? undefined : (0, AccountType_1.AccountTypeFromJSON)(json['accountType']),
        'jurisdiction': json['jurisdiction'] == null ? undefined : json['jurisdiction'],
        'registrationType': json['registrationType'] == null ? undefined : (0, RegistrationType_1.RegistrationTypeFromJSON)(json['registrationType']),
        'currency': json['currency'] == null ? undefined : json['currency'],
        'marketValue': json['marketValue'] == null ? undefined : json['marketValue'],
        'fetchedAt': json['fetchedAt'] == null ? undefined : (new Date(json['fetchedAt'])),
        'asOfDate': json['asOfDate'] == null ? undefined : (new Date(json['asOfDate'])),
        'owners': json['owners'] == null ? undefined : (json['owners'].map(ContactReferenceSchema_1.ContactReferenceSchemaFromJSON)),
        'contributors': json['contributors'] == null ? undefined : (json['contributors'].map(ContactReferenceSchema_1.ContactReferenceSchemaFromJSON)),
        'sourceMetadata': json['sourceMetadata'],
        'holdings': json['holdings'] == null ? undefined : (json['holdings'].map(HoldingSchema_1.HoldingSchemaFromJSON)),
    };
}
function InvestmentAccountSchemaToJSON(json) {
    return InvestmentAccountSchemaToJSONTyped(json, false);
}
function InvestmentAccountSchemaToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'uniqueIdentifier': value['uniqueIdentifier'],
        'externalIdentifier': value['externalIdentifier'],
        'accountNumber': value['accountNumber'],
        'status': (0, InvestmentStatus_1.InvestmentStatusToJSON)(value['status']),
        'description': value['description'],
        'accountType': (0, AccountType_1.AccountTypeToJSON)(value['accountType']),
        'jurisdiction': value['jurisdiction'],
        'registrationType': (0, RegistrationType_1.RegistrationTypeToJSON)(value['registrationType']),
        'currency': value['currency'],
        'marketValue': value['marketValue'],
        'fetchedAt': value['fetchedAt'] == null ? value['fetchedAt'] : value['fetchedAt'].toISOString().substring(0, 10),
        'asOfDate': value['asOfDate'] == null ? value['asOfDate'] : value['asOfDate'].toISOString().substring(0, 10),
        'owners': value['owners'] == null ? undefined : (value['owners'].map(ContactReferenceSchema_1.ContactReferenceSchemaToJSON)),
        'contributors': value['contributors'] == null ? undefined : (value['contributors'].map(ContactReferenceSchema_1.ContactReferenceSchemaToJSON)),
        'sourceMetadata': value['sourceMetadata'],
        'holdings': value['holdings'] == null ? undefined : (value['holdings'].map(HoldingSchema_1.HoldingSchemaToJSON)),
    };
}
