/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.0-rc1
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import type {
    ConnectionToken,
    ConnectionTokenRequest,
    Endpoint,
    EndpointRequest,
    PaginatedConnectionTokenList,
    PaginatedEndpointList,
    PatchedConnectionTokenRequest,
    PatchedEndpointRequest,
    UsedBy,
} from "../models/index";
import {
    ConnectionTokenFromJSON,
    ConnectionTokenRequestToJSON,
    EndpointFromJSON,
    EndpointRequestToJSON,
    PaginatedConnectionTokenListFromJSON,
    PaginatedEndpointListFromJSON,
    PatchedConnectionTokenRequestToJSON,
    PatchedEndpointRequestToJSON,
    UsedByFromJSON,
} from "../models/index";
import * as runtime from "../runtime";

export interface RacConnectionTokensDestroyRequest {
    connectionTokenUuid: string;
}

export interface RacConnectionTokensListRequest {
    endpoint?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    provider?: number;
    search?: string;
    sessionUser?: number;
}

export interface RacConnectionTokensPartialUpdateRequest {
    connectionTokenUuid: string;
    patchedConnectionTokenRequest?: PatchedConnectionTokenRequest;
}

export interface RacConnectionTokensRetrieveRequest {
    connectionTokenUuid: string;
}

export interface RacConnectionTokensUpdateRequest {
    connectionTokenUuid: string;
    connectionTokenRequest: ConnectionTokenRequest;
}

export interface RacConnectionTokensUsedByListRequest {
    connectionTokenUuid: string;
}

export interface RacEndpointsCreateRequest {
    endpointRequest: EndpointRequest;
}

export interface RacEndpointsDestroyRequest {
    pbmUuid: string;
}

export interface RacEndpointsListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    provider?: number;
    search?: string;
    superuserFullList?: boolean;
}

export interface RacEndpointsPartialUpdateRequest {
    pbmUuid: string;
    patchedEndpointRequest?: PatchedEndpointRequest;
}

export interface RacEndpointsRetrieveRequest {
    pbmUuid: string;
}

export interface RacEndpointsUpdateRequest {
    pbmUuid: string;
    endpointRequest: EndpointRequest;
}

export interface RacEndpointsUsedByListRequest {
    pbmUuid: string;
}

/**
 *
 */
export class RacApi extends runtime.BaseAPI {
    /**
     * Creates request options for racConnectionTokensDestroy without sending the request
     */
    async racConnectionTokensDestroyRequestOpts(
        requestParameters: RacConnectionTokensDestroyRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["connectionTokenUuid"] == null) {
            throw new runtime.RequiredError(
                "connectionTokenUuid",
                'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensDestroy().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/connection_tokens/{connection_token_uuid}/`;
        urlPath = urlPath.replace(
            `{${"connection_token_uuid"}}`,
            encodeURIComponent(String(requestParameters["connectionTokenUuid"])),
        );

        return {
            path: urlPath,
            method: "DELETE",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensDestroyRaw(
        requestParameters: RacConnectionTokensDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.racConnectionTokensDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensDestroy(
        requestParameters: RacConnectionTokensDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.racConnectionTokensDestroyRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for racConnectionTokensList without sending the request
     */
    async racConnectionTokensListRequestOpts(
        requestParameters: RacConnectionTokensListRequest,
    ): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        if (requestParameters["endpoint"] != null) {
            queryParameters["endpoint"] = requestParameters["endpoint"];
        }

        if (requestParameters["ordering"] != null) {
            queryParameters["ordering"] = requestParameters["ordering"];
        }

        if (requestParameters["page"] != null) {
            queryParameters["page"] = requestParameters["page"];
        }

        if (requestParameters["pageSize"] != null) {
            queryParameters["page_size"] = requestParameters["pageSize"];
        }

        if (requestParameters["provider"] != null) {
            queryParameters["provider"] = requestParameters["provider"];
        }

        if (requestParameters["search"] != null) {
            queryParameters["search"] = requestParameters["search"];
        }

        if (requestParameters["sessionUser"] != null) {
            queryParameters["session__user"] = requestParameters["sessionUser"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/connection_tokens/`;

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensListRaw(
        requestParameters: RacConnectionTokensListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedConnectionTokenList>> {
        const requestOptions = await this.racConnectionTokensListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensList(
        requestParameters: RacConnectionTokensListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedConnectionTokenList> {
        const response = await this.racConnectionTokensListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for racConnectionTokensPartialUpdate without sending the request
     */
    async racConnectionTokensPartialUpdateRequestOpts(
        requestParameters: RacConnectionTokensPartialUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["connectionTokenUuid"] == null) {
            throw new runtime.RequiredError(
                "connectionTokenUuid",
                'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensPartialUpdate().',
            );
        }

        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("authentik", []);

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

        let urlPath = `/rac/connection_tokens/{connection_token_uuid}/`;
        urlPath = urlPath.replace(
            `{${"connection_token_uuid"}}`,
            encodeURIComponent(String(requestParameters["connectionTokenUuid"])),
        );

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedConnectionTokenRequestToJSON(
                requestParameters["patchedConnectionTokenRequest"],
            ),
        };
    }

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensPartialUpdateRaw(
        requestParameters: RacConnectionTokensPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ConnectionToken>> {
        const requestOptions =
            await this.racConnectionTokensPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensPartialUpdate(
        requestParameters: RacConnectionTokensPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ConnectionToken> {
        const response = await this.racConnectionTokensPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

    /**
     * Creates request options for racConnectionTokensRetrieve without sending the request
     */
    async racConnectionTokensRetrieveRequestOpts(
        requestParameters: RacConnectionTokensRetrieveRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["connectionTokenUuid"] == null) {
            throw new runtime.RequiredError(
                "connectionTokenUuid",
                'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensRetrieve().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/connection_tokens/{connection_token_uuid}/`;
        urlPath = urlPath.replace(
            `{${"connection_token_uuid"}}`,
            encodeURIComponent(String(requestParameters["connectionTokenUuid"])),
        );

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensRetrieveRaw(
        requestParameters: RacConnectionTokensRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ConnectionToken>> {
        const requestOptions = await this.racConnectionTokensRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensRetrieve(
        requestParameters: RacConnectionTokensRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ConnectionToken> {
        const response = await this.racConnectionTokensRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

    /**
     * Creates request options for racConnectionTokensUpdate without sending the request
     */
    async racConnectionTokensUpdateRequestOpts(
        requestParameters: RacConnectionTokensUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["connectionTokenUuid"] == null) {
            throw new runtime.RequiredError(
                "connectionTokenUuid",
                'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensUpdate().',
            );
        }

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

        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("authentik", []);

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

        let urlPath = `/rac/connection_tokens/{connection_token_uuid}/`;
        urlPath = urlPath.replace(
            `{${"connection_token_uuid"}}`,
            encodeURIComponent(String(requestParameters["connectionTokenUuid"])),
        );

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: ConnectionTokenRequestToJSON(requestParameters["connectionTokenRequest"]),
        };
    }

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensUpdateRaw(
        requestParameters: RacConnectionTokensUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ConnectionToken>> {
        const requestOptions = await this.racConnectionTokensUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensUpdate(
        requestParameters: RacConnectionTokensUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ConnectionToken> {
        const response = await this.racConnectionTokensUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for racConnectionTokensUsedByList without sending the request
     */
    async racConnectionTokensUsedByListRequestOpts(
        requestParameters: RacConnectionTokensUsedByListRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["connectionTokenUuid"] == null) {
            throw new runtime.RequiredError(
                "connectionTokenUuid",
                'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensUsedByList().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/connection_tokens/{connection_token_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"connection_token_uuid"}}`,
            encodeURIComponent(String(requestParameters["connectionTokenUuid"])),
        );

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Get a list of all objects that use this object
     */
    async racConnectionTokensUsedByListRaw(
        requestParameters: RacConnectionTokensUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.racConnectionTokensUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async racConnectionTokensUsedByList(
        requestParameters: RacConnectionTokensUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.racConnectionTokensUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

    /**
     * Creates request options for racEndpointsCreate without sending the request
     */
    async racEndpointsCreateRequestOpts(
        requestParameters: RacEndpointsCreateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["endpointRequest"] == null) {
            throw new runtime.RequiredError(
                "endpointRequest",
                'Required parameter "endpointRequest" was null or undefined when calling racEndpointsCreate().',
            );
        }

        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("authentik", []);

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

        let urlPath = `/rac/endpoints/`;

        return {
            path: urlPath,
            method: "POST",
            headers: headerParameters,
            query: queryParameters,
            body: EndpointRequestToJSON(requestParameters["endpointRequest"]),
        };
    }

    /**
     * Endpoint Viewset
     */
    async racEndpointsCreateRaw(
        requestParameters: RacEndpointsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Endpoint>> {
        const requestOptions = await this.racEndpointsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Endpoint Viewset
     */
    async racEndpointsCreate(
        requestParameters: RacEndpointsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Endpoint> {
        const response = await this.racEndpointsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for racEndpointsDestroy without sending the request
     */
    async racEndpointsDestroyRequestOpts(
        requestParameters: RacEndpointsDestroyRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["pbmUuid"] == null) {
            throw new runtime.RequiredError(
                "pbmUuid",
                'Required parameter "pbmUuid" was null or undefined when calling racEndpointsDestroy().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/endpoints/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

        return {
            path: urlPath,
            method: "DELETE",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Endpoint Viewset
     */
    async racEndpointsDestroyRaw(
        requestParameters: RacEndpointsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.racEndpointsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Endpoint Viewset
     */
    async racEndpointsDestroy(
        requestParameters: RacEndpointsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.racEndpointsDestroyRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for racEndpointsList without sending the request
     */
    async racEndpointsListRequestOpts(
        requestParameters: RacEndpointsListRequest,
    ): Promise<runtime.RequestOpts> {
        const queryParameters: any = {};

        if (requestParameters["name"] != null) {
            queryParameters["name"] = requestParameters["name"];
        }

        if (requestParameters["ordering"] != null) {
            queryParameters["ordering"] = requestParameters["ordering"];
        }

        if (requestParameters["page"] != null) {
            queryParameters["page"] = requestParameters["page"];
        }

        if (requestParameters["pageSize"] != null) {
            queryParameters["page_size"] = requestParameters["pageSize"];
        }

        if (requestParameters["provider"] != null) {
            queryParameters["provider"] = requestParameters["provider"];
        }

        if (requestParameters["search"] != null) {
            queryParameters["search"] = requestParameters["search"];
        }

        if (requestParameters["superuserFullList"] != null) {
            queryParameters["superuser_full_list"] = requestParameters["superuserFullList"];
        }

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/endpoints/`;

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * List accessible endpoints
     */
    async racEndpointsListRaw(
        requestParameters: RacEndpointsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedEndpointList>> {
        const requestOptions = await this.racEndpointsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * List accessible endpoints
     */
    async racEndpointsList(
        requestParameters: RacEndpointsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedEndpointList> {
        const response = await this.racEndpointsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for racEndpointsPartialUpdate without sending the request
     */
    async racEndpointsPartialUpdateRequestOpts(
        requestParameters: RacEndpointsPartialUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["pbmUuid"] == null) {
            throw new runtime.RequiredError(
                "pbmUuid",
                'Required parameter "pbmUuid" was null or undefined when calling racEndpointsPartialUpdate().',
            );
        }

        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("authentik", []);

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

        let urlPath = `/rac/endpoints/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

        return {
            path: urlPath,
            method: "PATCH",
            headers: headerParameters,
            query: queryParameters,
            body: PatchedEndpointRequestToJSON(requestParameters["patchedEndpointRequest"]),
        };
    }

    /**
     * Endpoint Viewset
     */
    async racEndpointsPartialUpdateRaw(
        requestParameters: RacEndpointsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Endpoint>> {
        const requestOptions = await this.racEndpointsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Endpoint Viewset
     */
    async racEndpointsPartialUpdate(
        requestParameters: RacEndpointsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Endpoint> {
        const response = await this.racEndpointsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for racEndpointsRetrieve without sending the request
     */
    async racEndpointsRetrieveRequestOpts(
        requestParameters: RacEndpointsRetrieveRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["pbmUuid"] == null) {
            throw new runtime.RequiredError(
                "pbmUuid",
                'Required parameter "pbmUuid" was null or undefined when calling racEndpointsRetrieve().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/endpoints/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Endpoint Viewset
     */
    async racEndpointsRetrieveRaw(
        requestParameters: RacEndpointsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Endpoint>> {
        const requestOptions = await this.racEndpointsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Endpoint Viewset
     */
    async racEndpointsRetrieve(
        requestParameters: RacEndpointsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Endpoint> {
        const response = await this.racEndpointsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for racEndpointsUpdate without sending the request
     */
    async racEndpointsUpdateRequestOpts(
        requestParameters: RacEndpointsUpdateRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["pbmUuid"] == null) {
            throw new runtime.RequiredError(
                "pbmUuid",
                'Required parameter "pbmUuid" was null or undefined when calling racEndpointsUpdate().',
            );
        }

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

        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("authentik", []);

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

        let urlPath = `/rac/endpoints/{pbm_uuid}/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

        return {
            path: urlPath,
            method: "PUT",
            headers: headerParameters,
            query: queryParameters,
            body: EndpointRequestToJSON(requestParameters["endpointRequest"]),
        };
    }

    /**
     * Endpoint Viewset
     */
    async racEndpointsUpdateRaw(
        requestParameters: RacEndpointsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Endpoint>> {
        const requestOptions = await this.racEndpointsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Endpoint Viewset
     */
    async racEndpointsUpdate(
        requestParameters: RacEndpointsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Endpoint> {
        const response = await this.racEndpointsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for racEndpointsUsedByList without sending the request
     */
    async racEndpointsUsedByListRequestOpts(
        requestParameters: RacEndpointsUsedByListRequest,
    ): Promise<runtime.RequestOpts> {
        if (requestParameters["pbmUuid"] == null) {
            throw new runtime.RequiredError(
                "pbmUuid",
                'Required parameter "pbmUuid" was null or undefined when calling racEndpointsUsedByList().',
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

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

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

        let urlPath = `/rac/endpoints/{pbm_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"pbm_uuid"}}`,
            encodeURIComponent(String(requestParameters["pbmUuid"])),
        );

        return {
            path: urlPath,
            method: "GET",
            headers: headerParameters,
            query: queryParameters,
        };
    }

    /**
     * Get a list of all objects that use this object
     */
    async racEndpointsUsedByListRaw(
        requestParameters: RacEndpointsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.racEndpointsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get a list of all objects that use this object
     */
    async racEndpointsUsedByList(
        requestParameters: RacEndpointsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.racEndpointsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
