/* 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 {
  AssignmentValidationSettingsResponse,
  UpdateAssignmentValidationSettingsRequest,
} from '../models/index';
import {
    AssignmentValidationSettingsResponseFromJSON,
    AssignmentValidationSettingsResponseToJSON,
    UpdateAssignmentValidationSettingsRequestFromJSON,
    UpdateAssignmentValidationSettingsRequestToJSON,
} from '../models/index';

export interface ApiSettingsAssignmentValidationPutRequest {
    updateAssignmentValidationSettingsRequest?: UpdateAssignmentValidationSettingsRequest;
}

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

    /**
     */
    async apiSettingsAssignmentValidationGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssignmentValidationSettingsResponse>> {
        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/settings/assignment-validation`;

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

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

    /**
     */
    async apiSettingsAssignmentValidationGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssignmentValidationSettingsResponse> {
        const response = await this.apiSettingsAssignmentValidationGetRaw(initOverrides);
        return await response.value();
    }

    /**
     */
    async apiSettingsAssignmentValidationPutRaw(requestParameters: ApiSettingsAssignmentValidationPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AssignmentValidationSettingsResponse>> {
        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/settings/assignment-validation`;

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

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

    /**
     */
    async apiSettingsAssignmentValidationPut(requestParameters: ApiSettingsAssignmentValidationPutRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AssignmentValidationSettingsResponse> {
        const response = await this.apiSettingsAssignmentValidationPutRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
