/* tslint:disable */
/* eslint-disable */
/**
 * OmsorgCore.Api
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * 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 {
  CreateFacilityQualificationRateRequest,
  FacilityQualificationRateResponse,
  UpdateFacilityQualificationRateRequest,
} from '../models/index';
import {
    CreateFacilityQualificationRateRequestFromJSON,
    CreateFacilityQualificationRateRequestToJSON,
    FacilityQualificationRateResponseFromJSON,
    FacilityQualificationRateResponseToJSON,
    UpdateFacilityQualificationRateRequestFromJSON,
    UpdateFacilityQualificationRateRequestToJSON,
} from '../models/index';

export interface ApiFacilitiesFacilityIdQualificationRatesGetRequest {
    facilityId: string;
}

export interface ApiFacilitiesFacilityIdQualificationRatesIdDeleteRequest {
    facilityId: string;
    id: string;
}

export interface ApiFacilitiesFacilityIdQualificationRatesIdPutRequest {
    facilityId: string;
    id: string;
    updateFacilityQualificationRateRequest?: UpdateFacilityQualificationRateRequest;
}

export interface ApiFacilitiesFacilityIdQualificationRatesPostRequest {
    facilityId: string;
    createFacilityQualificationRateRequest?: CreateFacilityQualificationRateRequest;
}

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

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesGetRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FacilityQualificationRateResponse>>> {
        if (requestParameters['facilityId'] == null) {
            throw new runtime.RequiredError(
                'facilityId',
                'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesGet().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("Bearer", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/facilities/{facilityId}/qualification-rates`;
        urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));

        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

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

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesGet(requestParameters: ApiFacilitiesFacilityIdQualificationRatesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FacilityQualificationRateResponse>> {
        const response = await this.apiFacilitiesFacilityIdQualificationRatesGetRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesIdDeleteRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        if (requestParameters['facilityId'] == null) {
            throw new runtime.RequiredError(
                'facilityId',
                'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdDelete().'
            );
        }

        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError(
                'id',
                'Required parameter "id" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdDelete().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("Bearer", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/facilities/{facilityId}/qualification-rates/{id}`;
        urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));

        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesIdDelete(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.apiFacilitiesFacilityIdQualificationRatesIdDeleteRaw(requestParameters, initOverrides);
    }

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesIdPutRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FacilityQualificationRateResponse>> {
        if (requestParameters['facilityId'] == null) {
            throw new runtime.RequiredError(
                'facilityId',
                'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdPut().'
            );
        }

        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError(
                'id',
                'Required parameter "id" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdPut().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("Bearer", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/facilities/{facilityId}/qualification-rates/{id}`;
        urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));

        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: UpdateFacilityQualificationRateRequestToJSON(requestParameters['updateFacilityQualificationRateRequest']),
        }, initOverrides);

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

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesIdPut(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FacilityQualificationRateResponse> {
        const response = await this.apiFacilitiesFacilityIdQualificationRatesIdPutRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesPostRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FacilityQualificationRateResponse>> {
        if (requestParameters['facilityId'] == null) {
            throw new runtime.RequiredError(
                'facilityId',
                'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesPost().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("Bearer", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/facilities/{facilityId}/qualification-rates`;
        urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));

        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateFacilityQualificationRateRequestToJSON(requestParameters['createFacilityQualificationRateRequest']),
        }, initOverrides);

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

    /**
     */
    async apiFacilitiesFacilityIdQualificationRatesPost(requestParameters: ApiFacilitiesFacilityIdQualificationRatesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FacilityQualificationRateResponse> {
        const response = await this.apiFacilitiesFacilityIdQualificationRatesPostRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
