/* 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 * as runtime from '../runtime';
import type {
  ApiResponseWrapper,
  PlatformCreateScreeningJobDto,
} from '../models/index';
import {
    ApiResponseWrapperFromJSON,
    ApiResponseWrapperToJSON,
    PlatformCreateScreeningJobDtoFromJSON,
    PlatformCreateScreeningJobDtoToJSON,
} from '../models/index';

export interface PlatformScreeningJobsControllerCreateScreeningJobRequest {
    platformCreateScreeningJobDto: PlatformCreateScreeningJobDto;
}

export interface PlatformScreeningJobsControllerGetScreeningJobUsingIdRequest {
    screeningJobId: string;
}

/**
 * 
 */
export class PlatformScreeningJobsApi extends runtime.BaseAPI {

    /**
     * Create a new Screening Job
     */
    async platformScreeningJobsControllerCreateScreeningJobRaw(requestParameters: PlatformScreeningJobsControllerCreateScreeningJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiResponseWrapper>> {
        if (requestParameters['platformCreateScreeningJobDto'] == null) {
            throw new runtime.RequiredError(
                'platformCreateScreeningJobDto',
                'Required parameter "platformCreateScreeningJobDto" was null or undefined when calling platformScreeningJobsControllerCreateScreeningJob().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // X-API-KEY authentication
        }

        const response = await this.request({
            path: `/api/v2/platform/platform-screening-job`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: PlatformCreateScreeningJobDtoToJSON(requestParameters['platformCreateScreeningJobDto']),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => ApiResponseWrapperFromJSON(jsonValue));
    }

    /**
     * Create a new Screening Job
     */
    async platformScreeningJobsControllerCreateScreeningJob(requestParameters: PlatformScreeningJobsControllerCreateScreeningJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiResponseWrapper> {
        const response = await this.platformScreeningJobsControllerCreateScreeningJobRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Get Screening Job using Id
     */
    async platformScreeningJobsControllerGetScreeningJobUsingIdRaw(requestParameters: PlatformScreeningJobsControllerGetScreeningJobUsingIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiResponseWrapper>> {
        if (requestParameters['screeningJobId'] == null) {
            throw new runtime.RequiredError(
                'screeningJobId',
                'Required parameter "screeningJobId" was null or undefined when calling platformScreeningJobsControllerGetScreeningJobUsingId().'
            );
        }

        const queryParameters: any = {};

        if (requestParameters['screeningJobId'] != null) {
            queryParameters['screeningJobId'] = requestParameters['screeningJobId'];
        }

        const headerParameters: runtime.HTTPHeaders = {};

        const response = await this.request({
            path: `/api/v2/platform/platform-screening-job/id`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => ApiResponseWrapperFromJSON(jsonValue));
    }

    /**
     * Get Screening Job using Id
     */
    async platformScreeningJobsControllerGetScreeningJobUsingId(requestParameters: PlatformScreeningJobsControllerGetScreeningJobUsingIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiResponseWrapper> {
        const response = await this.platformScreeningJobsControllerGetScreeningJobUsingIdRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Get all Screening Jobs of Organisation
     */
    async platformScreeningJobsControllerGetScreeningJobsOfOrgRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApiResponseWrapper>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // X-API-KEY authentication
        }

        const response = await this.request({
            path: `/api/v2/platform/platform-screening-job/org`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => ApiResponseWrapperFromJSON(jsonValue));
    }

    /**
     * Get all Screening Jobs of Organisation
     */
    async platformScreeningJobsControllerGetScreeningJobsOfOrg(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApiResponseWrapper> {
        const response = await this.platformScreeningJobsControllerGetScreeningJobsOfOrgRaw(initOverrides);
        return await response.value();
    }

}
