/* 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 { IncomeSchemaFromJSON, IncomeSchemaToJSON, } from './IncomeSchema';
import { MaritalStatusFromJSON, MaritalStatusToJSON, } from './MaritalStatus';
import { CivilityTitleFromJSON, CivilityTitleToJSON, } from './CivilityTitle';
import { EmailSchemaFromJSON, EmailSchemaToJSON, } from './EmailSchema';
import { AddressSchemaFromJSON, AddressSchemaToJSON, } from './AddressSchema';
import { ContactLanguageFromJSON, ContactLanguageToJSON, } from './ContactLanguage';
import { PhoneSchemaFromJSON, PhoneSchemaToJSON, } from './PhoneSchema';
import { GenderFromJSON, GenderToJSON, } from './Gender';
import { SmokerStatusFromJSON, SmokerStatusToJSON, } from './SmokerStatus';
/**
 * Check if a given object implements the ContactSchema interface.
 */
export 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;
}
export function ContactSchemaFromJSON(json) {
    return ContactSchemaFromJSONTyped(json, false);
}
export 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 : CivilityTitleFromJSON(json['civilityTitle']),
        'gender': json['gender'] == null ? undefined : GenderFromJSON(json['gender']),
        'maritalStatus': json['maritalStatus'] == null ? undefined : MaritalStatusFromJSON(json['maritalStatus']),
        'dateOfBirth': json['dateOfBirth'] == null ? undefined : (new Date(json['dateOfBirth'])),
        'language': json['language'] == null ? undefined : ContactLanguageFromJSON(json['language']),
        'income': json['income'] == null ? undefined : IncomeSchemaFromJSON(json['income']),
        'smokerStatus': json['smokerStatus'] == null ? undefined : SmokerStatusFromJSON(json['smokerStatus']),
        'addresses': (json['addresses'].map(AddressSchemaFromJSON)),
        'phones': (json['phones'].map(PhoneSchemaFromJSON)),
        'emails': (json['emails'].map(EmailSchemaFromJSON)),
    };
}
export function ContactSchemaToJSON(json) {
    return ContactSchemaToJSONTyped(json, false);
}
export 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': CivilityTitleToJSON(value['civilityTitle']),
        'gender': GenderToJSON(value['gender']),
        'maritalStatus': MaritalStatusToJSON(value['maritalStatus']),
        'dateOfBirth': value['dateOfBirth'] == null ? value['dateOfBirth'] : value['dateOfBirth'].toISOString().substring(0, 10),
        'language': ContactLanguageToJSON(value['language']),
        'income': IncomeSchemaToJSON(value['income']),
        'smokerStatus': SmokerStatusToJSON(value['smokerStatus']),
        'addresses': (value['addresses'].map(AddressSchemaToJSON)),
        'phones': (value['phones'].map(PhoneSchemaToJSON)),
        'emails': (value['emails'].map(EmailSchemaToJSON)),
    };
}
