/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateTransactionTagRequest } from '../models/CreateTransactionTagRequest';
import type { DeleteTransactionResponse } from '../models/DeleteTransactionResponse';
import type { DeleteTransactionTagResponse } from '../models/DeleteTransactionTagResponse';
import type { GetAllTransactionsRequest } from '../models/GetAllTransactionsRequest';
import type { GetAllTransactionsResponse } from '../models/GetAllTransactionsResponse';
import type { GetAllTransactionTagsResponse } from '../models/GetAllTransactionTagsResponse';
import type { GetTransactionTagsResponse } from '../models/GetTransactionTagsResponse';
import type { UpdateTransactionRequest } from '../models/UpdateTransactionRequest';
import type { UpdateTransactionResponse } from '../models/UpdateTransactionResponse';
import type { UpdateTransactionTagRequest } from '../models/UpdateTransactionTagRequest';
import type { UpdateTransactionTagResponse } from '../models/UpdateTransactionTagResponse';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class TransactionService {
    /**
     * Get All
     * @returns GetAllTransactionsResponse Successful Response
     * @throws ApiError
     */
    public static getAllTransactions({
        requestBody,
        page,
        itemsPerPage,
    }: {
        requestBody: GetAllTransactionsRequest,
        page?: (number | null),
        itemsPerPage?: (number | null),
    }): CancelablePromise<GetAllTransactionsResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/transaction/get-all',
            query: {
                'page': page,
                'items_per_page': itemsPerPage,
            },
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Update Transaction
     * @returns UpdateTransactionResponse Successful Response
     * @throws ApiError
     */
    public static updateTransaction({
        requestBody,
    }: {
        requestBody: UpdateTransactionRequest,
    }): CancelablePromise<UpdateTransactionResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/transaction/update',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Delete Transaction
     * @returns DeleteTransactionResponse Successful Response
     * @throws ApiError
     */
    public static deleteTransaction({
        transactionId,
    }: {
        transactionId: number,
    }): CancelablePromise<DeleteTransactionResponse> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/transaction/delete/{transaction_id}',
            path: {
                'transaction_id': transactionId,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get All Transaction Tags
     * @returns GetAllTransactionTagsResponse Successful Response
     * @throws ApiError
     */
    public static getAllTransactionTags(): CancelablePromise<GetAllTransactionTagsResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/transaction/get-all-tags',
        });
    }
    /**
     * Get Transaction Tags
     * @returns GetTransactionTagsResponse Successful Response
     * @throws ApiError
     */
    public static getTransactionTags({
        isIncome,
    }: {
        isIncome: boolean,
    }): CancelablePromise<GetTransactionTagsResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/transaction/get-tags/{is_income}',
            path: {
                'is_income': isIncome,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Create Transaction Tag
     * @returns UpdateTransactionTagResponse Successful Response
     * @throws ApiError
     */
    public static createTransactionTag({
        requestBody,
    }: {
        requestBody: CreateTransactionTagRequest,
    }): CancelablePromise<UpdateTransactionTagResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/transaction/create-tag',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Update Transaction Tag
     * @returns UpdateTransactionTagResponse Successful Response
     * @throws ApiError
     */
    public static updateTransactionTag({
        requestBody,
    }: {
        requestBody: UpdateTransactionTagRequest,
    }): CancelablePromise<UpdateTransactionTagResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/transaction/update-tag',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Update Transaction Tag
     * @returns DeleteTransactionTagResponse Successful Response
     * @throws ApiError
     */
    public static deleteTransactionTag({
        tagId,
    }: {
        tagId: number,
    }): CancelablePromise<DeleteTransactionTagResponse> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/transaction/delete-tag/{tag_id}',
            path: {
                'tag_id': tagId,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
}
