/* 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 { Status } from './Status';
import {
    StatusFromJSON,
    StatusFromJSONTyped,
    StatusToJSON,
    StatusToJSONTyped,
} from './Status';
import type { ContactSchema } from './ContactSchema';
import {
    ContactSchemaFromJSON,
    ContactSchemaFromJSONTyped,
    ContactSchemaToJSON,
    ContactSchemaToJSONTyped,
} from './ContactSchema';
import type { ErrorResponse } from './ErrorResponse';
import {
    ErrorResponseFromJSON,
    ErrorResponseFromJSONTyped,
    ErrorResponseToJSON,
    ErrorResponseToJSONTyped,
} from './ErrorResponse';

/**
 * 
 * @export
 * @interface SourceResultSchema
 */
export interface SourceResultSchema {
    /**
     * 
     * @type {Status}
     * @memberof SourceResultSchema
     */
    status: Status;
    /**
     * 
     * @type {string}
     * @memberof SourceResultSchema
     */
    sourceKey: string;
    /**
     * 
     * @type {ErrorResponse}
     * @memberof SourceResultSchema
     */
    errorResponse?: ErrorResponse | null;
    /**
     * 
     * @type {Array<ContactSchema>}
     * @memberof SourceResultSchema
     */
    sourceResults?: Array<ContactSchema> | null;
    /**
     * 
     * @type {number}
     * @memberof SourceResultSchema
     */
    totalCount?: number | null;
}



/**
 * Check if a given object implements the SourceResultSchema interface.
 */
export function instanceOfSourceResultSchema(value: object): value is SourceResultSchema {
    if (!('status' in value) || value['status'] === undefined) return false;
    if (!('sourceKey' in value) || value['sourceKey'] === undefined) return false;
    return true;
}

export function SourceResultSchemaFromJSON(json: any): SourceResultSchema {
    return SourceResultSchemaFromJSONTyped(json, false);
}

export function SourceResultSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceResultSchema {
    if (json == null) {
        return json;
    }
    return {
        
        'status': StatusFromJSON(json['status']),
        'sourceKey': json['sourceKey'],
        'errorResponse': json['errorResponse'] == null ? undefined : ErrorResponseFromJSON(json['errorResponse']),
        'sourceResults': json['sourceResults'] == null ? undefined : ((json['sourceResults'] as Array<any>).map(ContactSchemaFromJSON)),
        'totalCount': json['totalCount'] == null ? undefined : json['totalCount'],
    };
}

export function SourceResultSchemaToJSON(json: any): SourceResultSchema {
    return SourceResultSchemaToJSONTyped(json, false);
}

export function SourceResultSchemaToJSONTyped(value?: SourceResultSchema | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'status': StatusToJSON(value['status']),
        'sourceKey': value['sourceKey'],
        'errorResponse': ErrorResponseToJSON(value['errorResponse']),
        'sourceResults': value['sourceResults'] == null ? undefined : ((value['sourceResults'] as Array<any>).map(ContactSchemaToJSON)),
        'totalCount': value['totalCount'],
    };
}

