/* 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 {
    Cache,
    DetailedCountry,
    DummyPolicy,
    DummyPolicyRequest,
    EventActions,
    EventMatcherPolicy,
    EventMatcherPolicyRequest,
    ExpressionPolicy,
    ExpressionPolicyRequest,
    GeoIPPolicy,
    GeoIPPolicyRequest,
    PaginatedDummyPolicyList,
    PaginatedEventMatcherPolicyList,
    PaginatedExpressionPolicyList,
    PaginatedGeoIPPolicyList,
    PaginatedPasswordExpiryPolicyList,
    PaginatedPasswordPolicyList,
    PaginatedPolicyBindingList,
    PaginatedPolicyList,
    PaginatedReputationList,
    PaginatedReputationPolicyList,
    PaginatedUniquePasswordPolicyList,
    PasswordExpiryPolicy,
    PasswordExpiryPolicyRequest,
    PasswordPolicy,
    PasswordPolicyRequest,
    PatchedDummyPolicyRequest,
    PatchedEventMatcherPolicyRequest,
    PatchedExpressionPolicyRequest,
    PatchedGeoIPPolicyRequest,
    PatchedPasswordExpiryPolicyRequest,
    PatchedPasswordPolicyRequest,
    PatchedPolicyBindingRequest,
    PatchedReputationPolicyRequest,
    PatchedUniquePasswordPolicyRequest,
    Policy,
    PolicyBinding,
    PolicyBindingRequest,
    PolicyTestRequest,
    PolicyTestResult,
    Reputation,
    ReputationPolicy,
    ReputationPolicyRequest,
    TypeCreate,
    UniquePasswordPolicy,
    UniquePasswordPolicyRequest,
    UsedBy,
} from "../models/index";
import {
    CacheFromJSON,
    DetailedCountryFromJSON,
    DummyPolicyFromJSON,
    DummyPolicyRequestToJSON,
    EventMatcherPolicyFromJSON,
    EventMatcherPolicyRequestToJSON,
    ExpressionPolicyFromJSON,
    ExpressionPolicyRequestToJSON,
    GeoIPPolicyFromJSON,
    GeoIPPolicyRequestToJSON,
    PaginatedDummyPolicyListFromJSON,
    PaginatedEventMatcherPolicyListFromJSON,
    PaginatedExpressionPolicyListFromJSON,
    PaginatedGeoIPPolicyListFromJSON,
    PaginatedPasswordExpiryPolicyListFromJSON,
    PaginatedPasswordPolicyListFromJSON,
    PaginatedPolicyBindingListFromJSON,
    PaginatedPolicyListFromJSON,
    PaginatedReputationListFromJSON,
    PaginatedReputationPolicyListFromJSON,
    PaginatedUniquePasswordPolicyListFromJSON,
    PasswordExpiryPolicyFromJSON,
    PasswordExpiryPolicyRequestToJSON,
    PasswordPolicyFromJSON,
    PasswordPolicyRequestToJSON,
    PatchedDummyPolicyRequestToJSON,
    PatchedEventMatcherPolicyRequestToJSON,
    PatchedExpressionPolicyRequestToJSON,
    PatchedGeoIPPolicyRequestToJSON,
    PatchedPasswordExpiryPolicyRequestToJSON,
    PatchedPasswordPolicyRequestToJSON,
    PatchedPolicyBindingRequestToJSON,
    PatchedReputationPolicyRequestToJSON,
    PatchedUniquePasswordPolicyRequestToJSON,
    PolicyBindingFromJSON,
    PolicyBindingRequestToJSON,
    PolicyFromJSON,
    PolicyTestRequestToJSON,
    PolicyTestResultFromJSON,
    ReputationFromJSON,
    ReputationPolicyFromJSON,
    ReputationPolicyRequestToJSON,
    TypeCreateFromJSON,
    UniquePasswordPolicyFromJSON,
    UniquePasswordPolicyRequestToJSON,
    UsedByFromJSON,
} from "../models/index";
import * as runtime from "../runtime";

export interface PoliciesAllDestroyRequest {
    policyUuid: string;
}

export interface PoliciesAllListRequest {
    bindingsIsnull?: boolean;
    ordering?: string;
    page?: number;
    pageSize?: number;
    promptstageIsnull?: boolean;
    search?: string;
}

export interface PoliciesAllRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesAllTestCreateRequest {
    policyUuid: string;
    policyTestRequest: PolicyTestRequest;
}

export interface PoliciesAllUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesBindingsCreateRequest {
    policyBindingRequest: PolicyBindingRequest;
}

export interface PoliciesBindingsDestroyRequest {
    policyBindingUuid: string;
}

export interface PoliciesBindingsListRequest {
    enabled?: boolean;
    order?: number;
    ordering?: string;
    page?: number;
    pageSize?: number;
    policy?: string;
    policyIsnull?: boolean;
    search?: string;
    target?: string;
    targetIn?: Array<string>;
    timeout?: number;
}

export interface PoliciesBindingsPartialUpdateRequest {
    policyBindingUuid: string;
    patchedPolicyBindingRequest?: PatchedPolicyBindingRequest;
}

export interface PoliciesBindingsRetrieveRequest {
    policyBindingUuid: string;
}

export interface PoliciesBindingsUpdateRequest {
    policyBindingUuid: string;
    policyBindingRequest: PolicyBindingRequest;
}

export interface PoliciesBindingsUsedByListRequest {
    policyBindingUuid: string;
}

export interface PoliciesDummyCreateRequest {
    dummyPolicyRequest: DummyPolicyRequest;
}

export interface PoliciesDummyDestroyRequest {
    policyUuid: string;
}

export interface PoliciesDummyListRequest {
    created?: Date;
    executionLogging?: boolean;
    lastUpdated?: Date;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    policyUuid?: string;
    result?: boolean;
    search?: string;
    waitMax?: number;
    waitMin?: number;
}

export interface PoliciesDummyPartialUpdateRequest {
    policyUuid: string;
    patchedDummyPolicyRequest?: PatchedDummyPolicyRequest;
}

export interface PoliciesDummyRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesDummyUpdateRequest {
    policyUuid: string;
    dummyPolicyRequest: DummyPolicyRequest;
}

export interface PoliciesDummyUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesEventMatcherCreateRequest {
    eventMatcherPolicyRequest: EventMatcherPolicyRequest;
}

export interface PoliciesEventMatcherDestroyRequest {
    policyUuid: string;
}

export interface PoliciesEventMatcherListRequest {
    action?: EventActions | null;
    app?: string;
    clientIp?: string;
    created?: Date;
    executionLogging?: boolean;
    lastUpdated?: Date;
    model?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    policyUuid?: string;
    query?: string;
    search?: string;
}

export interface PoliciesEventMatcherPartialUpdateRequest {
    policyUuid: string;
    patchedEventMatcherPolicyRequest?: PatchedEventMatcherPolicyRequest;
}

export interface PoliciesEventMatcherRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesEventMatcherUpdateRequest {
    policyUuid: string;
    eventMatcherPolicyRequest: EventMatcherPolicyRequest;
}

export interface PoliciesEventMatcherUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesExpressionCreateRequest {
    expressionPolicyRequest: ExpressionPolicyRequest;
}

export interface PoliciesExpressionDestroyRequest {
    policyUuid: string;
}

export interface PoliciesExpressionListRequest {
    created?: Date;
    executionLogging?: boolean;
    expression?: string;
    lastUpdated?: Date;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    policyUuid?: string;
    search?: string;
}

export interface PoliciesExpressionPartialUpdateRequest {
    policyUuid: string;
    patchedExpressionPolicyRequest?: PatchedExpressionPolicyRequest;
}

export interface PoliciesExpressionRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesExpressionUpdateRequest {
    policyUuid: string;
    expressionPolicyRequest: ExpressionPolicyRequest;
}

export interface PoliciesExpressionUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesGeoipCreateRequest {
    geoIPPolicyRequest: GeoIPPolicyRequest;
}

export interface PoliciesGeoipDestroyRequest {
    policyUuid: string;
}

export interface PoliciesGeoipListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
}

export interface PoliciesGeoipPartialUpdateRequest {
    policyUuid: string;
    patchedGeoIPPolicyRequest?: PatchedGeoIPPolicyRequest;
}

export interface PoliciesGeoipRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesGeoipUpdateRequest {
    policyUuid: string;
    geoIPPolicyRequest: GeoIPPolicyRequest;
}

export interface PoliciesGeoipUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesPasswordCreateRequest {
    passwordPolicyRequest: PasswordPolicyRequest;
}

export interface PoliciesPasswordDestroyRequest {
    policyUuid: string;
}

export interface PoliciesPasswordExpiryCreateRequest {
    passwordExpiryPolicyRequest: PasswordExpiryPolicyRequest;
}

export interface PoliciesPasswordExpiryDestroyRequest {
    policyUuid: string;
}

export interface PoliciesPasswordExpiryListRequest {
    created?: Date;
    days?: number;
    denyOnly?: boolean;
    executionLogging?: boolean;
    lastUpdated?: Date;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    policyUuid?: string;
    search?: string;
}

export interface PoliciesPasswordExpiryPartialUpdateRequest {
    policyUuid: string;
    patchedPasswordExpiryPolicyRequest?: PatchedPasswordExpiryPolicyRequest;
}

export interface PoliciesPasswordExpiryRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesPasswordExpiryUpdateRequest {
    policyUuid: string;
    passwordExpiryPolicyRequest: PasswordExpiryPolicyRequest;
}

export interface PoliciesPasswordExpiryUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesPasswordListRequest {
    amountDigits?: number;
    amountLowercase?: number;
    amountSymbols?: number;
    amountUppercase?: number;
    checkHaveIBeenPwned?: boolean;
    checkStaticRules?: boolean;
    checkZxcvbn?: boolean;
    created?: Date;
    errorMessage?: string;
    executionLogging?: boolean;
    hibpAllowedCount?: number;
    lastUpdated?: Date;
    lengthMin?: number;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    passwordField?: string;
    policyUuid?: string;
    search?: string;
    symbolCharset?: string;
    zxcvbnScoreThreshold?: number;
}

export interface PoliciesPasswordPartialUpdateRequest {
    policyUuid: string;
    patchedPasswordPolicyRequest?: PatchedPasswordPolicyRequest;
}

export interface PoliciesPasswordRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesPasswordUpdateRequest {
    policyUuid: string;
    passwordPolicyRequest: PasswordPolicyRequest;
}

export interface PoliciesPasswordUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesReputationCreateRequest {
    reputationPolicyRequest: ReputationPolicyRequest;
}

export interface PoliciesReputationDestroyRequest {
    policyUuid: string;
}

export interface PoliciesReputationListRequest {
    checkIp?: boolean;
    checkUsername?: boolean;
    created?: Date;
    executionLogging?: boolean;
    lastUpdated?: Date;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    policyUuid?: string;
    search?: string;
    threshold?: number;
}

export interface PoliciesReputationPartialUpdateRequest {
    policyUuid: string;
    patchedReputationPolicyRequest?: PatchedReputationPolicyRequest;
}

export interface PoliciesReputationRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesReputationScoresDestroyRequest {
    reputationUuid: string;
}

export interface PoliciesReputationScoresListRequest {
    identifier?: string;
    identifierIn?: Array<string>;
    ip?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    score?: number;
    search?: string;
}

export interface PoliciesReputationScoresRetrieveRequest {
    reputationUuid: string;
}

export interface PoliciesReputationScoresUsedByListRequest {
    reputationUuid: string;
}

export interface PoliciesReputationUpdateRequest {
    policyUuid: string;
    reputationPolicyRequest: ReputationPolicyRequest;
}

export interface PoliciesReputationUsedByListRequest {
    policyUuid: string;
}

export interface PoliciesUniquePasswordCreateRequest {
    uniquePasswordPolicyRequest: UniquePasswordPolicyRequest;
}

export interface PoliciesUniquePasswordDestroyRequest {
    policyUuid: string;
}

export interface PoliciesUniquePasswordListRequest {
    created?: Date;
    executionLogging?: boolean;
    lastUpdated?: Date;
    name?: string;
    numHistoricalPasswords?: number;
    ordering?: string;
    page?: number;
    pageSize?: number;
    passwordField?: string;
    policyUuid?: string;
    search?: string;
}

export interface PoliciesUniquePasswordPartialUpdateRequest {
    policyUuid: string;
    patchedUniquePasswordPolicyRequest?: PatchedUniquePasswordPolicyRequest;
}

export interface PoliciesUniquePasswordRetrieveRequest {
    policyUuid: string;
}

export interface PoliciesUniquePasswordUpdateRequest {
    policyUuid: string;
    uniquePasswordPolicyRequest: UniquePasswordPolicyRequest;
}

export interface PoliciesUniquePasswordUsedByListRequest {
    policyUuid: string;
}

/**
 *
 */
export class PoliciesApi extends runtime.BaseAPI {
    /**
     * Creates request options for policiesAllCacheClearCreate without sending the request
     */
    async policiesAllCacheClearCreateRequestOpts(): Promise<runtime.RequestOpts> {
        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 = `/policies/all/cache_clear/`;

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

    /**
     * Clear policy cache
     */
    async policiesAllCacheClearCreateRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesAllCacheClearCreateRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Clear policy cache
     */
    async policiesAllCacheClearCreate(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesAllCacheClearCreateRaw(initOverrides);
    }

    /**
     * Creates request options for policiesAllCacheInfoRetrieve without sending the request
     */
    async policiesAllCacheInfoRetrieveRequestOpts(): Promise<runtime.RequestOpts> {
        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 = `/policies/all/cache_info/`;

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

    /**
     * Info about cached policies
     */
    async policiesAllCacheInfoRetrieveRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Cache>> {
        const requestOptions = await this.policiesAllCacheInfoRetrieveRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Info about cached policies
     */
    async policiesAllCacheInfoRetrieve(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Cache> {
        const response = await this.policiesAllCacheInfoRetrieveRaw(initOverrides);
        return await response.value();
    }

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

        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 = `/policies/all/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Policy Viewset
     */
    async policiesAllDestroyRaw(
        requestParameters: PoliciesAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesAllDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Policy Viewset
     */
    async policiesAllDestroy(
        requestParameters: PoliciesAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesAllDestroyRaw(requestParameters, initOverrides);
    }

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

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

        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["promptstageIsnull"] != null) {
            queryParameters["promptstage__isnull"] = requestParameters["promptstageIsnull"];
        }

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

        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 = `/policies/all/`;

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

    /**
     * Policy Viewset
     */
    async policiesAllListRaw(
        requestParameters: PoliciesAllListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPolicyList>> {
        const requestOptions = await this.policiesAllListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Policy Viewset
     */
    async policiesAllList(
        requestParameters: PoliciesAllListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPolicyList> {
        const response = await this.policiesAllListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/all/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Policy Viewset
     */
    async policiesAllRetrieveRaw(
        requestParameters: PoliciesAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Policy>> {
        const requestOptions = await this.policiesAllRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Policy Viewset
     */
    async policiesAllRetrieve(
        requestParameters: PoliciesAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Policy> {
        const response = await this.policiesAllRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/policies/all/{policy_uuid}/test/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Test policy
     */
    async policiesAllTestCreateRaw(
        requestParameters: PoliciesAllTestCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PolicyTestResult>> {
        const requestOptions = await this.policiesAllTestCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Test policy
     */
    async policiesAllTestCreate(
        requestParameters: PoliciesAllTestCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PolicyTestResult> {
        const response = await this.policiesAllTestCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for policiesAllTypesList without sending the request
     */
    async policiesAllTypesListRequestOpts(): Promise<runtime.RequestOpts> {
        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 = `/policies/all/types/`;

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

    /**
     * Get all creatable types
     */
    async policiesAllTypesListRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<TypeCreate>>> {
        const requestOptions = await this.policiesAllTypesListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all creatable types
     */
    async policiesAllTypesList(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<TypeCreate>> {
        const response = await this.policiesAllTypesListRaw(initOverrides);
        return await response.value();
    }

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

        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 = `/policies/all/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesAllUsedByListRaw(
        requestParameters: PoliciesAllUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.policiesAllUsedByListRequestOpts(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 policiesAllUsedByList(
        requestParameters: PoliciesAllUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesAllUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/bindings/`;

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsCreateRaw(
        requestParameters: PoliciesBindingsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PolicyBinding>> {
        const requestOptions = await this.policiesBindingsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsCreate(
        requestParameters: PoliciesBindingsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PolicyBinding> {
        const response = await this.policiesBindingsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/bindings/{policy_binding_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_binding_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyBindingUuid"])),
        );

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsDestroyRaw(
        requestParameters: PoliciesBindingsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesBindingsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsDestroy(
        requestParameters: PoliciesBindingsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesBindingsDestroyRaw(requestParameters, initOverrides);
    }

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

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

        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["policy"] != null) {
            queryParameters["policy"] = requestParameters["policy"];
        }

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

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

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

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

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

        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 = `/policies/bindings/`;

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsListRaw(
        requestParameters: PoliciesBindingsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPolicyBindingList>> {
        const requestOptions = await this.policiesBindingsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsList(
        requestParameters: PoliciesBindingsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPolicyBindingList> {
        const response = await this.policiesBindingsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/bindings/{policy_binding_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_binding_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyBindingUuid"])),
        );

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsPartialUpdateRaw(
        requestParameters: PoliciesBindingsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PolicyBinding>> {
        const requestOptions =
            await this.policiesBindingsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsPartialUpdate(
        requestParameters: PoliciesBindingsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PolicyBinding> {
        const response = await this.policiesBindingsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/bindings/{policy_binding_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_binding_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyBindingUuid"])),
        );

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsRetrieveRaw(
        requestParameters: PoliciesBindingsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PolicyBinding>> {
        const requestOptions = await this.policiesBindingsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsRetrieve(
        requestParameters: PoliciesBindingsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PolicyBinding> {
        const response = await this.policiesBindingsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/policies/bindings/{policy_binding_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_binding_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyBindingUuid"])),
        );

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsUpdateRaw(
        requestParameters: PoliciesBindingsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PolicyBinding>> {
        const requestOptions = await this.policiesBindingsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * PolicyBinding Viewset
     */
    async policiesBindingsUpdate(
        requestParameters: PoliciesBindingsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PolicyBinding> {
        const response = await this.policiesBindingsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/bindings/{policy_binding_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_binding_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyBindingUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesBindingsUsedByListRaw(
        requestParameters: PoliciesBindingsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.policiesBindingsUsedByListRequestOpts(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 policiesBindingsUsedByList(
        requestParameters: PoliciesBindingsUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesBindingsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/dummy/`;

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

    /**
     * Dummy Viewset
     */
    async policiesDummyCreateRaw(
        requestParameters: PoliciesDummyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyPolicy>> {
        const requestOptions = await this.policiesDummyCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Dummy Viewset
     */
    async policiesDummyCreate(
        requestParameters: PoliciesDummyCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyPolicy> {
        const response = await this.policiesDummyCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/dummy/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Dummy Viewset
     */
    async policiesDummyDestroyRaw(
        requestParameters: PoliciesDummyDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesDummyDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Dummy Viewset
     */
    async policiesDummyDestroy(
        requestParameters: PoliciesDummyDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesDummyDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["created"] != null) {
            queryParameters["created"] = (requestParameters["created"] as any).toISOString();
        }

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

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

        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["policyUuid"] != null) {
            queryParameters["policy_uuid"] = requestParameters["policyUuid"];
        }

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

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

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

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

        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 = `/policies/dummy/`;

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

    /**
     * Dummy Viewset
     */
    async policiesDummyListRaw(
        requestParameters: PoliciesDummyListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedDummyPolicyList>> {
        const requestOptions = await this.policiesDummyListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Dummy Viewset
     */
    async policiesDummyList(
        requestParameters: PoliciesDummyListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedDummyPolicyList> {
        const response = await this.policiesDummyListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/dummy/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Dummy Viewset
     */
    async policiesDummyPartialUpdateRaw(
        requestParameters: PoliciesDummyPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyPolicy>> {
        const requestOptions = await this.policiesDummyPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Dummy Viewset
     */
    async policiesDummyPartialUpdate(
        requestParameters: PoliciesDummyPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyPolicy> {
        const response = await this.policiesDummyPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/dummy/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Dummy Viewset
     */
    async policiesDummyRetrieveRaw(
        requestParameters: PoliciesDummyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyPolicy>> {
        const requestOptions = await this.policiesDummyRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Dummy Viewset
     */
    async policiesDummyRetrieve(
        requestParameters: PoliciesDummyRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyPolicy> {
        const response = await this.policiesDummyRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/policies/dummy/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Dummy Viewset
     */
    async policiesDummyUpdateRaw(
        requestParameters: PoliciesDummyUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<DummyPolicy>> {
        const requestOptions = await this.policiesDummyUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Dummy Viewset
     */
    async policiesDummyUpdate(
        requestParameters: PoliciesDummyUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<DummyPolicy> {
        const response = await this.policiesDummyUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/dummy/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesDummyUsedByListRaw(
        requestParameters: PoliciesDummyUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.policiesDummyUsedByListRequestOpts(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 policiesDummyUsedByList(
        requestParameters: PoliciesDummyUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesDummyUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/event_matcher/`;

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherCreateRaw(
        requestParameters: PoliciesEventMatcherCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EventMatcherPolicy>> {
        const requestOptions = await this.policiesEventMatcherCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherCreate(
        requestParameters: PoliciesEventMatcherCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EventMatcherPolicy> {
        const response = await this.policiesEventMatcherCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/event_matcher/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherDestroyRaw(
        requestParameters: PoliciesEventMatcherDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesEventMatcherDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherDestroy(
        requestParameters: PoliciesEventMatcherDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesEventMatcherDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

        if (requestParameters["created"] != null) {
            queryParameters["created"] = (requestParameters["created"] as any).toISOString();
        }

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

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

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

        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["policyUuid"] != null) {
            queryParameters["policy_uuid"] = requestParameters["policyUuid"];
        }

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

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

        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 = `/policies/event_matcher/`;

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherListRaw(
        requestParameters: PoliciesEventMatcherListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedEventMatcherPolicyList>> {
        const requestOptions = await this.policiesEventMatcherListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherList(
        requestParameters: PoliciesEventMatcherListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedEventMatcherPolicyList> {
        const response = await this.policiesEventMatcherListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/event_matcher/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherPartialUpdateRaw(
        requestParameters: PoliciesEventMatcherPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EventMatcherPolicy>> {
        const requestOptions =
            await this.policiesEventMatcherPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherPartialUpdate(
        requestParameters: PoliciesEventMatcherPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EventMatcherPolicy> {
        const response = await this.policiesEventMatcherPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/event_matcher/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherRetrieveRaw(
        requestParameters: PoliciesEventMatcherRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EventMatcherPolicy>> {
        const requestOptions =
            await this.policiesEventMatcherRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherRetrieve(
        requestParameters: PoliciesEventMatcherRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EventMatcherPolicy> {
        const response = await this.policiesEventMatcherRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/policies/event_matcher/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherUpdateRaw(
        requestParameters: PoliciesEventMatcherUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<EventMatcherPolicy>> {
        const requestOptions = await this.policiesEventMatcherUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Event Matcher Policy Viewset
     */
    async policiesEventMatcherUpdate(
        requestParameters: PoliciesEventMatcherUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<EventMatcherPolicy> {
        const response = await this.policiesEventMatcherUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/event_matcher/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesEventMatcherUsedByListRaw(
        requestParameters: PoliciesEventMatcherUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.policiesEventMatcherUsedByListRequestOpts(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 policiesEventMatcherUsedByList(
        requestParameters: PoliciesEventMatcherUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesEventMatcherUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/expression/`;

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

    /**
     * Source Viewset
     */
    async policiesExpressionCreateRaw(
        requestParameters: PoliciesExpressionCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ExpressionPolicy>> {
        const requestOptions = await this.policiesExpressionCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async policiesExpressionCreate(
        requestParameters: PoliciesExpressionCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ExpressionPolicy> {
        const response = await this.policiesExpressionCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/expression/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Source Viewset
     */
    async policiesExpressionDestroyRaw(
        requestParameters: PoliciesExpressionDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesExpressionDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Source Viewset
     */
    async policiesExpressionDestroy(
        requestParameters: PoliciesExpressionDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesExpressionDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["created"] != null) {
            queryParameters["created"] = (requestParameters["created"] as any).toISOString();
        }

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

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

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

        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["policyUuid"] != null) {
            queryParameters["policy_uuid"] = requestParameters["policyUuid"];
        }

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

        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 = `/policies/expression/`;

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

    /**
     * Source Viewset
     */
    async policiesExpressionListRaw(
        requestParameters: PoliciesExpressionListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedExpressionPolicyList>> {
        const requestOptions = await this.policiesExpressionListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async policiesExpressionList(
        requestParameters: PoliciesExpressionListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedExpressionPolicyList> {
        const response = await this.policiesExpressionListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/expression/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Source Viewset
     */
    async policiesExpressionPartialUpdateRaw(
        requestParameters: PoliciesExpressionPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ExpressionPolicy>> {
        const requestOptions =
            await this.policiesExpressionPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async policiesExpressionPartialUpdate(
        requestParameters: PoliciesExpressionPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ExpressionPolicy> {
        const response = await this.policiesExpressionPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/expression/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Source Viewset
     */
    async policiesExpressionRetrieveRaw(
        requestParameters: PoliciesExpressionRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ExpressionPolicy>> {
        const requestOptions = await this.policiesExpressionRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async policiesExpressionRetrieve(
        requestParameters: PoliciesExpressionRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ExpressionPolicy> {
        const response = await this.policiesExpressionRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/policies/expression/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Source Viewset
     */
    async policiesExpressionUpdateRaw(
        requestParameters: PoliciesExpressionUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ExpressionPolicy>> {
        const requestOptions = await this.policiesExpressionUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async policiesExpressionUpdate(
        requestParameters: PoliciesExpressionUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ExpressionPolicy> {
        const response = await this.policiesExpressionUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/expression/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesExpressionUsedByListRaw(
        requestParameters: PoliciesExpressionUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.policiesExpressionUsedByListRequestOpts(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 policiesExpressionUsedByList(
        requestParameters: PoliciesExpressionUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesExpressionUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/geoip/`;

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipCreateRaw(
        requestParameters: PoliciesGeoipCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GeoIPPolicy>> {
        const requestOptions = await this.policiesGeoipCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipCreate(
        requestParameters: PoliciesGeoipCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GeoIPPolicy> {
        const response = await this.policiesGeoipCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/geoip/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipDestroyRaw(
        requestParameters: PoliciesGeoipDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesGeoipDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * GeoIP Viewset
     */
    async policiesGeoipDestroy(
        requestParameters: PoliciesGeoipDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesGeoipDestroyRaw(requestParameters, initOverrides);
    }

    /**
     * Creates request options for policiesGeoipIso3166List without sending the request
     */
    async policiesGeoipIso3166ListRequestOpts(): Promise<runtime.RequestOpts> {
        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 = `/policies/geoip_iso3166/`;

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

    /**
     * Get all countries in ISO-3166-1
     */
    async policiesGeoipIso3166ListRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<DetailedCountry>>> {
        const requestOptions = await this.policiesGeoipIso3166ListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all countries in ISO-3166-1
     */
    async policiesGeoipIso3166List(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<DetailedCountry>> {
        const response = await this.policiesGeoipIso3166ListRaw(initOverrides);
        return await response.value();
    }

    /**
     * Creates request options for policiesGeoipList without sending the request
     */
    async policiesGeoipListRequestOpts(
        requestParameters: PoliciesGeoipListRequest,
    ): 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["search"] != null) {
            queryParameters["search"] = requestParameters["search"];
        }

        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 = `/policies/geoip/`;

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipListRaw(
        requestParameters: PoliciesGeoipListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGeoIPPolicyList>> {
        const requestOptions = await this.policiesGeoipListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipList(
        requestParameters: PoliciesGeoipListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGeoIPPolicyList> {
        const response = await this.policiesGeoipListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/geoip/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipPartialUpdateRaw(
        requestParameters: PoliciesGeoipPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GeoIPPolicy>> {
        const requestOptions = await this.policiesGeoipPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipPartialUpdate(
        requestParameters: PoliciesGeoipPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GeoIPPolicy> {
        const response = await this.policiesGeoipPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/geoip/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipRetrieveRaw(
        requestParameters: PoliciesGeoipRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GeoIPPolicy>> {
        const requestOptions = await this.policiesGeoipRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipRetrieve(
        requestParameters: PoliciesGeoipRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GeoIPPolicy> {
        const response = await this.policiesGeoipRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/policies/geoip/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipUpdateRaw(
        requestParameters: PoliciesGeoipUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GeoIPPolicy>> {
        const requestOptions = await this.policiesGeoipUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * GeoIP Viewset
     */
    async policiesGeoipUpdate(
        requestParameters: PoliciesGeoipUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GeoIPPolicy> {
        const response = await this.policiesGeoipUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/geoip/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesGeoipUsedByListRaw(
        requestParameters: PoliciesGeoipUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.policiesGeoipUsedByListRequestOpts(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 policiesGeoipUsedByList(
        requestParameters: PoliciesGeoipUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesGeoipUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/password/`;

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordCreateRaw(
        requestParameters: PoliciesPasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordPolicy>> {
        const requestOptions = await this.policiesPasswordCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordCreate(
        requestParameters: PoliciesPasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordPolicy> {
        const response = await this.policiesPasswordCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordDestroyRaw(
        requestParameters: PoliciesPasswordDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesPasswordDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Password Policy Viewset
     */
    async policiesPasswordDestroy(
        requestParameters: PoliciesPasswordDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesPasswordDestroyRaw(requestParameters, initOverrides);
    }

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

        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 = `/policies/password_expiry/`;

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryCreateRaw(
        requestParameters: PoliciesPasswordExpiryCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordExpiryPolicy>> {
        const requestOptions =
            await this.policiesPasswordExpiryCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryCreate(
        requestParameters: PoliciesPasswordExpiryCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordExpiryPolicy> {
        const response = await this.policiesPasswordExpiryCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/password_expiry/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryDestroyRaw(
        requestParameters: PoliciesPasswordExpiryDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.policiesPasswordExpiryDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryDestroy(
        requestParameters: PoliciesPasswordExpiryDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesPasswordExpiryDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["created"] != null) {
            queryParameters["created"] = (requestParameters["created"] as any).toISOString();
        }

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

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

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

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

        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["policyUuid"] != null) {
            queryParameters["policy_uuid"] = requestParameters["policyUuid"];
        }

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

        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 = `/policies/password_expiry/`;

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryListRaw(
        requestParameters: PoliciesPasswordExpiryListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPasswordExpiryPolicyList>> {
        const requestOptions = await this.policiesPasswordExpiryListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryList(
        requestParameters: PoliciesPasswordExpiryListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPasswordExpiryPolicyList> {
        const response = await this.policiesPasswordExpiryListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/password_expiry/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryPartialUpdateRaw(
        requestParameters: PoliciesPasswordExpiryPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordExpiryPolicy>> {
        const requestOptions =
            await this.policiesPasswordExpiryPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryPartialUpdate(
        requestParameters: PoliciesPasswordExpiryPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordExpiryPolicy> {
        const response = await this.policiesPasswordExpiryPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/password_expiry/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryRetrieveRaw(
        requestParameters: PoliciesPasswordExpiryRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordExpiryPolicy>> {
        const requestOptions =
            await this.policiesPasswordExpiryRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryRetrieve(
        requestParameters: PoliciesPasswordExpiryRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordExpiryPolicy> {
        const response = await this.policiesPasswordExpiryRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/policies/password_expiry/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryUpdateRaw(
        requestParameters: PoliciesPasswordExpiryUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordExpiryPolicy>> {
        const requestOptions =
            await this.policiesPasswordExpiryUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Expiry Viewset
     */
    async policiesPasswordExpiryUpdate(
        requestParameters: PoliciesPasswordExpiryUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordExpiryPolicy> {
        const response = await this.policiesPasswordExpiryUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/password_expiry/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesPasswordExpiryUsedByListRaw(
        requestParameters: PoliciesPasswordExpiryUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.policiesPasswordExpiryUsedByListRequestOpts(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 policiesPasswordExpiryUsedByList(
        requestParameters: PoliciesPasswordExpiryUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesPasswordExpiryUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

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

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

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

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

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

        if (requestParameters["created"] != null) {
            queryParameters["created"] = (requestParameters["created"] as any).toISOString();
        }

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

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

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

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

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

        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["passwordField"] != null) {
            queryParameters["password_field"] = requestParameters["passwordField"];
        }

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

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

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

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

        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 = `/policies/password/`;

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordListRaw(
        requestParameters: PoliciesPasswordListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPasswordPolicyList>> {
        const requestOptions = await this.policiesPasswordListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordList(
        requestParameters: PoliciesPasswordListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPasswordPolicyList> {
        const response = await this.policiesPasswordListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordPartialUpdateRaw(
        requestParameters: PoliciesPasswordPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordPolicy>> {
        const requestOptions =
            await this.policiesPasswordPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordPartialUpdate(
        requestParameters: PoliciesPasswordPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordPolicy> {
        const response = await this.policiesPasswordPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordRetrieveRaw(
        requestParameters: PoliciesPasswordRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordPolicy>> {
        const requestOptions = await this.policiesPasswordRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordRetrieve(
        requestParameters: PoliciesPasswordRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordPolicy> {
        const response = await this.policiesPasswordRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/policies/password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordUpdateRaw(
        requestParameters: PoliciesPasswordUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PasswordPolicy>> {
        const requestOptions = await this.policiesPasswordUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Policy Viewset
     */
    async policiesPasswordUpdate(
        requestParameters: PoliciesPasswordUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PasswordPolicy> {
        const response = await this.policiesPasswordUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/password/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesPasswordUsedByListRaw(
        requestParameters: PoliciesPasswordUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions = await this.policiesPasswordUsedByListRequestOpts(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 policiesPasswordUsedByList(
        requestParameters: PoliciesPasswordUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesPasswordUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/reputation/`;

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationCreateRaw(
        requestParameters: PoliciesReputationCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ReputationPolicy>> {
        const requestOptions = await this.policiesReputationCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationCreate(
        requestParameters: PoliciesReputationCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ReputationPolicy> {
        const response = await this.policiesReputationCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/reputation/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationDestroyRaw(
        requestParameters: PoliciesReputationDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.policiesReputationDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationDestroy(
        requestParameters: PoliciesReputationDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesReputationDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

        if (requestParameters["created"] != null) {
            queryParameters["created"] = (requestParameters["created"] as any).toISOString();
        }

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

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

        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["policyUuid"] != null) {
            queryParameters["policy_uuid"] = requestParameters["policyUuid"];
        }

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

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

        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 = `/policies/reputation/`;

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationListRaw(
        requestParameters: PoliciesReputationListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedReputationPolicyList>> {
        const requestOptions = await this.policiesReputationListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationList(
        requestParameters: PoliciesReputationListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedReputationPolicyList> {
        const response = await this.policiesReputationListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/reputation/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationPartialUpdateRaw(
        requestParameters: PoliciesReputationPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ReputationPolicy>> {
        const requestOptions =
            await this.policiesReputationPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationPartialUpdate(
        requestParameters: PoliciesReputationPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ReputationPolicy> {
        const response = await this.policiesReputationPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/reputation/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationRetrieveRaw(
        requestParameters: PoliciesReputationRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ReputationPolicy>> {
        const requestOptions = await this.policiesReputationRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationRetrieve(
        requestParameters: PoliciesReputationRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ReputationPolicy> {
        const response = await this.policiesReputationRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/reputation/scores/{reputation_uuid}/`;
        urlPath = urlPath.replace(
            `{${"reputation_uuid"}}`,
            encodeURIComponent(String(requestParameters["reputationUuid"])),
        );

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

    /**
     * Reputation Viewset
     */
    async policiesReputationScoresDestroyRaw(
        requestParameters: PoliciesReputationScoresDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.policiesReputationScoresDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Reputation Viewset
     */
    async policiesReputationScoresDestroy(
        requestParameters: PoliciesReputationScoresDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesReputationScoresDestroyRaw(requestParameters, initOverrides);
    }

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

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

        if (requestParameters["identifierIn"] != null) {
            queryParameters["identifier_in"] = requestParameters["identifierIn"]!.join(
                runtime.COLLECTION_FORMATS["csv"],
            );
        }

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

        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["score"] != null) {
            queryParameters["score"] = requestParameters["score"];
        }

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

        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 = `/policies/reputation/scores/`;

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

    /**
     * Reputation Viewset
     */
    async policiesReputationScoresListRaw(
        requestParameters: PoliciesReputationScoresListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedReputationList>> {
        const requestOptions =
            await this.policiesReputationScoresListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Reputation Viewset
     */
    async policiesReputationScoresList(
        requestParameters: PoliciesReputationScoresListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedReputationList> {
        const response = await this.policiesReputationScoresListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/reputation/scores/{reputation_uuid}/`;
        urlPath = urlPath.replace(
            `{${"reputation_uuid"}}`,
            encodeURIComponent(String(requestParameters["reputationUuid"])),
        );

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

    /**
     * Reputation Viewset
     */
    async policiesReputationScoresRetrieveRaw(
        requestParameters: PoliciesReputationScoresRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Reputation>> {
        const requestOptions =
            await this.policiesReputationScoresRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Reputation Viewset
     */
    async policiesReputationScoresRetrieve(
        requestParameters: PoliciesReputationScoresRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Reputation> {
        const response = await this.policiesReputationScoresRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/reputation/scores/{reputation_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"reputation_uuid"}}`,
            encodeURIComponent(String(requestParameters["reputationUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesReputationScoresUsedByListRaw(
        requestParameters: PoliciesReputationScoresUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.policiesReputationScoresUsedByListRequestOpts(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 policiesReputationScoresUsedByList(
        requestParameters: PoliciesReputationScoresUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesReputationScoresUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/policies/reputation/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationUpdateRaw(
        requestParameters: PoliciesReputationUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<ReputationPolicy>> {
        const requestOptions = await this.policiesReputationUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Reputation Policy Viewset
     */
    async policiesReputationUpdate(
        requestParameters: PoliciesReputationUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<ReputationPolicy> {
        const response = await this.policiesReputationUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/reputation/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesReputationUsedByListRaw(
        requestParameters: PoliciesReputationUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.policiesReputationUsedByListRequestOpts(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 policiesReputationUsedByList(
        requestParameters: PoliciesReputationUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesReputationUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/unique_password/`;

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordCreateRaw(
        requestParameters: PoliciesUniquePasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UniquePasswordPolicy>> {
        const requestOptions =
            await this.policiesUniquePasswordCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordCreate(
        requestParameters: PoliciesUniquePasswordCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UniquePasswordPolicy> {
        const response = await this.policiesUniquePasswordCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/unique_password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordDestroyRaw(
        requestParameters: PoliciesUniquePasswordDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.policiesUniquePasswordDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordDestroy(
        requestParameters: PoliciesUniquePasswordDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.policiesUniquePasswordDestroyRaw(requestParameters, initOverrides);
    }

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

        if (requestParameters["created"] != null) {
            queryParameters["created"] = (requestParameters["created"] as any).toISOString();
        }

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

        if (requestParameters["lastUpdated"] != null) {
            queryParameters["last_updated"] = (
                requestParameters["lastUpdated"] as any
            ).toISOString();
        }

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

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

        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["passwordField"] != null) {
            queryParameters["password_field"] = requestParameters["passwordField"];
        }

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

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

        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 = `/policies/unique_password/`;

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordListRaw(
        requestParameters: PoliciesUniquePasswordListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUniquePasswordPolicyList>> {
        const requestOptions = await this.policiesUniquePasswordListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordList(
        requestParameters: PoliciesUniquePasswordListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUniquePasswordPolicyList> {
        const response = await this.policiesUniquePasswordListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/policies/unique_password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordPartialUpdateRaw(
        requestParameters: PoliciesUniquePasswordPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UniquePasswordPolicy>> {
        const requestOptions =
            await this.policiesUniquePasswordPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordPartialUpdate(
        requestParameters: PoliciesUniquePasswordPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UniquePasswordPolicy> {
        const response = await this.policiesUniquePasswordPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/unique_password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordRetrieveRaw(
        requestParameters: PoliciesUniquePasswordRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UniquePasswordPolicy>> {
        const requestOptions =
            await this.policiesUniquePasswordRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordRetrieve(
        requestParameters: PoliciesUniquePasswordRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UniquePasswordPolicy> {
        const response = await this.policiesUniquePasswordRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/policies/unique_password/{policy_uuid}/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordUpdateRaw(
        requestParameters: PoliciesUniquePasswordUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UniquePasswordPolicy>> {
        const requestOptions =
            await this.policiesUniquePasswordUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Password Uniqueness Policy Viewset
     */
    async policiesUniquePasswordUpdate(
        requestParameters: PoliciesUniquePasswordUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UniquePasswordPolicy> {
        const response = await this.policiesUniquePasswordUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/policies/unique_password/{policy_uuid}/used_by/`;
        urlPath = urlPath.replace(
            `{${"policy_uuid"}}`,
            encodeURIComponent(String(requestParameters["policyUuid"])),
        );

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

    /**
     * Get a list of all objects that use this object
     */
    async policiesUniquePasswordUsedByListRaw(
        requestParameters: PoliciesUniquePasswordUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UsedBy>>> {
        const requestOptions =
            await this.policiesUniquePasswordUsedByListRequestOpts(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 policiesUniquePasswordUsedByList(
        requestParameters: PoliciesUniquePasswordUsedByListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UsedBy>> {
        const response = await this.policiesUniquePasswordUsedByListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }
}
