"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * 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.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RacApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class RacApi extends runtime.BaseAPI {
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensDestroyRaw(requestParameters, initOverrides) {
        if (requestParameters['connectionTokenUuid'] == null) {
            throw new runtime.RequiredError('connectionTokenUuid', 'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensDestroy().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/connection_tokens/{connection_token_uuid}/`.replace(`{${"connection_token_uuid"}}`, encodeURIComponent(String(requestParameters['connectionTokenUuid']))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensDestroy(requestParameters, initOverrides) {
        await this.racConnectionTokensDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensListRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        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 = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/connection_tokens/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedConnectionTokenListFromJSON)(jsonValue));
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensList(requestParameters = {}, initOverrides) {
        const response = await this.racConnectionTokensListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensPartialUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['connectionTokenUuid'] == null) {
            throw new runtime.RequiredError('connectionTokenUuid', 'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensPartialUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        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}`;
            }
        }
        const response = await this.request({
            path: `/rac/connection_tokens/{connection_token_uuid}/`.replace(`{${"connection_token_uuid"}}`, encodeURIComponent(String(requestParameters['connectionTokenUuid']))),
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedConnectionTokenRequestToJSON)(requestParameters['patchedConnectionTokenRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ConnectionTokenFromJSON)(jsonValue));
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensPartialUpdate(requestParameters, initOverrides) {
        const response = await this.racConnectionTokensPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensRetrieveRaw(requestParameters, initOverrides) {
        if (requestParameters['connectionTokenUuid'] == null) {
            throw new runtime.RequiredError('connectionTokenUuid', 'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensRetrieve().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/connection_tokens/{connection_token_uuid}/`.replace(`{${"connection_token_uuid"}}`, encodeURIComponent(String(requestParameters['connectionTokenUuid']))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ConnectionTokenFromJSON)(jsonValue));
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensRetrieve(requestParameters, initOverrides) {
        const response = await this.racConnectionTokensRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensUpdateRaw(requestParameters, initOverrides) {
        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 = {};
        const headerParameters = {};
        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}`;
            }
        }
        const response = await this.request({
            path: `/rac/connection_tokens/{connection_token_uuid}/`.replace(`{${"connection_token_uuid"}}`, encodeURIComponent(String(requestParameters['connectionTokenUuid']))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.ConnectionTokenRequestToJSON)(requestParameters['connectionTokenRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ConnectionTokenFromJSON)(jsonValue));
    }
    /**
     * ConnectionToken Viewset
     */
    async racConnectionTokensUpdate(requestParameters, initOverrides) {
        const response = await this.racConnectionTokensUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get a list of all objects that use this object
     */
    async racConnectionTokensUsedByListRaw(requestParameters, initOverrides) {
        if (requestParameters['connectionTokenUuid'] == null) {
            throw new runtime.RequiredError('connectionTokenUuid', 'Required parameter "connectionTokenUuid" was null or undefined when calling racConnectionTokensUsedByList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/connection_tokens/{connection_token_uuid}/used_by/`.replace(`{${"connection_token_uuid"}}`, encodeURIComponent(String(requestParameters['connectionTokenUuid']))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.UsedByFromJSON));
    }
    /**
     * Get a list of all objects that use this object
     */
    async racConnectionTokensUsedByList(requestParameters, initOverrides) {
        const response = await this.racConnectionTokensUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsCreateRaw(requestParameters, initOverrides) {
        if (requestParameters['endpointRequest'] == null) {
            throw new runtime.RequiredError('endpointRequest', 'Required parameter "endpointRequest" was null or undefined when calling racEndpointsCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        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}`;
            }
        }
        const response = await this.request({
            path: `/rac/endpoints/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.EndpointRequestToJSON)(requestParameters['endpointRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EndpointFromJSON)(jsonValue));
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsCreate(requestParameters, initOverrides) {
        const response = await this.racEndpointsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsDestroyRaw(requestParameters, initOverrides) {
        if (requestParameters['pbmUuid'] == null) {
            throw new runtime.RequiredError('pbmUuid', 'Required parameter "pbmUuid" was null or undefined when calling racEndpointsDestroy().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/endpoints/{pbm_uuid}/`.replace(`{${"pbm_uuid"}}`, encodeURIComponent(String(requestParameters['pbmUuid']))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsDestroy(requestParameters, initOverrides) {
        await this.racEndpointsDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * List accessible endpoints
     */
    async racEndpointsListRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        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 = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/endpoints/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedEndpointListFromJSON)(jsonValue));
    }
    /**
     * List accessible endpoints
     */
    async racEndpointsList(requestParameters = {}, initOverrides) {
        const response = await this.racEndpointsListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsPartialUpdateRaw(requestParameters, initOverrides) {
        if (requestParameters['pbmUuid'] == null) {
            throw new runtime.RequiredError('pbmUuid', 'Required parameter "pbmUuid" was null or undefined when calling racEndpointsPartialUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        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}`;
            }
        }
        const response = await this.request({
            path: `/rac/endpoints/{pbm_uuid}/`.replace(`{${"pbm_uuid"}}`, encodeURIComponent(String(requestParameters['pbmUuid']))),
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedEndpointRequestToJSON)(requestParameters['patchedEndpointRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EndpointFromJSON)(jsonValue));
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsPartialUpdate(requestParameters, initOverrides) {
        const response = await this.racEndpointsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsRetrieveRaw(requestParameters, initOverrides) {
        if (requestParameters['pbmUuid'] == null) {
            throw new runtime.RequiredError('pbmUuid', 'Required parameter "pbmUuid" was null or undefined when calling racEndpointsRetrieve().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/endpoints/{pbm_uuid}/`.replace(`{${"pbm_uuid"}}`, encodeURIComponent(String(requestParameters['pbmUuid']))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EndpointFromJSON)(jsonValue));
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsRetrieve(requestParameters, initOverrides) {
        const response = await this.racEndpointsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsUpdateRaw(requestParameters, initOverrides) {
        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 = {};
        const headerParameters = {};
        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}`;
            }
        }
        const response = await this.request({
            path: `/rac/endpoints/{pbm_uuid}/`.replace(`{${"pbm_uuid"}}`, encodeURIComponent(String(requestParameters['pbmUuid']))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.EndpointRequestToJSON)(requestParameters['endpointRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EndpointFromJSON)(jsonValue));
    }
    /**
     * Endpoint Viewset
     */
    async racEndpointsUpdate(requestParameters, initOverrides) {
        const response = await this.racEndpointsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get a list of all objects that use this object
     */
    async racEndpointsUsedByListRaw(requestParameters, initOverrides) {
        if (requestParameters['pbmUuid'] == null) {
            throw new runtime.RequiredError('pbmUuid', 'Required parameter "pbmUuid" was null or undefined when calling racEndpointsUsedByList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/rac/endpoints/{pbm_uuid}/used_by/`.replace(`{${"pbm_uuid"}}`, encodeURIComponent(String(requestParameters['pbmUuid']))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.UsedByFromJSON));
    }
    /**
     * Get a list of all objects that use this object
     */
    async racEndpointsUsedByList(requestParameters, initOverrides) {
        const response = await this.racEndpointsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.RacApi = RacApi;
//# sourceMappingURL=RacApi.js.map