/* tslint:disable */
/* eslint-disable */
/**
 * Screening AI API Docs
 * API Documentation for Screening AI
 *
 * The version of the OpenAPI document: 1.0
 * 
 *
 * 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 { CreatePlatformOrganisationBillingStripeSessionResponseDto } from './CreatePlatformOrganisationBillingStripeSessionResponseDto';
import {
    instanceOfCreatePlatformOrganisationBillingStripeSessionResponseDto,
    CreatePlatformOrganisationBillingStripeSessionResponseDtoFromJSON,
    CreatePlatformOrganisationBillingStripeSessionResponseDtoFromJSONTyped,
    CreatePlatformOrganisationBillingStripeSessionResponseDtoToJSON,
} from './CreatePlatformOrganisationBillingStripeSessionResponseDto';
import type { CreatePlatformScreeningSubmissionResponseDto } from './CreatePlatformScreeningSubmissionResponseDto';
import {
    instanceOfCreatePlatformScreeningSubmissionResponseDto,
    CreatePlatformScreeningSubmissionResponseDtoFromJSON,
    CreatePlatformScreeningSubmissionResponseDtoFromJSONTyped,
    CreatePlatformScreeningSubmissionResponseDtoToJSON,
} from './CreatePlatformScreeningSubmissionResponseDto';
import type { GetAllOrganisationMemberStatusOfOrgListResponseDto } from './GetAllOrganisationMemberStatusOfOrgListResponseDto';
import {
    instanceOfGetAllOrganisationMemberStatusOfOrgListResponseDto,
    GetAllOrganisationMemberStatusOfOrgListResponseDtoFromJSON,
    GetAllOrganisationMemberStatusOfOrgListResponseDtoFromJSONTyped,
    GetAllOrganisationMemberStatusOfOrgListResponseDtoToJSON,
} from './GetAllOrganisationMemberStatusOfOrgListResponseDto';
import type { GetAllPlatformScreeningTemplatesOfOrgResponseDto } from './GetAllPlatformScreeningTemplatesOfOrgResponseDto';
import {
    instanceOfGetAllPlatformScreeningTemplatesOfOrgResponseDto,
    GetAllPlatformScreeningTemplatesOfOrgResponseDtoFromJSON,
    GetAllPlatformScreeningTemplatesOfOrgResponseDtoFromJSONTyped,
    GetAllPlatformScreeningTemplatesOfOrgResponseDtoToJSON,
} from './GetAllPlatformScreeningTemplatesOfOrgResponseDto';
import type { GetOrganisationBillingViaOrgIdResponseDto } from './GetOrganisationBillingViaOrgIdResponseDto';
import {
    instanceOfGetOrganisationBillingViaOrgIdResponseDto,
    GetOrganisationBillingViaOrgIdResponseDtoFromJSON,
    GetOrganisationBillingViaOrgIdResponseDtoFromJSONTyped,
    GetOrganisationBillingViaOrgIdResponseDtoToJSON,
} from './GetOrganisationBillingViaOrgIdResponseDto';
import type { GetOrganisationMemberStatusResponseDto } from './GetOrganisationMemberStatusResponseDto';
import {
    instanceOfGetOrganisationMemberStatusResponseDto,
    GetOrganisationMemberStatusResponseDtoFromJSON,
    GetOrganisationMemberStatusResponseDtoFromJSONTyped,
    GetOrganisationMemberStatusResponseDtoToJSON,
} from './GetOrganisationMemberStatusResponseDto';
import type { GetPlatformOrganisationApiKeyResponseDto } from './GetPlatformOrganisationApiKeyResponseDto';
import {
    instanceOfGetPlatformOrganisationApiKeyResponseDto,
    GetPlatformOrganisationApiKeyResponseDtoFromJSON,
    GetPlatformOrganisationApiKeyResponseDtoFromJSONTyped,
    GetPlatformOrganisationApiKeyResponseDtoToJSON,
} from './GetPlatformOrganisationApiKeyResponseDto';
import type { PlatformOrganisationResponseDto } from './PlatformOrganisationResponseDto';
import {
    instanceOfPlatformOrganisationResponseDto,
    PlatformOrganisationResponseDtoFromJSON,
    PlatformOrganisationResponseDtoFromJSONTyped,
    PlatformOrganisationResponseDtoToJSON,
} from './PlatformOrganisationResponseDto';
import type { PlatformOrganisationsListResponseDto } from './PlatformOrganisationsListResponseDto';
import {
    instanceOfPlatformOrganisationsListResponseDto,
    PlatformOrganisationsListResponseDtoFromJSON,
    PlatformOrganisationsListResponseDtoFromJSONTyped,
    PlatformOrganisationsListResponseDtoToJSON,
} from './PlatformOrganisationsListResponseDto';
import type { PlatformScreeningJobListResponseDto } from './PlatformScreeningJobListResponseDto';
import {
    instanceOfPlatformScreeningJobListResponseDto,
    PlatformScreeningJobListResponseDtoFromJSON,
    PlatformScreeningJobListResponseDtoFromJSONTyped,
    PlatformScreeningJobListResponseDtoToJSON,
} from './PlatformScreeningJobListResponseDto';
import type { PlatformScreeningJobResponseDto } from './PlatformScreeningJobResponseDto';
import {
    instanceOfPlatformScreeningJobResponseDto,
    PlatformScreeningJobResponseDtoFromJSON,
    PlatformScreeningJobResponseDtoFromJSONTyped,
    PlatformScreeningJobResponseDtoToJSON,
} from './PlatformScreeningJobResponseDto';
import type { PlatformScreeningSubmissionCreateStreamRoomResponseDto } from './PlatformScreeningSubmissionCreateStreamRoomResponseDto';
import {
    instanceOfPlatformScreeningSubmissionCreateStreamRoomResponseDto,
    PlatformScreeningSubmissionCreateStreamRoomResponseDtoFromJSON,
    PlatformScreeningSubmissionCreateStreamRoomResponseDtoFromJSONTyped,
    PlatformScreeningSubmissionCreateStreamRoomResponseDtoToJSON,
} from './PlatformScreeningSubmissionCreateStreamRoomResponseDto';
import type { PlatformScreeningSubmissionListResponseDto } from './PlatformScreeningSubmissionListResponseDto';
import {
    instanceOfPlatformScreeningSubmissionListResponseDto,
    PlatformScreeningSubmissionListResponseDtoFromJSON,
    PlatformScreeningSubmissionListResponseDtoFromJSONTyped,
    PlatformScreeningSubmissionListResponseDtoToJSON,
} from './PlatformScreeningSubmissionListResponseDto';
import type { PlatformScreeningSubmissionResponseDto } from './PlatformScreeningSubmissionResponseDto';
import {
    instanceOfPlatformScreeningSubmissionResponseDto,
    PlatformScreeningSubmissionResponseDtoFromJSON,
    PlatformScreeningSubmissionResponseDtoFromJSONTyped,
    PlatformScreeningSubmissionResponseDtoToJSON,
} from './PlatformScreeningSubmissionResponseDto';
import type { PlatformScreeningSubmissionTextFromAudioResponseDto } from './PlatformScreeningSubmissionTextFromAudioResponseDto';
import {
    instanceOfPlatformScreeningSubmissionTextFromAudioResponseDto,
    PlatformScreeningSubmissionTextFromAudioResponseDtoFromJSON,
    PlatformScreeningSubmissionTextFromAudioResponseDtoFromJSONTyped,
    PlatformScreeningSubmissionTextFromAudioResponseDtoToJSON,
} from './PlatformScreeningSubmissionTextFromAudioResponseDto';
import type { PlatformUserJwtResponseDto } from './PlatformUserJwtResponseDto';
import {
    instanceOfPlatformUserJwtResponseDto,
    PlatformUserJwtResponseDtoFromJSON,
    PlatformUserJwtResponseDtoFromJSONTyped,
    PlatformUserJwtResponseDtoToJSON,
} from './PlatformUserJwtResponseDto';
import type { PlatformUserResponseDto } from './PlatformUserResponseDto';
import {
    instanceOfPlatformUserResponseDto,
    PlatformUserResponseDtoFromJSON,
    PlatformUserResponseDtoFromJSONTyped,
    PlatformUserResponseDtoToJSON,
} from './PlatformUserResponseDto';

/**
 * @type ApiResponseWrapperData
 * Actual response data
 * @export
 */
export type ApiResponseWrapperData = CreatePlatformOrganisationBillingStripeSessionResponseDto | CreatePlatformScreeningSubmissionResponseDto | GetAllOrganisationMemberStatusOfOrgListResponseDto | GetAllPlatformScreeningTemplatesOfOrgResponseDto | GetOrganisationBillingViaOrgIdResponseDto | GetOrganisationMemberStatusResponseDto | GetPlatformOrganisationApiKeyResponseDto | PlatformOrganisationResponseDto | PlatformOrganisationsListResponseDto | PlatformScreeningJobListResponseDto | PlatformScreeningJobResponseDto | PlatformScreeningSubmissionCreateStreamRoomResponseDto | PlatformScreeningSubmissionListResponseDto | PlatformScreeningSubmissionResponseDto | PlatformScreeningSubmissionTextFromAudioResponseDto | PlatformUserJwtResponseDto | PlatformUserResponseDto;

export function ApiResponseWrapperDataFromJSON(json: any): ApiResponseWrapperData {
    return ApiResponseWrapperDataFromJSONTyped(json, false);
}

export function ApiResponseWrapperDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiResponseWrapperData {
    if (json == null) {
        return json;
    }
    if (instanceOfCreatePlatformOrganisationBillingStripeSessionResponseDto(json)) {
        return CreatePlatformOrganisationBillingStripeSessionResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfCreatePlatformScreeningSubmissionResponseDto(json)) {
        return CreatePlatformScreeningSubmissionResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfGetAllOrganisationMemberStatusOfOrgListResponseDto(json)) {
        return GetAllOrganisationMemberStatusOfOrgListResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfGetAllPlatformScreeningTemplatesOfOrgResponseDto(json)) {
        return GetAllPlatformScreeningTemplatesOfOrgResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfGetOrganisationBillingViaOrgIdResponseDto(json)) {
        return GetOrganisationBillingViaOrgIdResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfGetOrganisationMemberStatusResponseDto(json)) {
        return GetOrganisationMemberStatusResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfGetPlatformOrganisationApiKeyResponseDto(json)) {
        return GetPlatformOrganisationApiKeyResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformOrganisationResponseDto(json)) {
        return PlatformOrganisationResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformOrganisationsListResponseDto(json)) {
        return PlatformOrganisationsListResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformScreeningJobListResponseDto(json)) {
        return PlatformScreeningJobListResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformScreeningJobResponseDto(json)) {
        return PlatformScreeningJobResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformScreeningSubmissionCreateStreamRoomResponseDto(json)) {
        return PlatformScreeningSubmissionCreateStreamRoomResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformScreeningSubmissionListResponseDto(json)) {
        return PlatformScreeningSubmissionListResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformScreeningSubmissionResponseDto(json)) {
        return PlatformScreeningSubmissionResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformScreeningSubmissionTextFromAudioResponseDto(json)) {
        return PlatformScreeningSubmissionTextFromAudioResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformUserJwtResponseDto(json)) {
        return PlatformUserJwtResponseDtoFromJSONTyped(json, true);
    }
    if (instanceOfPlatformUserResponseDto(json)) {
        return PlatformUserResponseDtoFromJSONTyped(json, true);
    }

    return {} as any;
}

export function ApiResponseWrapperDataToJSON(json: any): any {
    return ApiResponseWrapperDataToJSONTyped(json, false);
}

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

    if (instanceOfCreatePlatformOrganisationBillingStripeSessionResponseDto(value)) {
        return CreatePlatformOrganisationBillingStripeSessionResponseDtoToJSON(value as CreatePlatformOrganisationBillingStripeSessionResponseDto);
    }
    if (instanceOfCreatePlatformScreeningSubmissionResponseDto(value)) {
        return CreatePlatformScreeningSubmissionResponseDtoToJSON(value as CreatePlatformScreeningSubmissionResponseDto);
    }
    if (instanceOfGetAllOrganisationMemberStatusOfOrgListResponseDto(value)) {
        return GetAllOrganisationMemberStatusOfOrgListResponseDtoToJSON(value as GetAllOrganisationMemberStatusOfOrgListResponseDto);
    }
    if (instanceOfGetAllPlatformScreeningTemplatesOfOrgResponseDto(value)) {
        return GetAllPlatformScreeningTemplatesOfOrgResponseDtoToJSON(value as GetAllPlatformScreeningTemplatesOfOrgResponseDto);
    }
    if (instanceOfGetOrganisationBillingViaOrgIdResponseDto(value)) {
        return GetOrganisationBillingViaOrgIdResponseDtoToJSON(value as GetOrganisationBillingViaOrgIdResponseDto);
    }
    if (instanceOfGetOrganisationMemberStatusResponseDto(value)) {
        return GetOrganisationMemberStatusResponseDtoToJSON(value as GetOrganisationMemberStatusResponseDto);
    }
    if (instanceOfGetPlatformOrganisationApiKeyResponseDto(value)) {
        return GetPlatformOrganisationApiKeyResponseDtoToJSON(value as GetPlatformOrganisationApiKeyResponseDto);
    }
    if (instanceOfPlatformOrganisationResponseDto(value)) {
        return PlatformOrganisationResponseDtoToJSON(value as PlatformOrganisationResponseDto);
    }
    if (instanceOfPlatformOrganisationsListResponseDto(value)) {
        return PlatformOrganisationsListResponseDtoToJSON(value as PlatformOrganisationsListResponseDto);
    }
    if (instanceOfPlatformScreeningJobListResponseDto(value)) {
        return PlatformScreeningJobListResponseDtoToJSON(value as PlatformScreeningJobListResponseDto);
    }
    if (instanceOfPlatformScreeningJobResponseDto(value)) {
        return PlatformScreeningJobResponseDtoToJSON(value as PlatformScreeningJobResponseDto);
    }
    if (instanceOfPlatformScreeningSubmissionCreateStreamRoomResponseDto(value)) {
        return PlatformScreeningSubmissionCreateStreamRoomResponseDtoToJSON(value as PlatformScreeningSubmissionCreateStreamRoomResponseDto);
    }
    if (instanceOfPlatformScreeningSubmissionListResponseDto(value)) {
        return PlatformScreeningSubmissionListResponseDtoToJSON(value as PlatformScreeningSubmissionListResponseDto);
    }
    if (instanceOfPlatformScreeningSubmissionResponseDto(value)) {
        return PlatformScreeningSubmissionResponseDtoToJSON(value as PlatformScreeningSubmissionResponseDto);
    }
    if (instanceOfPlatformScreeningSubmissionTextFromAudioResponseDto(value)) {
        return PlatformScreeningSubmissionTextFromAudioResponseDtoToJSON(value as PlatformScreeningSubmissionTextFromAudioResponseDto);
    }
    if (instanceOfPlatformUserJwtResponseDto(value)) {
        return PlatformUserJwtResponseDtoToJSON(value as PlatformUserJwtResponseDto);
    }
    if (instanceOfPlatformUserResponseDto(value)) {
        return PlatformUserResponseDtoToJSON(value as PlatformUserResponseDto);
    }

    return {};
}

