/* tslint:disable */
/* eslint-disable */
/**
 * Ringer Business API
 * This API provides comprehensive endpoints for the Ringer Business system. It includes functionality for managing customer accounts, addresses, sites,  phone numbers, payments, users, and other business resources.  Operations typically require authentication and appropriate permissions. 
 *
 * The version of the OpenAPI document: 1.0.5
 * Contact: support@ringer.tel
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import type { SiteDestination } from './SiteDestination';
import {
    instanceOfSiteDestination,
    SiteDestinationFromJSON,
    SiteDestinationFromJSONTyped,
    SiteDestinationToJSON,
} from './SiteDestination';

/**
 * @type PhoneNumberResponseAllOfFailOverDestination
 * 
 * @export
 */
export type PhoneNumberResponseAllOfFailOverDestination = SiteDestination | object;

export function PhoneNumberResponseAllOfFailOverDestinationFromJSON(json: any): PhoneNumberResponseAllOfFailOverDestination {
    return PhoneNumberResponseAllOfFailOverDestinationFromJSONTyped(json, false);
}

export function PhoneNumberResponseAllOfFailOverDestinationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PhoneNumberResponseAllOfFailOverDestination {
    if (json == null) {
        return json;
    }
    if (typeof json !== 'object') {
        return json;
    }
    if (instanceOfSiteDestination(json)) {
        return SiteDestinationFromJSONTyped(json, true);
    }

    return {} as any;
}

export function PhoneNumberResponseAllOfFailOverDestinationToJSON(json: any): any {
    return PhoneNumberResponseAllOfFailOverDestinationToJSONTyped(json, false);
}

export function PhoneNumberResponseAllOfFailOverDestinationToJSONTyped(value?: PhoneNumberResponseAllOfFailOverDestination | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }
    if (typeof value !== 'object') {
        return value;
    }
    if (instanceOfSiteDestination(value)) {
        return SiteDestinationToJSON(value as SiteDestination);
    }

    return {};
}

