/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateAttributeRequest } from '../models/CreateAttributeRequest';
import type { CreateAttributeResponse } from '../models/CreateAttributeResponse';
import type { DeleteAttributeResponse } from '../models/DeleteAttributeResponse';
import type { GetAttributesResponse } from '../models/GetAttributesResponse';
import type { GetAttributeTypesResponse } from '../models/GetAttributeTypesResponse';
import type { UpdateAttributeRequest } from '../models/UpdateAttributeRequest';
import type { UpdateAttributeResponse } from '../models/UpdateAttributeResponse';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class AttributeService {
    /**
     * Get All
     * @returns GetAttributesResponse Successful Response
     * @throws ApiError
     */
    public static getAll(): CancelablePromise<GetAttributesResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/attribute/',
        });
    }
    /**
     * Create
     * @returns CreateAttributeResponse Successful Response
     * @throws ApiError
     */
    public static create({
        requestBody,
    }: {
        requestBody: CreateAttributeRequest,
    }): CancelablePromise<CreateAttributeResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/attribute/',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Update
     * @returns UpdateAttributeResponse Successful Response
     * @throws ApiError
     */
    public static update({
        requestBody,
    }: {
        requestBody: UpdateAttributeRequest,
    }): CancelablePromise<UpdateAttributeResponse> {
        return __request(OpenAPI, {
            method: 'PATCH',
            url: '/attribute/',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Types
     * @returns GetAttributeTypesResponse Successful Response
     * @throws ApiError
     */
    public static getTypes(): CancelablePromise<GetAttributeTypesResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/attribute/types',
        });
    }
    /**
     * Delete
     * @returns DeleteAttributeResponse Successful Response
     * @throws ApiError
     */
    public static delete({
        attributeId,
    }: {
        attributeId: number,
    }): CancelablePromise<DeleteAttributeResponse> {
        return __request(OpenAPI, {
            method: 'DELETE',
            url: '/attribute/{attribute_id}',
            path: {
                'attribute_id': attributeId,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
}
