/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AddUserRequest } from '../models/AddUserRequest';
import type { AddUserResponse } from '../models/AddUserResponse';
import type { CreateDepartmentRequest } from '../models/CreateDepartmentRequest';
import type { CreateDepartmentResponse } from '../models/CreateDepartmentResponse';
import type { CreateDepartmentSectionRequest } from '../models/CreateDepartmentSectionRequest';
import type { CreateDepartmentSectionResponse } from '../models/CreateDepartmentSectionResponse';
import type { DeleteDepartmentResponse } from '../models/DeleteDepartmentResponse';
import type { DeleteDepartmentSectionResponse } from '../models/DeleteDepartmentSectionResponse';
import type { DeleteUserRequest } from '../models/DeleteUserRequest';
import type { DeleteUserResponse } from '../models/DeleteUserResponse';
import type { GetAvailableUsersForDepartmentSectionResponse } from '../models/GetAvailableUsersForDepartmentSectionResponse';
import type { GetDepartmentSectionsResponse } from '../models/GetDepartmentSectionsResponse';
import type { GetDepartmentsResponse } from '../models/GetDepartmentsResponse';
import type { UpdateDepartmentRequest } from '../models/UpdateDepartmentRequest';
import type { UpdateDepartmentResponse } from '../models/UpdateDepartmentResponse';
import type { UpdateDepartmentSectionRequest } from '../models/UpdateDepartmentSectionRequest';
import type { UpdateDepartmentSectionResponse } from '../models/UpdateDepartmentSectionResponse';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class DepartmentService {
    /**
     * Get Departments
     * @returns GetDepartmentsResponse Successful Response
     * @throws ApiError
     */
    public static getDepartments(): CancelablePromise<GetDepartmentsResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/department/',
        });
    }
    /**
     * Create Department
     * @returns CreateDepartmentResponse Successful Response
     * @throws ApiError
     */
    public static createDepartment({
        requestBody,
    }: {
        requestBody: CreateDepartmentRequest,
    }): CancelablePromise<CreateDepartmentResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/department/',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Update Department
     * @returns UpdateDepartmentResponse Successful Response
     * @throws ApiError
     */
    public static updateDepartment({
        requestBody,
    }: {
        requestBody: UpdateDepartmentRequest,
    }): CancelablePromise<UpdateDepartmentResponse> {
        return __request(OpenAPI, {
            method: 'PATCH',
            url: '/department/',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Delete Department
     * @returns DeleteDepartmentResponse Successful Response
     * @throws ApiError
     */
    public static deleteDepartment({
        departmentId,
    }: {
        departmentId: number,
    }): CancelablePromise<DeleteDepartmentResponse> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/department/{department_id}',
            path: {
                'department_id': departmentId,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Sections
     * @returns GetDepartmentSectionsResponse Successful Response
     * @throws ApiError
     */
    public static getSections(): CancelablePromise<GetDepartmentSectionsResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/department/section',
        });
    }
    /**
     * Create Section
     * @returns CreateDepartmentSectionResponse Successful Response
     * @throws ApiError
     */
    public static createSection({
        requestBody,
    }: {
        requestBody: CreateDepartmentSectionRequest,
    }): CancelablePromise<CreateDepartmentSectionResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/department/section',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Update Section
     * @returns UpdateDepartmentSectionResponse Successful Response
     * @throws ApiError
     */
    public static updateSection({
        requestBody,
    }: {
        requestBody: UpdateDepartmentSectionRequest,
    }): CancelablePromise<UpdateDepartmentSectionResponse> {
        return __request(OpenAPI, {
            method: 'PATCH',
            url: '/department/section',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Delete Section
     * @returns DeleteDepartmentSectionResponse Successful Response
     * @throws ApiError
     */
    public static deleteSection({
        sectionId,
    }: {
        sectionId: number,
    }): CancelablePromise<DeleteDepartmentSectionResponse> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/department/section/{section_id}',
            path: {
                'section_id': sectionId,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Available Users For Department Section
     * @returns GetAvailableUsersForDepartmentSectionResponse Successful Response
     * @throws ApiError
     */
    public static getAvailableUsersForSection({
        sectionId,
    }: {
        sectionId: number,
    }): CancelablePromise<GetAvailableUsersForDepartmentSectionResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/department/users/{section_id}',
            path: {
                'section_id': sectionId,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Add User
     * @returns AddUserResponse Successful Response
     * @throws ApiError
     */
    public static addUser({
        requestBody,
    }: {
        requestBody: AddUserRequest,
    }): CancelablePromise<AddUserResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/department/users',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Delete User
     * @returns DeleteUserResponse Successful Response
     * @throws ApiError
     */
    public static deleteUser({
        requestBody,
    }: {
        requestBody: DeleteUserRequest,
    }): CancelablePromise<DeleteUserResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/department/users/delete',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
}
