"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.instanceOfContactSchema = instanceOfContactSchema;
exports.ContactSchemaFromJSON = ContactSchemaFromJSON;
exports.ContactSchemaFromJSONTyped = ContactSchemaFromJSONTyped;
exports.ContactSchemaToJSON = ContactSchemaToJSON;
exports.ContactSchemaToJSONTyped = ContactSchemaToJSONTyped;
const IncomeSchema_1 = require("./IncomeSchema");
const MaritalStatus_1 = require("./MaritalStatus");
const CivilityTitle_1 = require("./CivilityTitle");
const EmailSchema_1 = require("./EmailSchema");
const AddressSchema_1 = require("./AddressSchema");
const ContactLanguage_1 = require("./ContactLanguage");
const PhoneSchema_1 = require("./PhoneSchema");
const Gender_1 = require("./Gender");
const SmokerStatus_1 = require("./SmokerStatus");
/**
 * Check if a given object implements the ContactSchema interface.
 */
function instanceOfContactSchema(value) {
    if (!('uniqueIdentifier' in value) || value['uniqueIdentifier'] === undefined)
        return false;
    if (!('externalIdentifier' in value) || value['externalIdentifier'] === undefined)
        return false;
    if (!('addresses' in value) || value['addresses'] === undefined)
        return false;
    if (!('phones' in value) || value['phones'] === undefined)
        return false;
    if (!('emails' in value) || value['emails'] === undefined)
        return false;
    return true;
}
function ContactSchemaFromJSON(json) {
    return ContactSchemaFromJSONTyped(json, false);
}
function ContactSchemaFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'uniqueIdentifier': json['uniqueIdentifier'],
        'externalIdentifier': json['externalIdentifier'],
        'firstName': json['firstName'] == null ? undefined : json['firstName'],
        'middleName': json['middleName'] == null ? undefined : json['middleName'],
        'lastName': json['lastName'] == null ? undefined : json['lastName'],
        'suffix': json['suffix'] == null ? undefined : json['suffix'],
        'civilityTitle': json['civilityTitle'] == null ? undefined : (0, CivilityTitle_1.CivilityTitleFromJSON)(json['civilityTitle']),
        'gender': json['gender'] == null ? undefined : (0, Gender_1.GenderFromJSON)(json['gender']),
        'maritalStatus': json['maritalStatus'] == null ? undefined : (0, MaritalStatus_1.MaritalStatusFromJSON)(json['maritalStatus']),
        'dateOfBirth': json['dateOfBirth'] == null ? undefined : (new Date(json['dateOfBirth'])),
        'language': json['language'] == null ? undefined : (0, ContactLanguage_1.ContactLanguageFromJSON)(json['language']),
        'income': json['income'] == null ? undefined : (0, IncomeSchema_1.IncomeSchemaFromJSON)(json['income']),
        'smokerStatus': json['smokerStatus'] == null ? undefined : (0, SmokerStatus_1.SmokerStatusFromJSON)(json['smokerStatus']),
        'addresses': (json['addresses'].map(AddressSchema_1.AddressSchemaFromJSON)),
        'phones': (json['phones'].map(PhoneSchema_1.PhoneSchemaFromJSON)),
        'emails': (json['emails'].map(EmailSchema_1.EmailSchemaFromJSON)),
    };
}
function ContactSchemaToJSON(json) {
    return ContactSchemaToJSONTyped(json, false);
}
function ContactSchemaToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'uniqueIdentifier': value['uniqueIdentifier'],
        'externalIdentifier': value['externalIdentifier'],
        'firstName': value['firstName'],
        'middleName': value['middleName'],
        'lastName': value['lastName'],
        'suffix': value['suffix'],
        'civilityTitle': (0, CivilityTitle_1.CivilityTitleToJSON)(value['civilityTitle']),
        'gender': (0, Gender_1.GenderToJSON)(value['gender']),
        'maritalStatus': (0, MaritalStatus_1.MaritalStatusToJSON)(value['maritalStatus']),
        'dateOfBirth': value['dateOfBirth'] == null ? value['dateOfBirth'] : value['dateOfBirth'].toISOString().substring(0, 10),
        'language': (0, ContactLanguage_1.ContactLanguageToJSON)(value['language']),
        'income': (0, IncomeSchema_1.IncomeSchemaToJSON)(value['income']),
        'smokerStatus': (0, SmokerStatus_1.SmokerStatusToJSON)(value['smokerStatus']),
        'addresses': (value['addresses'].map(AddressSchema_1.AddressSchemaToJSON)),
        'phones': (value['phones'].map(PhoneSchema_1.PhoneSchemaToJSON)),
        'emails': (value['emails'].map(EmailSchema_1.EmailSchemaToJSON)),
    };
}
