/* 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 {
    BindingTypeEnum,
    DigestAlgorithmEnum,
    GroupKerberosSourceConnection,
    GroupKerberosSourceConnectionRequest,
    GroupLDAPSourceConnection,
    GroupLDAPSourceConnectionRequest,
    GroupMatchingModeEnum,
    GroupOAuthSourceConnection,
    GroupOAuthSourceConnectionRequest,
    GroupPlexSourceConnection,
    GroupPlexSourceConnectionRequest,
    GroupSAMLSourceConnection,
    GroupSAMLSourceConnectionRequest,
    GroupSourceConnection,
    GroupSourceConnectionRequest,
    GroupTelegramSourceConnection,
    GroupTelegramSourceConnectionRequest,
    KadminTypeEnum,
    KerberosSource,
    KerberosSourceRequest,
    LDAPDebug,
    LDAPSource,
    LDAPSourceRequest,
    OAuthSource,
    OAuthSourceRequest,
    PaginatedGroupKerberosSourceConnectionList,
    PaginatedGroupLDAPSourceConnectionList,
    PaginatedGroupOAuthSourceConnectionList,
    PaginatedGroupPlexSourceConnectionList,
    PaginatedGroupSAMLSourceConnectionList,
    PaginatedGroupSourceConnectionList,
    PaginatedGroupTelegramSourceConnectionList,
    PaginatedKerberosSourceList,
    PaginatedLDAPSourceList,
    PaginatedOAuthSourceList,
    PaginatedPlexSourceList,
    PaginatedSAMLSourceList,
    PaginatedSCIMSourceGroupList,
    PaginatedSCIMSourceList,
    PaginatedSCIMSourceUserList,
    PaginatedSourceList,
    PaginatedTelegramSourceList,
    PaginatedUserKerberosSourceConnectionList,
    PaginatedUserLDAPSourceConnectionList,
    PaginatedUserOAuthSourceConnectionList,
    PaginatedUserPlexSourceConnectionList,
    PaginatedUserSAMLSourceConnectionList,
    PaginatedUserSourceConnectionList,
    PaginatedUserTelegramSourceConnectionList,
    PatchedGroupKerberosSourceConnectionRequest,
    PatchedGroupLDAPSourceConnectionRequest,
    PatchedGroupOAuthSourceConnectionRequest,
    PatchedGroupPlexSourceConnectionRequest,
    PatchedGroupSAMLSourceConnectionRequest,
    PatchedGroupSourceConnectionRequest,
    PatchedGroupTelegramSourceConnectionRequest,
    PatchedKerberosSourceRequest,
    PatchedLDAPSourceRequest,
    PatchedOAuthSourceRequest,
    PatchedPlexSourceRequest,
    PatchedSAMLSourceRequest,
    PatchedSCIMSourceGroupRequest,
    PatchedSCIMSourceRequest,
    PatchedSCIMSourceUserRequest,
    PatchedTelegramSourceRequest,
    PatchedUserKerberosSourceConnectionRequest,
    PatchedUserLDAPSourceConnectionRequest,
    PatchedUserOAuthSourceConnectionRequest,
    PatchedUserPlexSourceConnectionRequest,
    PatchedUserSAMLSourceConnectionRequest,
    PatchedUserSourceConnectionRequest,
    PatchedUserTelegramSourceConnectionRequest,
    PlexSource,
    PlexSourceRequest,
    PlexTokenRedeemRequest,
    PolicyEngineMode,
    RedirectChallenge,
    SAMLMetadata,
    SAMLNameIDPolicyEnum,
    SAMLSource,
    SAMLSourceRequest,
    SCIMSource,
    SCIMSourceGroup,
    SCIMSourceGroupRequest,
    SCIMSourceRequest,
    SCIMSourceUser,
    SCIMSourceUserRequest,
    SignatureAlgorithmEnum,
    Source,
    SourceType,
    SyncStatus,
    TelegramAuthRequest,
    TelegramSource,
    TelegramSourceRequest,
    TypeCreate,
    UsedBy,
    UserKerberosSourceConnection,
    UserKerberosSourceConnectionRequest,
    UserLDAPSourceConnection,
    UserLDAPSourceConnectionRequest,
    UserMatchingModeEnum,
    UserOAuthSourceConnection,
    UserOAuthSourceConnectionRequest,
    UserPlexSourceConnection,
    UserPlexSourceConnectionRequest,
    UserSAMLSourceConnection,
    UserSAMLSourceConnectionRequest,
    UserSetting,
    UserSourceConnection,
    UserSourceConnectionRequest,
    UserTelegramSourceConnection,
    UserTelegramSourceConnectionRequest,
} from "../models/index";
import {
    GroupKerberosSourceConnectionFromJSON,
    GroupKerberosSourceConnectionRequestToJSON,
    GroupLDAPSourceConnectionFromJSON,
    GroupLDAPSourceConnectionRequestToJSON,
    GroupOAuthSourceConnectionFromJSON,
    GroupOAuthSourceConnectionRequestToJSON,
    GroupPlexSourceConnectionFromJSON,
    GroupPlexSourceConnectionRequestToJSON,
    GroupSAMLSourceConnectionFromJSON,
    GroupSAMLSourceConnectionRequestToJSON,
    GroupSourceConnectionFromJSON,
    GroupSourceConnectionRequestToJSON,
    GroupTelegramSourceConnectionFromJSON,
    GroupTelegramSourceConnectionRequestToJSON,
    KerberosSourceFromJSON,
    KerberosSourceRequestToJSON,
    LDAPDebugFromJSON,
    LDAPSourceFromJSON,
    LDAPSourceRequestToJSON,
    OAuthSourceFromJSON,
    OAuthSourceRequestToJSON,
    PaginatedGroupKerberosSourceConnectionListFromJSON,
    PaginatedGroupLDAPSourceConnectionListFromJSON,
    PaginatedGroupOAuthSourceConnectionListFromJSON,
    PaginatedGroupPlexSourceConnectionListFromJSON,
    PaginatedGroupSAMLSourceConnectionListFromJSON,
    PaginatedGroupSourceConnectionListFromJSON,
    PaginatedGroupTelegramSourceConnectionListFromJSON,
    PaginatedKerberosSourceListFromJSON,
    PaginatedLDAPSourceListFromJSON,
    PaginatedOAuthSourceListFromJSON,
    PaginatedPlexSourceListFromJSON,
    PaginatedSAMLSourceListFromJSON,
    PaginatedSCIMSourceGroupListFromJSON,
    PaginatedSCIMSourceListFromJSON,
    PaginatedSCIMSourceUserListFromJSON,
    PaginatedSourceListFromJSON,
    PaginatedTelegramSourceListFromJSON,
    PaginatedUserKerberosSourceConnectionListFromJSON,
    PaginatedUserLDAPSourceConnectionListFromJSON,
    PaginatedUserOAuthSourceConnectionListFromJSON,
    PaginatedUserPlexSourceConnectionListFromJSON,
    PaginatedUserSAMLSourceConnectionListFromJSON,
    PaginatedUserSourceConnectionListFromJSON,
    PaginatedUserTelegramSourceConnectionListFromJSON,
    PatchedGroupKerberosSourceConnectionRequestToJSON,
    PatchedGroupLDAPSourceConnectionRequestToJSON,
    PatchedGroupOAuthSourceConnectionRequestToJSON,
    PatchedGroupPlexSourceConnectionRequestToJSON,
    PatchedGroupSAMLSourceConnectionRequestToJSON,
    PatchedGroupSourceConnectionRequestToJSON,
    PatchedGroupTelegramSourceConnectionRequestToJSON,
    PatchedKerberosSourceRequestToJSON,
    PatchedLDAPSourceRequestToJSON,
    PatchedOAuthSourceRequestToJSON,
    PatchedPlexSourceRequestToJSON,
    PatchedSAMLSourceRequestToJSON,
    PatchedSCIMSourceGroupRequestToJSON,
    PatchedSCIMSourceRequestToJSON,
    PatchedSCIMSourceUserRequestToJSON,
    PatchedTelegramSourceRequestToJSON,
    PatchedUserKerberosSourceConnectionRequestToJSON,
    PatchedUserLDAPSourceConnectionRequestToJSON,
    PatchedUserOAuthSourceConnectionRequestToJSON,
    PatchedUserPlexSourceConnectionRequestToJSON,
    PatchedUserSAMLSourceConnectionRequestToJSON,
    PatchedUserSourceConnectionRequestToJSON,
    PatchedUserTelegramSourceConnectionRequestToJSON,
    PlexSourceFromJSON,
    PlexSourceRequestToJSON,
    PlexTokenRedeemRequestToJSON,
    RedirectChallengeFromJSON,
    SAMLMetadataFromJSON,
    SAMLSourceFromJSON,
    SAMLSourceRequestToJSON,
    SCIMSourceFromJSON,
    SCIMSourceGroupFromJSON,
    SCIMSourceGroupRequestToJSON,
    SCIMSourceRequestToJSON,
    SCIMSourceUserFromJSON,
    SCIMSourceUserRequestToJSON,
    SourceFromJSON,
    SourceTypeFromJSON,
    SyncStatusFromJSON,
    TelegramAuthRequestToJSON,
    TelegramSourceFromJSON,
    TelegramSourceRequestToJSON,
    TypeCreateFromJSON,
    UsedByFromJSON,
    UserKerberosSourceConnectionFromJSON,
    UserKerberosSourceConnectionRequestToJSON,
    UserLDAPSourceConnectionFromJSON,
    UserLDAPSourceConnectionRequestToJSON,
    UserOAuthSourceConnectionFromJSON,
    UserOAuthSourceConnectionRequestToJSON,
    UserPlexSourceConnectionFromJSON,
    UserPlexSourceConnectionRequestToJSON,
    UserSAMLSourceConnectionFromJSON,
    UserSAMLSourceConnectionRequestToJSON,
    UserSettingFromJSON,
    UserSourceConnectionFromJSON,
    UserSourceConnectionRequestToJSON,
    UserTelegramSourceConnectionFromJSON,
    UserTelegramSourceConnectionRequestToJSON,
} from "../models/index";
import * as runtime from "../runtime";

export interface SourcesAllDestroyRequest {
    slug: string;
}

export interface SourcesAllListRequest {
    managed?: string;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    pbmUuid?: string;
    search?: string;
    slug?: string;
}

export interface SourcesAllRetrieveRequest {
    slug: string;
}

export interface SourcesAllUsedByListRequest {
    slug: string;
}

export interface SourcesGroupConnectionsAllDestroyRequest {
    id: number;
}

export interface SourcesGroupConnectionsAllListRequest {
    group?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesGroupConnectionsAllPartialUpdateRequest {
    id: number;
    patchedGroupSourceConnectionRequest?: PatchedGroupSourceConnectionRequest;
}

export interface SourcesGroupConnectionsAllRetrieveRequest {
    id: number;
}

export interface SourcesGroupConnectionsAllUpdateRequest {
    id: number;
    groupSourceConnectionRequest: GroupSourceConnectionRequest;
}

export interface SourcesGroupConnectionsAllUsedByListRequest {
    id: number;
}

export interface SourcesGroupConnectionsKerberosCreateRequest {
    groupKerberosSourceConnectionRequest: GroupKerberosSourceConnectionRequest;
}

export interface SourcesGroupConnectionsKerberosDestroyRequest {
    id: number;
}

export interface SourcesGroupConnectionsKerberosListRequest {
    group?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesGroupConnectionsKerberosPartialUpdateRequest {
    id: number;
    patchedGroupKerberosSourceConnectionRequest?: PatchedGroupKerberosSourceConnectionRequest;
}

export interface SourcesGroupConnectionsKerberosRetrieveRequest {
    id: number;
}

export interface SourcesGroupConnectionsKerberosUpdateRequest {
    id: number;
    groupKerberosSourceConnectionRequest: GroupKerberosSourceConnectionRequest;
}

export interface SourcesGroupConnectionsKerberosUsedByListRequest {
    id: number;
}

export interface SourcesGroupConnectionsLdapCreateRequest {
    groupLDAPSourceConnectionRequest: GroupLDAPSourceConnectionRequest;
}

export interface SourcesGroupConnectionsLdapDestroyRequest {
    id: number;
}

export interface SourcesGroupConnectionsLdapListRequest {
    group?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesGroupConnectionsLdapPartialUpdateRequest {
    id: number;
    patchedGroupLDAPSourceConnectionRequest?: PatchedGroupLDAPSourceConnectionRequest;
}

export interface SourcesGroupConnectionsLdapRetrieveRequest {
    id: number;
}

export interface SourcesGroupConnectionsLdapUpdateRequest {
    id: number;
    groupLDAPSourceConnectionRequest: GroupLDAPSourceConnectionRequest;
}

export interface SourcesGroupConnectionsLdapUsedByListRequest {
    id: number;
}

export interface SourcesGroupConnectionsOauthCreateRequest {
    groupOAuthSourceConnectionRequest: GroupOAuthSourceConnectionRequest;
}

export interface SourcesGroupConnectionsOauthDestroyRequest {
    id: number;
}

export interface SourcesGroupConnectionsOauthListRequest {
    group?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesGroupConnectionsOauthPartialUpdateRequest {
    id: number;
    patchedGroupOAuthSourceConnectionRequest?: PatchedGroupOAuthSourceConnectionRequest;
}

export interface SourcesGroupConnectionsOauthRetrieveRequest {
    id: number;
}

export interface SourcesGroupConnectionsOauthUpdateRequest {
    id: number;
    groupOAuthSourceConnectionRequest: GroupOAuthSourceConnectionRequest;
}

export interface SourcesGroupConnectionsOauthUsedByListRequest {
    id: number;
}

export interface SourcesGroupConnectionsPlexCreateRequest {
    groupPlexSourceConnectionRequest: GroupPlexSourceConnectionRequest;
}

export interface SourcesGroupConnectionsPlexDestroyRequest {
    id: number;
}

export interface SourcesGroupConnectionsPlexListRequest {
    group?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesGroupConnectionsPlexPartialUpdateRequest {
    id: number;
    patchedGroupPlexSourceConnectionRequest?: PatchedGroupPlexSourceConnectionRequest;
}

export interface SourcesGroupConnectionsPlexRetrieveRequest {
    id: number;
}

export interface SourcesGroupConnectionsPlexUpdateRequest {
    id: number;
    groupPlexSourceConnectionRequest: GroupPlexSourceConnectionRequest;
}

export interface SourcesGroupConnectionsPlexUsedByListRequest {
    id: number;
}

export interface SourcesGroupConnectionsSamlCreateRequest {
    groupSAMLSourceConnectionRequest: GroupSAMLSourceConnectionRequest;
}

export interface SourcesGroupConnectionsSamlDestroyRequest {
    id: number;
}

export interface SourcesGroupConnectionsSamlListRequest {
    group?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesGroupConnectionsSamlPartialUpdateRequest {
    id: number;
    patchedGroupSAMLSourceConnectionRequest?: PatchedGroupSAMLSourceConnectionRequest;
}

export interface SourcesGroupConnectionsSamlRetrieveRequest {
    id: number;
}

export interface SourcesGroupConnectionsSamlUpdateRequest {
    id: number;
    groupSAMLSourceConnectionRequest: GroupSAMLSourceConnectionRequest;
}

export interface SourcesGroupConnectionsSamlUsedByListRequest {
    id: number;
}

export interface SourcesGroupConnectionsTelegramCreateRequest {
    groupTelegramSourceConnectionRequest: GroupTelegramSourceConnectionRequest;
}

export interface SourcesGroupConnectionsTelegramDestroyRequest {
    id: number;
}

export interface SourcesGroupConnectionsTelegramListRequest {
    group?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesGroupConnectionsTelegramPartialUpdateRequest {
    id: number;
    patchedGroupTelegramSourceConnectionRequest?: PatchedGroupTelegramSourceConnectionRequest;
}

export interface SourcesGroupConnectionsTelegramRetrieveRequest {
    id: number;
}

export interface SourcesGroupConnectionsTelegramUpdateRequest {
    id: number;
    groupTelegramSourceConnectionRequest: GroupTelegramSourceConnectionRequest;
}

export interface SourcesGroupConnectionsTelegramUsedByListRequest {
    id: number;
}

export interface SourcesKerberosCreateRequest {
    kerberosSourceRequest: KerberosSourceRequest;
}

export interface SourcesKerberosDestroyRequest {
    slug: string;
}

export interface SourcesKerberosListRequest {
    enabled?: boolean;
    kadminType?: KadminTypeEnum;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    passwordLoginUpdateInternalPassword?: boolean;
    pbmUuid?: string;
    realm?: string;
    search?: string;
    slug?: string;
    spnegoServerName?: string;
    syncPrincipal?: string;
    syncUsers?: boolean;
    syncUsersPassword?: boolean;
}

export interface SourcesKerberosPartialUpdateRequest {
    slug: string;
    patchedKerberosSourceRequest?: PatchedKerberosSourceRequest;
}

export interface SourcesKerberosRetrieveRequest {
    slug: string;
}

export interface SourcesKerberosSyncStatusRetrieveRequest {
    slug: string;
}

export interface SourcesKerberosUpdateRequest {
    slug: string;
    kerberosSourceRequest: KerberosSourceRequest;
}

export interface SourcesKerberosUsedByListRequest {
    slug: string;
}

export interface SourcesLdapCreateRequest {
    lDAPSourceRequest: LDAPSourceRequest;
}

export interface SourcesLdapDebugRetrieveRequest {
    slug: string;
}

export interface SourcesLdapDestroyRequest {
    slug: string;
}

export interface SourcesLdapListRequest {
    additionalGroupDn?: string;
    additionalUserDn?: string;
    baseDn?: string;
    bindCn?: string;
    clientCertificate?: string;
    deleteNotFoundObjects?: boolean;
    enabled?: boolean;
    groupMembershipField?: string;
    groupObjectFilter?: string;
    groupPropertyMappings?: Array<string>;
    lookupGroupsFromUser?: boolean;
    name?: string;
    objectUniquenessField?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    passwordLoginUpdateInternalPassword?: boolean;
    pbmUuid?: string;
    peerCertificate?: string;
    search?: string;
    serverUri?: string;
    slug?: string;
    sni?: boolean;
    startTls?: boolean;
    syncGroups?: boolean;
    syncParentGroup?: string;
    syncUsers?: boolean;
    syncUsersPassword?: boolean;
    userMembershipAttribute?: string;
    userObjectFilter?: string;
    userPropertyMappings?: Array<string>;
}

export interface SourcesLdapPartialUpdateRequest {
    slug: string;
    patchedLDAPSourceRequest?: PatchedLDAPSourceRequest;
}

export interface SourcesLdapRetrieveRequest {
    slug: string;
}

export interface SourcesLdapSyncStatusRetrieveRequest {
    slug: string;
}

export interface SourcesLdapUpdateRequest {
    slug: string;
    lDAPSourceRequest: LDAPSourceRequest;
}

export interface SourcesLdapUsedByListRequest {
    slug: string;
}

export interface SourcesOauthCreateRequest {
    oAuthSourceRequest: OAuthSourceRequest;
}

export interface SourcesOauthDestroyRequest {
    slug: string;
}

export interface SourcesOauthListRequest {
    accessTokenUrl?: string;
    additionalScopes?: string;
    authenticationFlow?: string;
    authorizationUrl?: string;
    consumerKey?: string;
    enabled?: boolean;
    enrollmentFlow?: string;
    groupMatchingMode?: GroupMatchingModeEnum;
    hasJwks?: boolean;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    pbmUuid?: string;
    policyEngineMode?: PolicyEngineMode;
    profileUrl?: string;
    providerType?: string;
    requestTokenUrl?: string;
    search?: string;
    slug?: string;
    userMatchingMode?: UserMatchingModeEnum;
}

export interface SourcesOauthPartialUpdateRequest {
    slug: string;
    patchedOAuthSourceRequest?: PatchedOAuthSourceRequest;
}

export interface SourcesOauthRetrieveRequest {
    slug: string;
}

export interface SourcesOauthSourceTypesListRequest {
    name?: string;
}

export interface SourcesOauthUpdateRequest {
    slug: string;
    oAuthSourceRequest: OAuthSourceRequest;
}

export interface SourcesOauthUsedByListRequest {
    slug: string;
}

export interface SourcesPlexCreateRequest {
    plexSourceRequest: PlexSourceRequest;
}

export interface SourcesPlexDestroyRequest {
    slug: string;
}

export interface SourcesPlexListRequest {
    allowFriends?: boolean;
    authenticationFlow?: string;
    clientId?: string;
    enabled?: boolean;
    enrollmentFlow?: string;
    groupMatchingMode?: GroupMatchingModeEnum;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    pbmUuid?: string;
    policyEngineMode?: PolicyEngineMode;
    search?: string;
    slug?: string;
    userMatchingMode?: UserMatchingModeEnum;
}

export interface SourcesPlexPartialUpdateRequest {
    slug: string;
    patchedPlexSourceRequest?: PatchedPlexSourceRequest;
}

export interface SourcesPlexRedeemTokenAuthenticatedCreateRequest {
    plexTokenRedeemRequest: PlexTokenRedeemRequest;
    slug?: string;
}

export interface SourcesPlexRedeemTokenCreateRequest {
    plexTokenRedeemRequest: PlexTokenRedeemRequest;
    slug?: string;
}

export interface SourcesPlexRetrieveRequest {
    slug: string;
}

export interface SourcesPlexUpdateRequest {
    slug: string;
    plexSourceRequest: PlexSourceRequest;
}

export interface SourcesPlexUsedByListRequest {
    slug: string;
}

export interface SourcesSamlCreateRequest {
    sAMLSourceRequest: SAMLSourceRequest;
}

export interface SourcesSamlDestroyRequest {
    slug: string;
}

export interface SourcesSamlListRequest {
    allowIdpInitiated?: boolean;
    authenticationFlow?: string;
    bindingType?: BindingTypeEnum;
    digestAlgorithm?: DigestAlgorithmEnum;
    enabled?: boolean;
    enrollmentFlow?: string;
    forceAuthn?: boolean;
    issuer?: string;
    managed?: string;
    name?: string;
    nameIdPolicy?: SAMLNameIDPolicyEnum;
    ordering?: string;
    page?: number;
    pageSize?: number;
    pbmUuid?: string;
    policyEngineMode?: PolicyEngineMode;
    preAuthenticationFlow?: string;
    search?: string;
    signatureAlgorithm?: SignatureAlgorithmEnum;
    signedAssertion?: boolean;
    signedResponse?: boolean;
    signingKp?: string;
    sloUrl?: string;
    slug?: string;
    ssoUrl?: string;
    temporaryUserDeleteAfter?: string;
    userMatchingMode?: UserMatchingModeEnum;
    verificationKp?: string;
}

export interface SourcesSamlMetadataRetrieveRequest {
    slug: string;
}

export interface SourcesSamlPartialUpdateRequest {
    slug: string;
    patchedSAMLSourceRequest?: PatchedSAMLSourceRequest;
}

export interface SourcesSamlRetrieveRequest {
    slug: string;
}

export interface SourcesSamlUpdateRequest {
    slug: string;
    sAMLSourceRequest: SAMLSourceRequest;
}

export interface SourcesSamlUsedByListRequest {
    slug: string;
}

export interface SourcesScimCreateRequest {
    sCIMSourceRequest: SCIMSourceRequest;
}

export interface SourcesScimDestroyRequest {
    slug: string;
}

export interface SourcesScimGroupsCreateRequest {
    sCIMSourceGroupRequest: SCIMSourceGroupRequest;
}

export interface SourcesScimGroupsDestroyRequest {
    id: string;
}

export interface SourcesScimGroupsListRequest {
    groupGroupUuid?: string;
    groupName?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
}

export interface SourcesScimGroupsPartialUpdateRequest {
    id: string;
    patchedSCIMSourceGroupRequest?: PatchedSCIMSourceGroupRequest;
}

export interface SourcesScimGroupsRetrieveRequest {
    id: string;
}

export interface SourcesScimGroupsUpdateRequest {
    id: string;
    sCIMSourceGroupRequest: SCIMSourceGroupRequest;
}

export interface SourcesScimGroupsUsedByListRequest {
    id: string;
}

export interface SourcesScimListRequest {
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    pbmUuid?: string;
    search?: string;
    slug?: string;
}

export interface SourcesScimPartialUpdateRequest {
    slug: string;
    patchedSCIMSourceRequest?: PatchedSCIMSourceRequest;
}

export interface SourcesScimRetrieveRequest {
    slug: string;
}

export interface SourcesScimUpdateRequest {
    slug: string;
    sCIMSourceRequest: SCIMSourceRequest;
}

export interface SourcesScimUsedByListRequest {
    slug: string;
}

export interface SourcesScimUsersCreateRequest {
    sCIMSourceUserRequest: SCIMSourceUserRequest;
}

export interface SourcesScimUsersDestroyRequest {
    id: string;
}

export interface SourcesScimUsersListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    userId?: number;
    userUsername?: string;
}

export interface SourcesScimUsersPartialUpdateRequest {
    id: string;
    patchedSCIMSourceUserRequest?: PatchedSCIMSourceUserRequest;
}

export interface SourcesScimUsersRetrieveRequest {
    id: string;
}

export interface SourcesScimUsersUpdateRequest {
    id: string;
    sCIMSourceUserRequest: SCIMSourceUserRequest;
}

export interface SourcesScimUsersUsedByListRequest {
    id: string;
}

export interface SourcesTelegramConnectUserCreateRequest {
    slug: string;
    telegramAuthRequest: TelegramAuthRequest;
}

export interface SourcesTelegramCreateRequest {
    telegramSourceRequest: TelegramSourceRequest;
}

export interface SourcesTelegramDestroyRequest {
    slug: string;
}

export interface SourcesTelegramListRequest {
    authenticationFlow?: string;
    botUsername?: string;
    enabled?: boolean;
    enrollmentFlow?: string;
    groupMatchingMode?: GroupMatchingModeEnum;
    name?: string;
    ordering?: string;
    page?: number;
    pageSize?: number;
    pbmUuid?: string;
    policyEngineMode?: PolicyEngineMode;
    requestMessageAccess?: boolean;
    search?: string;
    slug?: string;
    userMatchingMode?: UserMatchingModeEnum;
}

export interface SourcesTelegramPartialUpdateRequest {
    slug: string;
    patchedTelegramSourceRequest?: PatchedTelegramSourceRequest;
}

export interface SourcesTelegramRetrieveRequest {
    slug: string;
}

export interface SourcesTelegramUpdateRequest {
    slug: string;
    telegramSourceRequest: TelegramSourceRequest;
}

export interface SourcesTelegramUsedByListRequest {
    slug: string;
}

export interface SourcesUserConnectionsAllDestroyRequest {
    id: number;
}

export interface SourcesUserConnectionsAllListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    user?: number;
}

export interface SourcesUserConnectionsAllPartialUpdateRequest {
    id: number;
    patchedUserSourceConnectionRequest?: PatchedUserSourceConnectionRequest;
}

export interface SourcesUserConnectionsAllRetrieveRequest {
    id: number;
}

export interface SourcesUserConnectionsAllUpdateRequest {
    id: number;
    userSourceConnectionRequest: UserSourceConnectionRequest;
}

export interface SourcesUserConnectionsAllUsedByListRequest {
    id: number;
}

export interface SourcesUserConnectionsKerberosCreateRequest {
    userKerberosSourceConnectionRequest: UserKerberosSourceConnectionRequest;
}

export interface SourcesUserConnectionsKerberosDestroyRequest {
    id: number;
}

export interface SourcesUserConnectionsKerberosListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    user?: number;
}

export interface SourcesUserConnectionsKerberosPartialUpdateRequest {
    id: number;
    patchedUserKerberosSourceConnectionRequest?: PatchedUserKerberosSourceConnectionRequest;
}

export interface SourcesUserConnectionsKerberosRetrieveRequest {
    id: number;
}

export interface SourcesUserConnectionsKerberosUpdateRequest {
    id: number;
    userKerberosSourceConnectionRequest: UserKerberosSourceConnectionRequest;
}

export interface SourcesUserConnectionsKerberosUsedByListRequest {
    id: number;
}

export interface SourcesUserConnectionsLdapCreateRequest {
    userLDAPSourceConnectionRequest: UserLDAPSourceConnectionRequest;
}

export interface SourcesUserConnectionsLdapDestroyRequest {
    id: number;
}

export interface SourcesUserConnectionsLdapListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    user?: number;
}

export interface SourcesUserConnectionsLdapPartialUpdateRequest {
    id: number;
    patchedUserLDAPSourceConnectionRequest?: PatchedUserLDAPSourceConnectionRequest;
}

export interface SourcesUserConnectionsLdapRetrieveRequest {
    id: number;
}

export interface SourcesUserConnectionsLdapUpdateRequest {
    id: number;
    userLDAPSourceConnectionRequest: UserLDAPSourceConnectionRequest;
}

export interface SourcesUserConnectionsLdapUsedByListRequest {
    id: number;
}

export interface SourcesUserConnectionsOauthCreateRequest {
    userOAuthSourceConnectionRequest: UserOAuthSourceConnectionRequest;
}

export interface SourcesUserConnectionsOauthDestroyRequest {
    id: number;
}

export interface SourcesUserConnectionsOauthListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    user?: number;
}

export interface SourcesUserConnectionsOauthPartialUpdateRequest {
    id: number;
    patchedUserOAuthSourceConnectionRequest?: PatchedUserOAuthSourceConnectionRequest;
}

export interface SourcesUserConnectionsOauthRetrieveRequest {
    id: number;
}

export interface SourcesUserConnectionsOauthUpdateRequest {
    id: number;
    userOAuthSourceConnectionRequest: UserOAuthSourceConnectionRequest;
}

export interface SourcesUserConnectionsOauthUsedByListRequest {
    id: number;
}

export interface SourcesUserConnectionsPlexCreateRequest {
    userPlexSourceConnectionRequest: UserPlexSourceConnectionRequest;
}

export interface SourcesUserConnectionsPlexDestroyRequest {
    id: number;
}

export interface SourcesUserConnectionsPlexListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    user?: number;
}

export interface SourcesUserConnectionsPlexPartialUpdateRequest {
    id: number;
    patchedUserPlexSourceConnectionRequest?: PatchedUserPlexSourceConnectionRequest;
}

export interface SourcesUserConnectionsPlexRetrieveRequest {
    id: number;
}

export interface SourcesUserConnectionsPlexUpdateRequest {
    id: number;
    userPlexSourceConnectionRequest: UserPlexSourceConnectionRequest;
}

export interface SourcesUserConnectionsPlexUsedByListRequest {
    id: number;
}

export interface SourcesUserConnectionsSamlCreateRequest {
    userSAMLSourceConnectionRequest: UserSAMLSourceConnectionRequest;
}

export interface SourcesUserConnectionsSamlDestroyRequest {
    id: number;
}

export interface SourcesUserConnectionsSamlListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    user?: number;
}

export interface SourcesUserConnectionsSamlPartialUpdateRequest {
    id: number;
    patchedUserSAMLSourceConnectionRequest?: PatchedUserSAMLSourceConnectionRequest;
}

export interface SourcesUserConnectionsSamlRetrieveRequest {
    id: number;
}

export interface SourcesUserConnectionsSamlUpdateRequest {
    id: number;
    userSAMLSourceConnectionRequest: UserSAMLSourceConnectionRequest;
}

export interface SourcesUserConnectionsSamlUsedByListRequest {
    id: number;
}

export interface SourcesUserConnectionsTelegramCreateRequest {
    userTelegramSourceConnectionRequest: UserTelegramSourceConnectionRequest;
}

export interface SourcesUserConnectionsTelegramDestroyRequest {
    id: number;
}

export interface SourcesUserConnectionsTelegramListRequest {
    ordering?: string;
    page?: number;
    pageSize?: number;
    search?: string;
    sourceSlug?: string;
    user?: number;
}

export interface SourcesUserConnectionsTelegramPartialUpdateRequest {
    id: number;
    patchedUserTelegramSourceConnectionRequest?: PatchedUserTelegramSourceConnectionRequest;
}

export interface SourcesUserConnectionsTelegramRetrieveRequest {
    id: number;
}

export interface SourcesUserConnectionsTelegramUpdateRequest {
    id: number;
    userTelegramSourceConnectionRequest: UserTelegramSourceConnectionRequest;
}

export interface SourcesUserConnectionsTelegramUsedByListRequest {
    id: number;
}

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

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

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

    /**
     * Prevent deletion of built-in sources
     */
    async sourcesAllDestroyRaw(
        requestParameters: SourcesAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.sourcesAllDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Prevent deletion of built-in sources
     */
    async sourcesAllDestroy(
        requestParameters: SourcesAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesAllDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

    /**
     * Source Viewset
     */
    async sourcesAllListRaw(
        requestParameters: SourcesAllListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedSourceList>> {
        const requestOptions = await this.sourcesAllListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async sourcesAllList(
        requestParameters: SourcesAllListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedSourceList> {
        const response = await this.sourcesAllListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

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

    /**
     * Creates request options for sourcesAllTypesList without sending the request
     */
    async sourcesAllTypesListRequestOpts(): 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 = `/sources/all/types/`;

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

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

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

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

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

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

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

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

    /**
     * Creates request options for sourcesAllUserSettingsList without sending the request
     */
    async sourcesAllUserSettingsListRequestOpts(): 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 = `/sources/all/user_settings/`;

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

    /**
     * Get all sources the user can configure
     */
    async sourcesAllUserSettingsListRaw(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<UserSetting>>> {
        const requestOptions = await this.sourcesAllUserSettingsListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all sources the user can configure
     */
    async sourcesAllUserSettingsList(
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<UserSetting>> {
        const response = await this.sourcesAllUserSettingsListRaw(initOverrides);
        return await response.value();
    }

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

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

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllDestroyRaw(
        requestParameters: SourcesGroupConnectionsAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesGroupConnectionsAllDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllDestroy(
        requestParameters: SourcesGroupConnectionsAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesGroupConnectionsAllDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllListRaw(
        requestParameters: SourcesGroupConnectionsAllListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupSourceConnectionList>> {
        const requestOptions =
            await this.sourcesGroupConnectionsAllListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllList(
        requestParameters: SourcesGroupConnectionsAllListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupSourceConnectionList> {
        const response = await this.sourcesGroupConnectionsAllListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllPartialUpdateRaw(
        requestParameters: SourcesGroupConnectionsAllPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsAllPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllPartialUpdate(
        requestParameters: SourcesGroupConnectionsAllPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupSourceConnection> {
        const response = await this.sourcesGroupConnectionsAllPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllRetrieveRaw(
        requestParameters: SourcesGroupConnectionsAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsAllRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllRetrieve(
        requestParameters: SourcesGroupConnectionsAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupSourceConnection> {
        const response = await this.sourcesGroupConnectionsAllRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllUpdateRaw(
        requestParameters: SourcesGroupConnectionsAllUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsAllUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsAllUpdate(
        requestParameters: SourcesGroupConnectionsAllUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupSourceConnection> {
        const response = await this.sourcesGroupConnectionsAllUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/group_connections/kerberos/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosCreateRaw(
        requestParameters: SourcesGroupConnectionsKerberosCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsKerberosCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosCreate(
        requestParameters: SourcesGroupConnectionsKerberosCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupKerberosSourceConnection> {
        const response = await this.sourcesGroupConnectionsKerberosCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosDestroyRaw(
        requestParameters: SourcesGroupConnectionsKerberosDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesGroupConnectionsKerberosDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosDestroy(
        requestParameters: SourcesGroupConnectionsKerberosDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesGroupConnectionsKerberosDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/group_connections/kerberos/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosListRaw(
        requestParameters: SourcesGroupConnectionsKerberosListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupKerberosSourceConnectionList>> {
        const requestOptions =
            await this.sourcesGroupConnectionsKerberosListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosList(
        requestParameters: SourcesGroupConnectionsKerberosListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupKerberosSourceConnectionList> {
        const response = await this.sourcesGroupConnectionsKerberosListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosPartialUpdateRaw(
        requestParameters: SourcesGroupConnectionsKerberosPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsKerberosPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosPartialUpdate(
        requestParameters: SourcesGroupConnectionsKerberosPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupKerberosSourceConnection> {
        const response = await this.sourcesGroupConnectionsKerberosPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosRetrieveRaw(
        requestParameters: SourcesGroupConnectionsKerberosRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsKerberosRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosRetrieve(
        requestParameters: SourcesGroupConnectionsKerberosRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupKerberosSourceConnection> {
        const response = await this.sourcesGroupConnectionsKerberosRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/group_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosUpdateRaw(
        requestParameters: SourcesGroupConnectionsKerberosUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsKerberosUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsKerberosUpdate(
        requestParameters: SourcesGroupConnectionsKerberosUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupKerberosSourceConnection> {
        const response = await this.sourcesGroupConnectionsKerberosUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/kerberos/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/group_connections/ldap/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapCreateRaw(
        requestParameters: SourcesGroupConnectionsLdapCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsLdapCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapCreate(
        requestParameters: SourcesGroupConnectionsLdapCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupLDAPSourceConnection> {
        const response = await this.sourcesGroupConnectionsLdapCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapDestroyRaw(
        requestParameters: SourcesGroupConnectionsLdapDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesGroupConnectionsLdapDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapDestroy(
        requestParameters: SourcesGroupConnectionsLdapDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesGroupConnectionsLdapDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/group_connections/ldap/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapListRaw(
        requestParameters: SourcesGroupConnectionsLdapListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupLDAPSourceConnectionList>> {
        const requestOptions =
            await this.sourcesGroupConnectionsLdapListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapList(
        requestParameters: SourcesGroupConnectionsLdapListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupLDAPSourceConnectionList> {
        const response = await this.sourcesGroupConnectionsLdapListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapPartialUpdateRaw(
        requestParameters: SourcesGroupConnectionsLdapPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsLdapPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapPartialUpdate(
        requestParameters: SourcesGroupConnectionsLdapPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupLDAPSourceConnection> {
        const response = await this.sourcesGroupConnectionsLdapPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapRetrieveRaw(
        requestParameters: SourcesGroupConnectionsLdapRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsLdapRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapRetrieve(
        requestParameters: SourcesGroupConnectionsLdapRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupLDAPSourceConnection> {
        const response = await this.sourcesGroupConnectionsLdapRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/group_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapUpdateRaw(
        requestParameters: SourcesGroupConnectionsLdapUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsLdapUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsLdapUpdate(
        requestParameters: SourcesGroupConnectionsLdapUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupLDAPSourceConnection> {
        const response = await this.sourcesGroupConnectionsLdapUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/ldap/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/group_connections/oauth/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthCreateRaw(
        requestParameters: SourcesGroupConnectionsOauthCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsOauthCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthCreate(
        requestParameters: SourcesGroupConnectionsOauthCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupOAuthSourceConnection> {
        const response = await this.sourcesGroupConnectionsOauthCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthDestroyRaw(
        requestParameters: SourcesGroupConnectionsOauthDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesGroupConnectionsOauthDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthDestroy(
        requestParameters: SourcesGroupConnectionsOauthDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesGroupConnectionsOauthDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/group_connections/oauth/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthListRaw(
        requestParameters: SourcesGroupConnectionsOauthListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupOAuthSourceConnectionList>> {
        const requestOptions =
            await this.sourcesGroupConnectionsOauthListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthList(
        requestParameters: SourcesGroupConnectionsOauthListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupOAuthSourceConnectionList> {
        const response = await this.sourcesGroupConnectionsOauthListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthPartialUpdateRaw(
        requestParameters: SourcesGroupConnectionsOauthPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsOauthPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthPartialUpdate(
        requestParameters: SourcesGroupConnectionsOauthPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupOAuthSourceConnection> {
        const response = await this.sourcesGroupConnectionsOauthPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthRetrieveRaw(
        requestParameters: SourcesGroupConnectionsOauthRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsOauthRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthRetrieve(
        requestParameters: SourcesGroupConnectionsOauthRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupOAuthSourceConnection> {
        const response = await this.sourcesGroupConnectionsOauthRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/group_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthUpdateRaw(
        requestParameters: SourcesGroupConnectionsOauthUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsOauthUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsOauthUpdate(
        requestParameters: SourcesGroupConnectionsOauthUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupOAuthSourceConnection> {
        const response = await this.sourcesGroupConnectionsOauthUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/oauth/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/group_connections/plex/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexCreateRaw(
        requestParameters: SourcesGroupConnectionsPlexCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsPlexCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexCreate(
        requestParameters: SourcesGroupConnectionsPlexCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupPlexSourceConnection> {
        const response = await this.sourcesGroupConnectionsPlexCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexDestroyRaw(
        requestParameters: SourcesGroupConnectionsPlexDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesGroupConnectionsPlexDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexDestroy(
        requestParameters: SourcesGroupConnectionsPlexDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesGroupConnectionsPlexDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/group_connections/plex/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexListRaw(
        requestParameters: SourcesGroupConnectionsPlexListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupPlexSourceConnectionList>> {
        const requestOptions =
            await this.sourcesGroupConnectionsPlexListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexList(
        requestParameters: SourcesGroupConnectionsPlexListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupPlexSourceConnectionList> {
        const response = await this.sourcesGroupConnectionsPlexListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexPartialUpdateRaw(
        requestParameters: SourcesGroupConnectionsPlexPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsPlexPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexPartialUpdate(
        requestParameters: SourcesGroupConnectionsPlexPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupPlexSourceConnection> {
        const response = await this.sourcesGroupConnectionsPlexPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexRetrieveRaw(
        requestParameters: SourcesGroupConnectionsPlexRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsPlexRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexRetrieve(
        requestParameters: SourcesGroupConnectionsPlexRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupPlexSourceConnection> {
        const response = await this.sourcesGroupConnectionsPlexRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/group_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexUpdateRaw(
        requestParameters: SourcesGroupConnectionsPlexUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsPlexUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsPlexUpdate(
        requestParameters: SourcesGroupConnectionsPlexUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupPlexSourceConnection> {
        const response = await this.sourcesGroupConnectionsPlexUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/plex/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/group_connections/saml/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlCreateRaw(
        requestParameters: SourcesGroupConnectionsSamlCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsSamlCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlCreate(
        requestParameters: SourcesGroupConnectionsSamlCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupSAMLSourceConnection> {
        const response = await this.sourcesGroupConnectionsSamlCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlDestroyRaw(
        requestParameters: SourcesGroupConnectionsSamlDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesGroupConnectionsSamlDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlDestroy(
        requestParameters: SourcesGroupConnectionsSamlDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesGroupConnectionsSamlDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/group_connections/saml/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlListRaw(
        requestParameters: SourcesGroupConnectionsSamlListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupSAMLSourceConnectionList>> {
        const requestOptions =
            await this.sourcesGroupConnectionsSamlListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlList(
        requestParameters: SourcesGroupConnectionsSamlListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupSAMLSourceConnectionList> {
        const response = await this.sourcesGroupConnectionsSamlListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlPartialUpdateRaw(
        requestParameters: SourcesGroupConnectionsSamlPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsSamlPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlPartialUpdate(
        requestParameters: SourcesGroupConnectionsSamlPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupSAMLSourceConnection> {
        const response = await this.sourcesGroupConnectionsSamlPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlRetrieveRaw(
        requestParameters: SourcesGroupConnectionsSamlRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsSamlRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlRetrieve(
        requestParameters: SourcesGroupConnectionsSamlRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupSAMLSourceConnection> {
        const response = await this.sourcesGroupConnectionsSamlRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/group_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlUpdateRaw(
        requestParameters: SourcesGroupConnectionsSamlUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsSamlUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsSamlUpdate(
        requestParameters: SourcesGroupConnectionsSamlUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupSAMLSourceConnection> {
        const response = await this.sourcesGroupConnectionsSamlUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/saml/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/group_connections/telegram/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramCreateRaw(
        requestParameters: SourcesGroupConnectionsTelegramCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsTelegramCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramCreate(
        requestParameters: SourcesGroupConnectionsTelegramCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupTelegramSourceConnection> {
        const response = await this.sourcesGroupConnectionsTelegramCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramDestroyRaw(
        requestParameters: SourcesGroupConnectionsTelegramDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesGroupConnectionsTelegramDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramDestroy(
        requestParameters: SourcesGroupConnectionsTelegramDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesGroupConnectionsTelegramDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/group_connections/telegram/`;

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramListRaw(
        requestParameters: SourcesGroupConnectionsTelegramListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedGroupTelegramSourceConnectionList>> {
        const requestOptions =
            await this.sourcesGroupConnectionsTelegramListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramList(
        requestParameters: SourcesGroupConnectionsTelegramListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedGroupTelegramSourceConnectionList> {
        const response = await this.sourcesGroupConnectionsTelegramListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramPartialUpdateRaw(
        requestParameters: SourcesGroupConnectionsTelegramPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsTelegramPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramPartialUpdate(
        requestParameters: SourcesGroupConnectionsTelegramPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupTelegramSourceConnection> {
        const response = await this.sourcesGroupConnectionsTelegramPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramRetrieveRaw(
        requestParameters: SourcesGroupConnectionsTelegramRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsTelegramRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramRetrieve(
        requestParameters: SourcesGroupConnectionsTelegramRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupTelegramSourceConnection> {
        const response = await this.sourcesGroupConnectionsTelegramRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/group_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramUpdateRaw(
        requestParameters: SourcesGroupConnectionsTelegramUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<GroupTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesGroupConnectionsTelegramUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Group-source connection Viewset
     */
    async sourcesGroupConnectionsTelegramUpdate(
        requestParameters: SourcesGroupConnectionsTelegramUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<GroupTelegramSourceConnection> {
        const response = await this.sourcesGroupConnectionsTelegramUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/group_connections/telegram/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/kerberos/`;

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosCreateRaw(
        requestParameters: SourcesKerberosCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<KerberosSource>> {
        const requestOptions = await this.sourcesKerberosCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosCreate(
        requestParameters: SourcesKerberosCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<KerberosSource> {
        const response = await this.sourcesKerberosCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/kerberos/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

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

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosDestroy(
        requestParameters: SourcesKerberosDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesKerberosDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/sources/kerberos/`;

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosListRaw(
        requestParameters: SourcesKerberosListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedKerberosSourceList>> {
        const requestOptions = await this.sourcesKerberosListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosList(
        requestParameters: SourcesKerberosListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedKerberosSourceList> {
        const response = await this.sourcesKerberosListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/kerberos/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosPartialUpdateRaw(
        requestParameters: SourcesKerberosPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<KerberosSource>> {
        const requestOptions =
            await this.sourcesKerberosPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosPartialUpdate(
        requestParameters: SourcesKerberosPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<KerberosSource> {
        const response = await this.sourcesKerberosPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/kerberos/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosRetrieveRaw(
        requestParameters: SourcesKerberosRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<KerberosSource>> {
        const requestOptions = await this.sourcesKerberosRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosRetrieve(
        requestParameters: SourcesKerberosRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<KerberosSource> {
        const response = await this.sourcesKerberosRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/kerberos/{slug}/sync/status/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Get provider\'s sync status
     */
    async sourcesKerberosSyncStatusRetrieveRaw(
        requestParameters: SourcesKerberosSyncStatusRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SyncStatus>> {
        const requestOptions =
            await this.sourcesKerberosSyncStatusRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get provider\'s sync status
     */
    async sourcesKerberosSyncStatusRetrieve(
        requestParameters: SourcesKerberosSyncStatusRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SyncStatus> {
        const response = await this.sourcesKerberosSyncStatusRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/kerberos/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosUpdateRaw(
        requestParameters: SourcesKerberosUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<KerberosSource>> {
        const requestOptions = await this.sourcesKerberosUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Kerberos Source Viewset
     */
    async sourcesKerberosUpdate(
        requestParameters: SourcesKerberosUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<KerberosSource> {
        const response = await this.sourcesKerberosUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/ldap/`;

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapCreateRaw(
        requestParameters: SourcesLdapCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<LDAPSource>> {
        const requestOptions = await this.sourcesLdapCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapCreate(
        requestParameters: SourcesLdapCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<LDAPSource> {
        const response = await this.sourcesLdapCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/ldap/{slug}/debug/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Get raw LDAP data to debug
     */
    async sourcesLdapDebugRetrieveRaw(
        requestParameters: SourcesLdapDebugRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<LDAPDebug>> {
        const requestOptions = await this.sourcesLdapDebugRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get raw LDAP data to debug
     */
    async sourcesLdapDebugRetrieve(
        requestParameters: SourcesLdapDebugRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<LDAPDebug> {
        const response = await this.sourcesLdapDebugRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/ldap/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

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

        return new runtime.VoidApiResponse(response);
    }

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapDestroy(
        requestParameters: SourcesLdapDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesLdapDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/sources/ldap/`;

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapListRaw(
        requestParameters: SourcesLdapListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedLDAPSourceList>> {
        const requestOptions = await this.sourcesLdapListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapList(
        requestParameters: SourcesLdapListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedLDAPSourceList> {
        const response = await this.sourcesLdapListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/ldap/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapPartialUpdateRaw(
        requestParameters: SourcesLdapPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<LDAPSource>> {
        const requestOptions = await this.sourcesLdapPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapPartialUpdate(
        requestParameters: SourcesLdapPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<LDAPSource> {
        const response = await this.sourcesLdapPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/ldap/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapRetrieveRaw(
        requestParameters: SourcesLdapRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<LDAPSource>> {
        const requestOptions = await this.sourcesLdapRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapRetrieve(
        requestParameters: SourcesLdapRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<LDAPSource> {
        const response = await this.sourcesLdapRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/ldap/{slug}/sync/status/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Get provider\'s sync status
     */
    async sourcesLdapSyncStatusRetrieveRaw(
        requestParameters: SourcesLdapSyncStatusRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SyncStatus>> {
        const requestOptions =
            await this.sourcesLdapSyncStatusRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get provider\'s sync status
     */
    async sourcesLdapSyncStatusRetrieve(
        requestParameters: SourcesLdapSyncStatusRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SyncStatus> {
        const response = await this.sourcesLdapSyncStatusRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/ldap/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapUpdateRaw(
        requestParameters: SourcesLdapUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<LDAPSource>> {
        const requestOptions = await this.sourcesLdapUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * LDAP Source Viewset
     */
    async sourcesLdapUpdate(
        requestParameters: SourcesLdapUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<LDAPSource> {
        const response = await this.sourcesLdapUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/oauth/`;

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

    /**
     * Source Viewset
     */
    async sourcesOauthCreateRaw(
        requestParameters: SourcesOauthCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<OAuthSource>> {
        const requestOptions = await this.sourcesOauthCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async sourcesOauthCreate(
        requestParameters: SourcesOauthCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<OAuthSource> {
        const response = await this.sourcesOauthCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/oauth/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

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

        return new runtime.VoidApiResponse(response);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/sources/oauth/`;

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

    /**
     * Source Viewset
     */
    async sourcesOauthListRaw(
        requestParameters: SourcesOauthListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedOAuthSourceList>> {
        const requestOptions = await this.sourcesOauthListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async sourcesOauthList(
        requestParameters: SourcesOauthListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedOAuthSourceList> {
        const response = await this.sourcesOauthListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/oauth/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Source Viewset
     */
    async sourcesOauthPartialUpdateRaw(
        requestParameters: SourcesOauthPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<OAuthSource>> {
        const requestOptions = await this.sourcesOauthPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async sourcesOauthPartialUpdate(
        requestParameters: SourcesOauthPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<OAuthSource> {
        const response = await this.sourcesOauthPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/oauth/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Source Viewset
     */
    async sourcesOauthRetrieveRaw(
        requestParameters: SourcesOauthRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<OAuthSource>> {
        const requestOptions = await this.sourcesOauthRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async sourcesOauthRetrieve(
        requestParameters: SourcesOauthRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<OAuthSource> {
        const response = await this.sourcesOauthRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/sources/oauth/source_types/`;

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

    /**
     * Get all creatable source types. If ?name is set, only returns the type for <name>. If <name> isn\'t found, returns the default type.
     */
    async sourcesOauthSourceTypesListRaw(
        requestParameters: SourcesOauthSourceTypesListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<Array<SourceType>>> {
        const requestOptions = await this.sourcesOauthSourceTypesListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Get all creatable source types. If ?name is set, only returns the type for <name>. If <name> isn\'t found, returns the default type.
     */
    async sourcesOauthSourceTypesList(
        requestParameters: SourcesOauthSourceTypesListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<Array<SourceType>> {
        const response = await this.sourcesOauthSourceTypesListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/oauth/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Source Viewset
     */
    async sourcesOauthUpdateRaw(
        requestParameters: SourcesOauthUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<OAuthSource>> {
        const requestOptions = await this.sourcesOauthUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Source Viewset
     */
    async sourcesOauthUpdate(
        requestParameters: SourcesOauthUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<OAuthSource> {
        const response = await this.sourcesOauthUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/plex/`;

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexCreateRaw(
        requestParameters: SourcesPlexCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PlexSource>> {
        const requestOptions = await this.sourcesPlexCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexCreate(
        requestParameters: SourcesPlexCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PlexSource> {
        const response = await this.sourcesPlexCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/plex/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexDestroyRaw(
        requestParameters: SourcesPlexDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.sourcesPlexDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Plex source Viewset
     */
    async sourcesPlexDestroy(
        requestParameters: SourcesPlexDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesPlexDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/sources/plex/`;

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexListRaw(
        requestParameters: SourcesPlexListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedPlexSourceList>> {
        const requestOptions = await this.sourcesPlexListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexList(
        requestParameters: SourcesPlexListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedPlexSourceList> {
        const response = await this.sourcesPlexListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/plex/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexPartialUpdateRaw(
        requestParameters: SourcesPlexPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PlexSource>> {
        const requestOptions = await this.sourcesPlexPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexPartialUpdate(
        requestParameters: SourcesPlexPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PlexSource> {
        const response = await this.sourcesPlexPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        const queryParameters: any = {};

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

        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 = `/sources/plex/redeem_token_authenticated/`;

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

    /**
     * Redeem a plex token for an authenticated user, creating a connection
     */
    async sourcesPlexRedeemTokenAuthenticatedCreateRaw(
        requestParameters: SourcesPlexRedeemTokenAuthenticatedCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesPlexRedeemTokenAuthenticatedCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Redeem a plex token for an authenticated user, creating a connection
     */
    async sourcesPlexRedeemTokenAuthenticatedCreate(
        requestParameters: SourcesPlexRedeemTokenAuthenticatedCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesPlexRedeemTokenAuthenticatedCreateRaw(requestParameters, initOverrides);
    }

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

        const queryParameters: any = {};

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

        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 = `/sources/plex/redeem_token/`;

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

    /**
     * Redeem a plex token, check it\'s access to resources against what\'s allowed for the source, and redirect to an authentication/enrollment flow.
     */
    async sourcesPlexRedeemTokenCreateRaw(
        requestParameters: SourcesPlexRedeemTokenCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<RedirectChallenge>> {
        const requestOptions =
            await this.sourcesPlexRedeemTokenCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Redeem a plex token, check it\'s access to resources against what\'s allowed for the source, and redirect to an authentication/enrollment flow.
     */
    async sourcesPlexRedeemTokenCreate(
        requestParameters: SourcesPlexRedeemTokenCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<RedirectChallenge> {
        const response = await this.sourcesPlexRedeemTokenCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/plex/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexRetrieveRaw(
        requestParameters: SourcesPlexRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PlexSource>> {
        const requestOptions = await this.sourcesPlexRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexRetrieve(
        requestParameters: SourcesPlexRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PlexSource> {
        const response = await this.sourcesPlexRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/sources/plex/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexUpdateRaw(
        requestParameters: SourcesPlexUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PlexSource>> {
        const requestOptions = await this.sourcesPlexUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Plex source Viewset
     */
    async sourcesPlexUpdate(
        requestParameters: SourcesPlexUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PlexSource> {
        const response = await this.sourcesPlexUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/saml/`;

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlCreateRaw(
        requestParameters: SourcesSamlCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SAMLSource>> {
        const requestOptions = await this.sourcesSamlCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlCreate(
        requestParameters: SourcesSamlCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SAMLSource> {
        const response = await this.sourcesSamlCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/saml/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlDestroyRaw(
        requestParameters: SourcesSamlDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.sourcesSamlDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlDestroy(
        requestParameters: SourcesSamlDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesSamlDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/sources/saml/`;

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlListRaw(
        requestParameters: SourcesSamlListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedSAMLSourceList>> {
        const requestOptions = await this.sourcesSamlListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlList(
        requestParameters: SourcesSamlListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedSAMLSourceList> {
        const response = await this.sourcesSamlListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/saml/{slug}/metadata/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Return metadata as XML string
     */
    async sourcesSamlMetadataRetrieveRaw(
        requestParameters: SourcesSamlMetadataRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SAMLMetadata>> {
        const requestOptions = await this.sourcesSamlMetadataRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Return metadata as XML string
     */
    async sourcesSamlMetadataRetrieve(
        requestParameters: SourcesSamlMetadataRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SAMLMetadata> {
        const response = await this.sourcesSamlMetadataRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/saml/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlPartialUpdateRaw(
        requestParameters: SourcesSamlPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SAMLSource>> {
        const requestOptions = await this.sourcesSamlPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlPartialUpdate(
        requestParameters: SourcesSamlPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SAMLSource> {
        const response = await this.sourcesSamlPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/saml/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlRetrieveRaw(
        requestParameters: SourcesSamlRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SAMLSource>> {
        const requestOptions = await this.sourcesSamlRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlRetrieve(
        requestParameters: SourcesSamlRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SAMLSource> {
        const response = await this.sourcesSamlRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/sources/saml/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlUpdateRaw(
        requestParameters: SourcesSamlUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SAMLSource>> {
        const requestOptions = await this.sourcesSamlUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SAMLSource Viewset
     */
    async sourcesSamlUpdate(
        requestParameters: SourcesSamlUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SAMLSource> {
        const response = await this.sourcesSamlUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/scim/`;

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimCreateRaw(
        requestParameters: SourcesScimCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSource>> {
        const requestOptions = await this.sourcesScimCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimCreate(
        requestParameters: SourcesScimCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSource> {
        const response = await this.sourcesScimCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/scim/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimDestroyRaw(
        requestParameters: SourcesScimDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.sourcesScimDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * SCIMSource Viewset
     */
    async sourcesScimDestroy(
        requestParameters: SourcesScimDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesScimDestroyRaw(requestParameters, initOverrides);
    }

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

        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 = `/sources/scim_groups/`;

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsCreateRaw(
        requestParameters: SourcesScimGroupsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceGroup>> {
        const requestOptions = await this.sourcesScimGroupsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsCreate(
        requestParameters: SourcesScimGroupsCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceGroup> {
        const response = await this.sourcesScimGroupsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/scim_groups/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsDestroyRaw(
        requestParameters: SourcesScimGroupsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.sourcesScimGroupsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsDestroy(
        requestParameters: SourcesScimGroupsDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesScimGroupsDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

        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 = `/sources/scim_groups/`;

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsListRaw(
        requestParameters: SourcesScimGroupsListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedSCIMSourceGroupList>> {
        const requestOptions = await this.sourcesScimGroupsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsList(
        requestParameters: SourcesScimGroupsListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedSCIMSourceGroupList> {
        const response = await this.sourcesScimGroupsListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/scim_groups/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsPartialUpdateRaw(
        requestParameters: SourcesScimGroupsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceGroup>> {
        const requestOptions =
            await this.sourcesScimGroupsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsPartialUpdate(
        requestParameters: SourcesScimGroupsPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceGroup> {
        const response = await this.sourcesScimGroupsPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/scim_groups/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsRetrieveRaw(
        requestParameters: SourcesScimGroupsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceGroup>> {
        const requestOptions = await this.sourcesScimGroupsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsRetrieve(
        requestParameters: SourcesScimGroupsRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceGroup> {
        const response = await this.sourcesScimGroupsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/sources/scim_groups/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsUpdateRaw(
        requestParameters: SourcesScimGroupsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceGroup>> {
        const requestOptions = await this.sourcesScimGroupsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceGroup Viewset
     */
    async sourcesScimGroupsUpdate(
        requestParameters: SourcesScimGroupsUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceGroup> {
        const response = await this.sourcesScimGroupsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

    /**
     * Creates request options for sourcesScimList without sending the request
     */
    async sourcesScimListRequestOpts(
        requestParameters: SourcesScimListRequest,
    ): 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["pbmUuid"] != null) {
            queryParameters["pbm_uuid"] = requestParameters["pbmUuid"];
        }

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

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

        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 = `/sources/scim/`;

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimListRaw(
        requestParameters: SourcesScimListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedSCIMSourceList>> {
        const requestOptions = await this.sourcesScimListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimList(
        requestParameters: SourcesScimListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedSCIMSourceList> {
        const response = await this.sourcesScimListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/scim/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimPartialUpdateRaw(
        requestParameters: SourcesScimPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSource>> {
        const requestOptions = await this.sourcesScimPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimPartialUpdate(
        requestParameters: SourcesScimPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSource> {
        const response = await this.sourcesScimPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/scim/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimRetrieveRaw(
        requestParameters: SourcesScimRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSource>> {
        const requestOptions = await this.sourcesScimRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimRetrieve(
        requestParameters: SourcesScimRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSource> {
        const response = await this.sourcesScimRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/sources/scim/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimUpdateRaw(
        requestParameters: SourcesScimUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSource>> {
        const requestOptions = await this.sourcesScimUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSource Viewset
     */
    async sourcesScimUpdate(
        requestParameters: SourcesScimUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSource> {
        const response = await this.sourcesScimUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/scim_users/`;

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersCreateRaw(
        requestParameters: SourcesScimUsersCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceUser>> {
        const requestOptions = await this.sourcesScimUsersCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersCreate(
        requestParameters: SourcesScimUsersCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceUser> {
        const response = await this.sourcesScimUsersCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/scim_users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersDestroyRaw(
        requestParameters: SourcesScimUsersDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.sourcesScimUsersDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersDestroy(
        requestParameters: SourcesScimUsersDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesScimUsersDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

        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 = `/sources/scim_users/`;

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersListRaw(
        requestParameters: SourcesScimUsersListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedSCIMSourceUserList>> {
        const requestOptions = await this.sourcesScimUsersListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersList(
        requestParameters: SourcesScimUsersListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedSCIMSourceUserList> {
        const response = await this.sourcesScimUsersListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/scim_users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersPartialUpdateRaw(
        requestParameters: SourcesScimUsersPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceUser>> {
        const requestOptions =
            await this.sourcesScimUsersPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersPartialUpdate(
        requestParameters: SourcesScimUsersPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceUser> {
        const response = await this.sourcesScimUsersPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/scim_users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersRetrieveRaw(
        requestParameters: SourcesScimUsersRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceUser>> {
        const requestOptions = await this.sourcesScimUsersRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersRetrieve(
        requestParameters: SourcesScimUsersRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceUser> {
        const response = await this.sourcesScimUsersRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/sources/scim_users/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersUpdateRaw(
        requestParameters: SourcesScimUsersUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<SCIMSourceUser>> {
        const requestOptions = await this.sourcesScimUsersUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * SCIMSourceUser Viewset
     */
    async sourcesScimUsersUpdate(
        requestParameters: SourcesScimUsersUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<SCIMSourceUser> {
        const response = await this.sourcesScimUsersUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

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

        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 = `/sources/telegram/{slug}/connect_user/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramConnectUserCreateRaw(
        requestParameters: SourcesTelegramConnectUserCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesTelegramConnectUserCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramConnectUserCreate(
        requestParameters: SourcesTelegramConnectUserCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserTelegramSourceConnection> {
        const response = await this.sourcesTelegramConnectUserCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/telegram/`;

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramCreateRaw(
        requestParameters: SourcesTelegramCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<TelegramSource>> {
        const requestOptions = await this.sourcesTelegramCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramCreate(
        requestParameters: SourcesTelegramCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<TelegramSource> {
        const response = await this.sourcesTelegramCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/telegram/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramDestroyRaw(
        requestParameters: SourcesTelegramDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions = await this.sourcesTelegramDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramDestroy(
        requestParameters: SourcesTelegramDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesTelegramDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

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

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

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

        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 = `/sources/telegram/`;

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramListRaw(
        requestParameters: SourcesTelegramListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedTelegramSourceList>> {
        const requestOptions = await this.sourcesTelegramListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramList(
        requestParameters: SourcesTelegramListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedTelegramSourceList> {
        const response = await this.sourcesTelegramListRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

        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 = `/sources/telegram/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramPartialUpdateRaw(
        requestParameters: SourcesTelegramPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<TelegramSource>> {
        const requestOptions =
            await this.sourcesTelegramPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramPartialUpdate(
        requestParameters: SourcesTelegramPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<TelegramSource> {
        const response = await this.sourcesTelegramPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/telegram/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramRetrieveRaw(
        requestParameters: SourcesTelegramRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<TelegramSource>> {
        const requestOptions = await this.sourcesTelegramRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramRetrieve(
        requestParameters: SourcesTelegramRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<TelegramSource> {
        const response = await this.sourcesTelegramRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

        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 = `/sources/telegram/{slug}/`;
        urlPath = urlPath.replace(
            `{${"slug"}}`,
            encodeURIComponent(String(requestParameters["slug"])),
        );

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramUpdateRaw(
        requestParameters: SourcesTelegramUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<TelegramSource>> {
        const requestOptions = await this.sourcesTelegramUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * Mixin to add a used_by endpoint to return a list of all objects using this object
     */
    async sourcesTelegramUpdate(
        requestParameters: SourcesTelegramUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<TelegramSource> {
        const response = await this.sourcesTelegramUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }

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

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

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

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

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

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

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllDestroyRaw(
        requestParameters: SourcesUserConnectionsAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesUserConnectionsAllDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllDestroy(
        requestParameters: SourcesUserConnectionsAllDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesUserConnectionsAllDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

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

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllListRaw(
        requestParameters: SourcesUserConnectionsAllListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserSourceConnectionList>> {
        const requestOptions =
            await this.sourcesUserConnectionsAllListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllList(
        requestParameters: SourcesUserConnectionsAllListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserSourceConnectionList> {
        const response = await this.sourcesUserConnectionsAllListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllPartialUpdateRaw(
        requestParameters: SourcesUserConnectionsAllPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsAllPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllPartialUpdate(
        requestParameters: SourcesUserConnectionsAllPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserSourceConnection> {
        const response = await this.sourcesUserConnectionsAllPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllRetrieveRaw(
        requestParameters: SourcesUserConnectionsAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsAllRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllRetrieve(
        requestParameters: SourcesUserConnectionsAllRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserSourceConnection> {
        const response = await this.sourcesUserConnectionsAllRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllUpdateRaw(
        requestParameters: SourcesUserConnectionsAllUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsAllUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsAllUpdate(
        requestParameters: SourcesUserConnectionsAllUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserSourceConnection> {
        const response = await this.sourcesUserConnectionsAllUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

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

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

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

        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 = `/sources/user_connections/kerberos/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosCreateRaw(
        requestParameters: SourcesUserConnectionsKerberosCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsKerberosCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosCreate(
        requestParameters: SourcesUserConnectionsKerberosCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserKerberosSourceConnection> {
        const response = await this.sourcesUserConnectionsKerberosCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosDestroyRaw(
        requestParameters: SourcesUserConnectionsKerberosDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesUserConnectionsKerberosDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosDestroy(
        requestParameters: SourcesUserConnectionsKerberosDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesUserConnectionsKerberosDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/user_connections/kerberos/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosListRaw(
        requestParameters: SourcesUserConnectionsKerberosListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserKerberosSourceConnectionList>> {
        const requestOptions =
            await this.sourcesUserConnectionsKerberosListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosList(
        requestParameters: SourcesUserConnectionsKerberosListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserKerberosSourceConnectionList> {
        const response = await this.sourcesUserConnectionsKerberosListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosPartialUpdateRaw(
        requestParameters: SourcesUserConnectionsKerberosPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsKerberosPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosPartialUpdate(
        requestParameters: SourcesUserConnectionsKerberosPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserKerberosSourceConnection> {
        const response = await this.sourcesUserConnectionsKerberosPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosRetrieveRaw(
        requestParameters: SourcesUserConnectionsKerberosRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsKerberosRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosRetrieve(
        requestParameters: SourcesUserConnectionsKerberosRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserKerberosSourceConnection> {
        const response = await this.sourcesUserConnectionsKerberosRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/user_connections/kerberos/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosUpdateRaw(
        requestParameters: SourcesUserConnectionsKerberosUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserKerberosSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsKerberosUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsKerberosUpdate(
        requestParameters: SourcesUserConnectionsKerberosUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserKerberosSourceConnection> {
        const response = await this.sourcesUserConnectionsKerberosUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/kerberos/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/user_connections/ldap/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapCreateRaw(
        requestParameters: SourcesUserConnectionsLdapCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsLdapCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapCreate(
        requestParameters: SourcesUserConnectionsLdapCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLDAPSourceConnection> {
        const response = await this.sourcesUserConnectionsLdapCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapDestroyRaw(
        requestParameters: SourcesUserConnectionsLdapDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesUserConnectionsLdapDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapDestroy(
        requestParameters: SourcesUserConnectionsLdapDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesUserConnectionsLdapDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/user_connections/ldap/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapListRaw(
        requestParameters: SourcesUserConnectionsLdapListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserLDAPSourceConnectionList>> {
        const requestOptions =
            await this.sourcesUserConnectionsLdapListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapList(
        requestParameters: SourcesUserConnectionsLdapListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserLDAPSourceConnectionList> {
        const response = await this.sourcesUserConnectionsLdapListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapPartialUpdateRaw(
        requestParameters: SourcesUserConnectionsLdapPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsLdapPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapPartialUpdate(
        requestParameters: SourcesUserConnectionsLdapPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLDAPSourceConnection> {
        const response = await this.sourcesUserConnectionsLdapPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapRetrieveRaw(
        requestParameters: SourcesUserConnectionsLdapRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsLdapRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapRetrieve(
        requestParameters: SourcesUserConnectionsLdapRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLDAPSourceConnection> {
        const response = await this.sourcesUserConnectionsLdapRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/user_connections/ldap/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapUpdateRaw(
        requestParameters: SourcesUserConnectionsLdapUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserLDAPSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsLdapUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsLdapUpdate(
        requestParameters: SourcesUserConnectionsLdapUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserLDAPSourceConnection> {
        const response = await this.sourcesUserConnectionsLdapUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/ldap/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/user_connections/oauth/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthCreateRaw(
        requestParameters: SourcesUserConnectionsOauthCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsOauthCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthCreate(
        requestParameters: SourcesUserConnectionsOauthCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserOAuthSourceConnection> {
        const response = await this.sourcesUserConnectionsOauthCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthDestroyRaw(
        requestParameters: SourcesUserConnectionsOauthDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesUserConnectionsOauthDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthDestroy(
        requestParameters: SourcesUserConnectionsOauthDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesUserConnectionsOauthDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/user_connections/oauth/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthListRaw(
        requestParameters: SourcesUserConnectionsOauthListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserOAuthSourceConnectionList>> {
        const requestOptions =
            await this.sourcesUserConnectionsOauthListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthList(
        requestParameters: SourcesUserConnectionsOauthListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserOAuthSourceConnectionList> {
        const response = await this.sourcesUserConnectionsOauthListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthPartialUpdateRaw(
        requestParameters: SourcesUserConnectionsOauthPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsOauthPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthPartialUpdate(
        requestParameters: SourcesUserConnectionsOauthPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserOAuthSourceConnection> {
        const response = await this.sourcesUserConnectionsOauthPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthRetrieveRaw(
        requestParameters: SourcesUserConnectionsOauthRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsOauthRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthRetrieve(
        requestParameters: SourcesUserConnectionsOauthRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserOAuthSourceConnection> {
        const response = await this.sourcesUserConnectionsOauthRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/user_connections/oauth/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthUpdateRaw(
        requestParameters: SourcesUserConnectionsOauthUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserOAuthSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsOauthUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsOauthUpdate(
        requestParameters: SourcesUserConnectionsOauthUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserOAuthSourceConnection> {
        const response = await this.sourcesUserConnectionsOauthUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/oauth/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/user_connections/plex/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexCreateRaw(
        requestParameters: SourcesUserConnectionsPlexCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsPlexCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexCreate(
        requestParameters: SourcesUserConnectionsPlexCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserPlexSourceConnection> {
        const response = await this.sourcesUserConnectionsPlexCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexDestroyRaw(
        requestParameters: SourcesUserConnectionsPlexDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesUserConnectionsPlexDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexDestroy(
        requestParameters: SourcesUserConnectionsPlexDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesUserConnectionsPlexDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/user_connections/plex/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexListRaw(
        requestParameters: SourcesUserConnectionsPlexListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserPlexSourceConnectionList>> {
        const requestOptions =
            await this.sourcesUserConnectionsPlexListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexList(
        requestParameters: SourcesUserConnectionsPlexListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserPlexSourceConnectionList> {
        const response = await this.sourcesUserConnectionsPlexListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexPartialUpdateRaw(
        requestParameters: SourcesUserConnectionsPlexPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsPlexPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexPartialUpdate(
        requestParameters: SourcesUserConnectionsPlexPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserPlexSourceConnection> {
        const response = await this.sourcesUserConnectionsPlexPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexRetrieveRaw(
        requestParameters: SourcesUserConnectionsPlexRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsPlexRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexRetrieve(
        requestParameters: SourcesUserConnectionsPlexRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserPlexSourceConnection> {
        const response = await this.sourcesUserConnectionsPlexRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/user_connections/plex/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexUpdateRaw(
        requestParameters: SourcesUserConnectionsPlexUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserPlexSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsPlexUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsPlexUpdate(
        requestParameters: SourcesUserConnectionsPlexUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserPlexSourceConnection> {
        const response = await this.sourcesUserConnectionsPlexUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/plex/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/user_connections/saml/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlCreateRaw(
        requestParameters: SourcesUserConnectionsSamlCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsSamlCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlCreate(
        requestParameters: SourcesUserConnectionsSamlCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserSAMLSourceConnection> {
        const response = await this.sourcesUserConnectionsSamlCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlDestroyRaw(
        requestParameters: SourcesUserConnectionsSamlDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesUserConnectionsSamlDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlDestroy(
        requestParameters: SourcesUserConnectionsSamlDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesUserConnectionsSamlDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/user_connections/saml/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlListRaw(
        requestParameters: SourcesUserConnectionsSamlListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserSAMLSourceConnectionList>> {
        const requestOptions =
            await this.sourcesUserConnectionsSamlListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlList(
        requestParameters: SourcesUserConnectionsSamlListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserSAMLSourceConnectionList> {
        const response = await this.sourcesUserConnectionsSamlListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlPartialUpdateRaw(
        requestParameters: SourcesUserConnectionsSamlPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsSamlPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlPartialUpdate(
        requestParameters: SourcesUserConnectionsSamlPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserSAMLSourceConnection> {
        const response = await this.sourcesUserConnectionsSamlPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlRetrieveRaw(
        requestParameters: SourcesUserConnectionsSamlRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsSamlRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlRetrieve(
        requestParameters: SourcesUserConnectionsSamlRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserSAMLSourceConnection> {
        const response = await this.sourcesUserConnectionsSamlRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/user_connections/saml/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlUpdateRaw(
        requestParameters: SourcesUserConnectionsSamlUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserSAMLSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsSamlUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsSamlUpdate(
        requestParameters: SourcesUserConnectionsSamlUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserSAMLSourceConnection> {
        const response = await this.sourcesUserConnectionsSamlUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/saml/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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

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

        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 = `/sources/user_connections/telegram/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramCreateRaw(
        requestParameters: SourcesUserConnectionsTelegramCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsTelegramCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramCreate(
        requestParameters: SourcesUserConnectionsTelegramCreateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserTelegramSourceConnection> {
        const response = await this.sourcesUserConnectionsTelegramCreateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramDestroyRaw(
        requestParameters: SourcesUserConnectionsTelegramDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<void>> {
        const requestOptions =
            await this.sourcesUserConnectionsTelegramDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramDestroy(
        requestParameters: SourcesUserConnectionsTelegramDestroyRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<void> {
        await this.sourcesUserConnectionsTelegramDestroyRaw(requestParameters, initOverrides);
    }

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

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

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

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

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

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

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

        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 = `/sources/user_connections/telegram/`;

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramListRaw(
        requestParameters: SourcesUserConnectionsTelegramListRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<PaginatedUserTelegramSourceConnectionList>> {
        const requestOptions =
            await this.sourcesUserConnectionsTelegramListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramList(
        requestParameters: SourcesUserConnectionsTelegramListRequest = {},
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<PaginatedUserTelegramSourceConnectionList> {
        const response = await this.sourcesUserConnectionsTelegramListRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramPartialUpdateRaw(
        requestParameters: SourcesUserConnectionsTelegramPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsTelegramPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramPartialUpdate(
        requestParameters: SourcesUserConnectionsTelegramPartialUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserTelegramSourceConnection> {
        const response = await this.sourcesUserConnectionsTelegramPartialUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramRetrieveRaw(
        requestParameters: SourcesUserConnectionsTelegramRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsTelegramRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramRetrieve(
        requestParameters: SourcesUserConnectionsTelegramRetrieveRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserTelegramSourceConnection> {
        const response = await this.sourcesUserConnectionsTelegramRetrieveRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

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

        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 = `/sources/user_connections/telegram/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramUpdateRaw(
        requestParameters: SourcesUserConnectionsTelegramUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<runtime.ApiResponse<UserTelegramSourceConnection>> {
        const requestOptions =
            await this.sourcesUserConnectionsTelegramUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);

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

    /**
     * User-source connection Viewset
     */
    async sourcesUserConnectionsTelegramUpdate(
        requestParameters: SourcesUserConnectionsTelegramUpdateRequest,
        initOverrides?: RequestInit | runtime.InitOverrideFunction,
    ): Promise<UserTelegramSourceConnection> {
        const response = await this.sourcesUserConnectionsTelegramUpdateRaw(
            requestParameters,
            initOverrides,
        );
        return await response.value();
    }

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

        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 = `/sources/user_connections/telegram/{id}/used_by/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));

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

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