/* 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 { IncomeSchema } from './IncomeSchema';
import {
    IncomeSchemaFromJSON,
    IncomeSchemaFromJSONTyped,
    IncomeSchemaToJSON,
    IncomeSchemaToJSONTyped,
} from './IncomeSchema';
import type { MaritalStatus } from './MaritalStatus';
import {
    MaritalStatusFromJSON,
    MaritalStatusFromJSONTyped,
    MaritalStatusToJSON,
    MaritalStatusToJSONTyped,
} from './MaritalStatus';
import type { CivilityTitle } from './CivilityTitle';
import {
    CivilityTitleFromJSON,
    CivilityTitleFromJSONTyped,
    CivilityTitleToJSON,
    CivilityTitleToJSONTyped,
} from './CivilityTitle';
import type { EmailSchema } from './EmailSchema';
import {
    EmailSchemaFromJSON,
    EmailSchemaFromJSONTyped,
    EmailSchemaToJSON,
    EmailSchemaToJSONTyped,
} from './EmailSchema';
import type { AddressSchema } from './AddressSchema';
import {
    AddressSchemaFromJSON,
    AddressSchemaFromJSONTyped,
    AddressSchemaToJSON,
    AddressSchemaToJSONTyped,
} from './AddressSchema';
import type { ContactLanguage } from './ContactLanguage';
import {
    ContactLanguageFromJSON,
    ContactLanguageFromJSONTyped,
    ContactLanguageToJSON,
    ContactLanguageToJSONTyped,
} from './ContactLanguage';
import type { PhoneSchema } from './PhoneSchema';
import {
    PhoneSchemaFromJSON,
    PhoneSchemaFromJSONTyped,
    PhoneSchemaToJSON,
    PhoneSchemaToJSONTyped,
} from './PhoneSchema';
import type { Gender } from './Gender';
import {
    GenderFromJSON,
    GenderFromJSONTyped,
    GenderToJSON,
    GenderToJSONTyped,
} from './Gender';
import type { SmokerStatus } from './SmokerStatus';
import {
    SmokerStatusFromJSON,
    SmokerStatusFromJSONTyped,
    SmokerStatusToJSON,
    SmokerStatusToJSONTyped,
} from './SmokerStatus';

/**
 * 
 * @export
 * @interface ContactSchema
 */
export interface ContactSchema {
    /**
     * 
     * @type {string}
     * @memberof ContactSchema
     */
    uniqueIdentifier: string;
    /**
     * 
     * @type {string}
     * @memberof ContactSchema
     */
    externalIdentifier: string;
    /**
     * 
     * @type {string}
     * @memberof ContactSchema
     */
    firstName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ContactSchema
     */
    middleName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ContactSchema
     */
    lastName?: string | null;
    /**
     * 
     * @type {string}
     * @memberof ContactSchema
     */
    suffix?: string | null;
    /**
     * 
     * @type {CivilityTitle}
     * @memberof ContactSchema
     */
    civilityTitle?: CivilityTitle | null;
    /**
     * 
     * @type {Gender}
     * @memberof ContactSchema
     */
    gender?: Gender | null;
    /**
     * 
     * @type {MaritalStatus}
     * @memberof ContactSchema
     */
    maritalStatus?: MaritalStatus | null;
    /**
     * 
     * @type {Date}
     * @memberof ContactSchema
     */
    dateOfBirth?: Date | null;
    /**
     * 
     * @type {ContactLanguage}
     * @memberof ContactSchema
     */
    language?: ContactLanguage | null;
    /**
     * 
     * @type {IncomeSchema}
     * @memberof ContactSchema
     */
    income?: IncomeSchema | null;
    /**
     * 
     * @type {SmokerStatus}
     * @memberof ContactSchema
     */
    smokerStatus?: SmokerStatus | null;
    /**
     * 
     * @type {Array<AddressSchema>}
     * @memberof ContactSchema
     */
    addresses: Array<AddressSchema>;
    /**
     * 
     * @type {Array<PhoneSchema>}
     * @memberof ContactSchema
     */
    phones: Array<PhoneSchema>;
    /**
     * 
     * @type {Array<EmailSchema>}
     * @memberof ContactSchema
     */
    emails: Array<EmailSchema>;
}



/**
 * Check if a given object implements the ContactSchema interface.
 */
export function instanceOfContactSchema(value: object): value is ContactSchema {
    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: any): ContactSchema {
    return ContactSchemaFromJSONTyped(json, false);
}

export function ContactSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContactSchema {
    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'] as Array<any>).map(AddressSchemaFromJSON)),
        'phones': ((json['phones'] as Array<any>).map(PhoneSchemaFromJSON)),
        'emails': ((json['emails'] as Array<any>).map(EmailSchemaFromJSON)),
    };
}

export function ContactSchemaToJSON(json: any): ContactSchema {
    return ContactSchemaToJSONTyped(json, false);
}

export function ContactSchemaToJSONTyped(value?: ContactSchema | null, ignoreDiscriminator: boolean = false): any {
    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'] as Array<any>).map(AddressSchemaToJSON)),
        'phones': ((value['phones'] as Array<any>).map(PhoneSchemaToJSON)),
        'emails': ((value['emails'] as Array<any>).map(EmailSchemaToJSON)),
    };
}

