"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.2-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.
 */
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.FlowsInstancesListDesignationEnum = exports.FlowsInstancesListDeniedActionEnum = exports.FlowsBindingsListPolicyEngineModeEnum = exports.FlowsBindingsListInvalidResponseActionEnum = exports.FlowsApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class FlowsApi extends runtime.BaseAPI {
    /**
     * Creates request options for flowsBindingsCreate without sending the request
     */
    async flowsBindingsCreateRequestOpts(requestParameters) {
        if (requestParameters['flowStageBindingRequest'] == null) {
            throw new runtime.RequiredError('flowStageBindingRequest', 'Required parameter "flowStageBindingRequest" was null or undefined when calling flowsBindingsCreate().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/bindings/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.FlowStageBindingRequestToJSON)(requestParameters['flowStageBindingRequest']),
        };
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsBindingsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowStageBindingFromJSON)(jsonValue));
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsCreate(requestParameters, initOverrides) {
        const response = await this.flowsBindingsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsBindingsDestroy without sending the request
     */
    async flowsBindingsDestroyRequestOpts(requestParameters) {
        if (requestParameters['fsbUuid'] == null) {
            throw new runtime.RequiredError('fsbUuid', 'Required parameter "fsbUuid" was null or undefined when calling flowsBindingsDestroy().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/bindings/{fsb_uuid}/`;
        urlPath = urlPath.replace(`{${"fsb_uuid"}}`, encodeURIComponent(String(requestParameters['fsbUuid'])));
        return {
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsDestroyRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsBindingsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsDestroy(requestParameters, initOverrides) {
        await this.flowsBindingsDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for flowsBindingsList without sending the request
     */
    async flowsBindingsListRequestOpts(requestParameters) {
        const queryParameters = {};
        if (requestParameters['evaluateOnPlan'] != null) {
            queryParameters['evaluate_on_plan'] = requestParameters['evaluateOnPlan'];
        }
        if (requestParameters['fsbUuid'] != null) {
            queryParameters['fsb_uuid'] = requestParameters['fsbUuid'];
        }
        if (requestParameters['invalidResponseAction'] != null) {
            queryParameters['invalid_response_action'] = requestParameters['invalidResponseAction'];
        }
        if (requestParameters['order'] != null) {
            queryParameters['order'] = requestParameters['order'];
        }
        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['pbmUuid'] != null) {
            queryParameters['pbm_uuid'] = requestParameters['pbmUuid'];
        }
        if (requestParameters['policies'] != null) {
            queryParameters['policies'] = requestParameters['policies'];
        }
        if (requestParameters['policyEngineMode'] != null) {
            queryParameters['policy_engine_mode'] = requestParameters['policyEngineMode'];
        }
        if (requestParameters['reEvaluatePolicies'] != null) {
            queryParameters['re_evaluate_policies'] = requestParameters['reEvaluatePolicies'];
        }
        if (requestParameters['search'] != null) {
            queryParameters['search'] = requestParameters['search'];
        }
        if (requestParameters['stage'] != null) {
            queryParameters['stage'] = requestParameters['stage'];
        }
        if (requestParameters['target'] != null) {
            queryParameters['target'] = requestParameters['target'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/flows/bindings/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsBindingsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedFlowStageBindingListFromJSON)(jsonValue));
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsList(requestParameters = {}, initOverrides) {
        const response = await this.flowsBindingsListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsBindingsPartialUpdate without sending the request
     */
    async flowsBindingsPartialUpdateRequestOpts(requestParameters) {
        if (requestParameters['fsbUuid'] == null) {
            throw new runtime.RequiredError('fsbUuid', 'Required parameter "fsbUuid" was null or undefined when calling flowsBindingsPartialUpdate().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/bindings/{fsb_uuid}/`;
        urlPath = urlPath.replace(`{${"fsb_uuid"}}`, encodeURIComponent(String(requestParameters['fsbUuid'])));
        return {
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedFlowStageBindingRequestToJSON)(requestParameters['patchedFlowStageBindingRequest']),
        };
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsPartialUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsBindingsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowStageBindingFromJSON)(jsonValue));
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsPartialUpdate(requestParameters, initOverrides) {
        const response = await this.flowsBindingsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsBindingsRetrieve without sending the request
     */
    async flowsBindingsRetrieveRequestOpts(requestParameters) {
        if (requestParameters['fsbUuid'] == null) {
            throw new runtime.RequiredError('fsbUuid', 'Required parameter "fsbUuid" was null or undefined when calling flowsBindingsRetrieve().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/bindings/{fsb_uuid}/`;
        urlPath = urlPath.replace(`{${"fsb_uuid"}}`, encodeURIComponent(String(requestParameters['fsbUuid'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsBindingsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowStageBindingFromJSON)(jsonValue));
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsRetrieve(requestParameters, initOverrides) {
        const response = await this.flowsBindingsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsBindingsUpdate without sending the request
     */
    async flowsBindingsUpdateRequestOpts(requestParameters) {
        if (requestParameters['fsbUuid'] == null) {
            throw new runtime.RequiredError('fsbUuid', 'Required parameter "fsbUuid" was null or undefined when calling flowsBindingsUpdate().');
        }
        if (requestParameters['flowStageBindingRequest'] == null) {
            throw new runtime.RequiredError('flowStageBindingRequest', 'Required parameter "flowStageBindingRequest" was null or undefined when calling flowsBindingsUpdate().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/bindings/{fsb_uuid}/`;
        urlPath = urlPath.replace(`{${"fsb_uuid"}}`, encodeURIComponent(String(requestParameters['fsbUuid'])));
        return {
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.FlowStageBindingRequestToJSON)(requestParameters['flowStageBindingRequest']),
        };
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsBindingsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowStageBindingFromJSON)(jsonValue));
    }
    /**
     * FlowStageBinding Viewset
     */
    async flowsBindingsUpdate(requestParameters, initOverrides) {
        const response = await this.flowsBindingsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsBindingsUsedByList without sending the request
     */
    async flowsBindingsUsedByListRequestOpts(requestParameters) {
        if (requestParameters['fsbUuid'] == null) {
            throw new runtime.RequiredError('fsbUuid', 'Required parameter "fsbUuid" was null or undefined when calling flowsBindingsUsedByList().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/bindings/{fsb_uuid}/used_by/`;
        urlPath = urlPath.replace(`{${"fsb_uuid"}}`, encodeURIComponent(String(requestParameters['fsbUuid'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Get a list of all objects that use this object
     */
    async flowsBindingsUsedByListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsBindingsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.UsedByFromJSON));
    }
    /**
     * Get a list of all objects that use this object
     */
    async flowsBindingsUsedByList(requestParameters, initOverrides) {
        const response = await this.flowsBindingsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsExecutorGet without sending the request
     */
    async flowsExecutorGetRequestOpts(requestParameters) {
        if (requestParameters['flowSlug'] == null) {
            throw new runtime.RequiredError('flowSlug', 'Required parameter "flowSlug" was null or undefined when calling flowsExecutorGet().');
        }
        if (requestParameters['query'] == null) {
            throw new runtime.RequiredError('query', 'Required parameter "query" was null or undefined when calling flowsExecutorGet().');
        }
        const queryParameters = {};
        if (requestParameters['query'] != null) {
            queryParameters['query'] = requestParameters['query'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/flows/executor/{flow_slug}/`;
        urlPath = urlPath.replace(`{${"flow_slug"}}`, encodeURIComponent(String(requestParameters['flowSlug'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Get the next pending challenge from the currently active flow.
     */
    async flowsExecutorGetRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsExecutorGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChallengeTypesFromJSON)(jsonValue));
    }
    /**
     * Get the next pending challenge from the currently active flow.
     */
    async flowsExecutorGet(requestParameters, initOverrides) {
        const response = await this.flowsExecutorGetRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsExecutorSolve without sending the request
     */
    async flowsExecutorSolveRequestOpts(requestParameters) {
        if (requestParameters['flowSlug'] == null) {
            throw new runtime.RequiredError('flowSlug', 'Required parameter "flowSlug" was null or undefined when calling flowsExecutorSolve().');
        }
        if (requestParameters['query'] == null) {
            throw new runtime.RequiredError('query', 'Required parameter "query" was null or undefined when calling flowsExecutorSolve().');
        }
        const queryParameters = {};
        if (requestParameters['query'] != null) {
            queryParameters['query'] = requestParameters['query'];
        }
        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}`;
            }
        }
        let urlPath = `/flows/executor/{flow_slug}/`;
        urlPath = urlPath.replace(`{${"flow_slug"}}`, encodeURIComponent(String(requestParameters['flowSlug'])));
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.FlowChallengeResponseRequestToJSON)(requestParameters['flowChallengeResponseRequest']),
        };
    }
    /**
     * Solve the previously retrieved challenge and advanced to the next stage.
     */
    async flowsExecutorSolveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsExecutorSolveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChallengeTypesFromJSON)(jsonValue));
    }
    /**
     * Solve the previously retrieved challenge and advanced to the next stage.
     */
    async flowsExecutorSolve(requestParameters, initOverrides) {
        const response = await this.flowsExecutorSolveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInspectorGet without sending the request
     */
    async flowsInspectorGetRequestOpts(requestParameters) {
        if (requestParameters['flowSlug'] == null) {
            throw new runtime.RequiredError('flowSlug', 'Required parameter "flowSlug" was null or undefined when calling flowsInspectorGet().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/inspector/{flow_slug}/`;
        urlPath = urlPath.replace(`{${"flow_slug"}}`, encodeURIComponent(String(requestParameters['flowSlug'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Get current flow state and record it
     */
    async flowsInspectorGetRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInspectorGetRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowInspectionFromJSON)(jsonValue));
    }
    /**
     * Get current flow state and record it
     */
    async flowsInspectorGet(requestParameters, initOverrides) {
        const response = await this.flowsInspectorGetRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesCacheClearCreate without sending the request
     */
    async flowsInstancesCacheClearCreateRequestOpts() {
        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}`;
            }
        }
        let urlPath = `/flows/instances/cache_clear/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Clear flow cache
     */
    async flowsInstancesCacheClearCreateRaw(initOverrides) {
        const requestOptions = await this.flowsInstancesCacheClearCreateRequestOpts();
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Clear flow cache
     */
    async flowsInstancesCacheClearCreate(initOverrides) {
        await this.flowsInstancesCacheClearCreateRaw(initOverrides);
    }
    /**
     * Creates request options for flowsInstancesCacheInfoRetrieve without sending the request
     */
    async flowsInstancesCacheInfoRetrieveRequestOpts() {
        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}`;
            }
        }
        let urlPath = `/flows/instances/cache_info/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Info about cached flows
     */
    async flowsInstancesCacheInfoRetrieveRaw(initOverrides) {
        const requestOptions = await this.flowsInstancesCacheInfoRetrieveRequestOpts();
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CacheFromJSON)(jsonValue));
    }
    /**
     * Info about cached flows
     */
    async flowsInstancesCacheInfoRetrieve(initOverrides) {
        const response = await this.flowsInstancesCacheInfoRetrieveRaw(initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesCreate without sending the request
     */
    async flowsInstancesCreateRequestOpts(requestParameters) {
        if (requestParameters['flowRequest'] == null) {
            throw new runtime.RequiredError('flowRequest', 'Required parameter "flowRequest" was null or undefined when calling flowsInstancesCreate().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.FlowRequestToJSON)(requestParameters['flowRequest']),
        };
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowFromJSON)(jsonValue));
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesCreate(requestParameters, initOverrides) {
        const response = await this.flowsInstancesCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesDestroy without sending the request
     */
    async flowsInstancesDestroyRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesDestroy().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesDestroyRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesDestroy(requestParameters, initOverrides) {
        await this.flowsInstancesDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for flowsInstancesDiagramRetrieve without sending the request
     */
    async flowsInstancesDiagramRetrieveRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesDiagramRetrieve().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/diagram/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Return diagram for flow with slug `slug`, in the format used by flowchart.js
     */
    async flowsInstancesDiagramRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesDiagramRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowDiagramFromJSON)(jsonValue));
    }
    /**
     * Return diagram for flow with slug `slug`, in the format used by flowchart.js
     */
    async flowsInstancesDiagramRetrieve(requestParameters, initOverrides) {
        const response = await this.flowsInstancesDiagramRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesExecuteRetrieve without sending the request
     */
    async flowsInstancesExecuteRetrieveRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesExecuteRetrieve().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/execute/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Execute flow for current user
     */
    async flowsInstancesExecuteRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesExecuteRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LinkFromJSON)(jsonValue));
    }
    /**
     * Execute flow for current user
     */
    async flowsInstancesExecuteRetrieve(requestParameters, initOverrides) {
        const response = await this.flowsInstancesExecuteRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesExportRetrieve without sending the request
     */
    async flowsInstancesExportRetrieveRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesExportRetrieve().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/export/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Export flow to .yaml file
     */
    async flowsInstancesExportRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesExportRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.BlobApiResponse(response);
    }
    /**
     * Export flow to .yaml file
     */
    async flowsInstancesExportRetrieve(requestParameters, initOverrides) {
        const response = await this.flowsInstancesExportRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesImportCreate without sending the request
     */
    async flowsInstancesImportCreateRequestOpts(requestParameters) {
        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 consumes = [
            { contentType: 'multipart/form-data' },
        ];
        // @ts-ignore: canConsumeForm may be unused
        const canConsumeForm = runtime.canConsumeForm(consumes);
        let formParams;
        let useForm = false;
        // use FormData to transmit files using content-type "multipart/form-data"
        useForm = canConsumeForm;
        if (useForm) {
            formParams = new FormData();
        }
        else {
            formParams = new URLSearchParams();
        }
        if (requestParameters['file'] != null) {
            formParams.append('file', requestParameters['file']);
        }
        if (requestParameters['clear'] != null) {
            formParams.append('clear', requestParameters['clear']);
        }
        let urlPath = `/flows/instances/import/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: formParams,
        };
    }
    /**
     * Import flow from .yaml file
     */
    async flowsInstancesImportCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesImportCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowImportResultFromJSON)(jsonValue));
    }
    /**
     * Import flow from .yaml file
     */
    async flowsInstancesImportCreate(requestParameters = {}, initOverrides) {
        const response = await this.flowsInstancesImportCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesList without sending the request
     */
    async flowsInstancesListRequestOpts(requestParameters) {
        const queryParameters = {};
        if (requestParameters['deniedAction'] != null) {
            queryParameters['denied_action'] = requestParameters['deniedAction'];
        }
        if (requestParameters['designation'] != null) {
            queryParameters['designation'] = requestParameters['designation'];
        }
        if (requestParameters['flowUuid'] != null) {
            queryParameters['flow_uuid'] = requestParameters['flowUuid'];
        }
        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['search'] != null) {
            queryParameters['search'] = requestParameters['search'];
        }
        if (requestParameters['slug'] != null) {
            queryParameters['slug'] = requestParameters['slug'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/flows/instances/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedFlowListFromJSON)(jsonValue));
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesList(requestParameters = {}, initOverrides) {
        const response = await this.flowsInstancesListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesPartialUpdate without sending the request
     */
    async flowsInstancesPartialUpdateRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesPartialUpdate().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedFlowRequestToJSON)(requestParameters['patchedFlowRequest']),
        };
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesPartialUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowFromJSON)(jsonValue));
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesPartialUpdate(requestParameters, initOverrides) {
        const response = await this.flowsInstancesPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesRetrieve without sending the request
     */
    async flowsInstancesRetrieveRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesRetrieve().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowFromJSON)(jsonValue));
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesRetrieve(requestParameters, initOverrides) {
        const response = await this.flowsInstancesRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesUpdate without sending the request
     */
    async flowsInstancesUpdateRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesUpdate().');
        }
        if (requestParameters['flowRequest'] == null) {
            throw new runtime.RequiredError('flowRequest', 'Required parameter "flowRequest" was null or undefined when calling flowsInstancesUpdate().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.FlowRequestToJSON)(requestParameters['flowRequest']),
        };
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.FlowFromJSON)(jsonValue));
    }
    /**
     * Flow Viewset
     */
    async flowsInstancesUpdate(requestParameters, initOverrides) {
        const response = await this.flowsInstancesUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for flowsInstancesUsedByList without sending the request
     */
    async flowsInstancesUsedByListRequestOpts(requestParameters) {
        if (requestParameters['slug'] == null) {
            throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling flowsInstancesUsedByList().');
        }
        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}`;
            }
        }
        let urlPath = `/flows/instances/{slug}/used_by/`;
        urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Get a list of all objects that use this object
     */
    async flowsInstancesUsedByListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.flowsInstancesUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.UsedByFromJSON));
    }
    /**
     * Get a list of all objects that use this object
     */
    async flowsInstancesUsedByList(requestParameters, initOverrides) {
        const response = await this.flowsInstancesUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.FlowsApi = FlowsApi;
/**
 * @export
 */
exports.FlowsBindingsListInvalidResponseActionEnum = {
    Restart: 'restart',
    RestartWithContext: 'restart_with_context',
    Retry: 'retry',
    UnknownDefaultOpenApi: '11184809'
};
/**
 * @export
 */
exports.FlowsBindingsListPolicyEngineModeEnum = {
    All: 'all',
    Any: 'any',
    UnknownDefaultOpenApi: '11184809'
};
/**
 * @export
 */
exports.FlowsInstancesListDeniedActionEnum = {
    Continue: 'continue',
    Message: 'message',
    MessageContinue: 'message_continue',
    UnknownDefaultOpenApi: '11184809'
};
/**
 * @export
 */
exports.FlowsInstancesListDesignationEnum = {
    Authentication: 'authentication',
    Authorization: 'authorization',
    Enrollment: 'enrollment',
    Invalidation: 'invalidation',
    Recovery: 'recovery',
    StageConfiguration: 'stage_configuration',
    Unenrollment: 'unenrollment',
    UnknownDefaultOpenApi: '11184809'
};
//# sourceMappingURL=FlowsApi.js.map