/* 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 { GroupMatchingModeEnum } from "./GroupMatchingModeEnum";
import {
    GroupMatchingModeEnumFromJSON,
    GroupMatchingModeEnumToJSON,
} from "./GroupMatchingModeEnum";
import type { KadminTypeEnum } from "./KadminTypeEnum";
import { KadminTypeEnumFromJSON, KadminTypeEnumToJSON } from "./KadminTypeEnum";
import type { PolicyEngineMode } from "./PolicyEngineMode";
import { PolicyEngineModeFromJSON, PolicyEngineModeToJSON } from "./PolicyEngineMode";
import type { SyncOutgoingTriggerModeEnum } from "./SyncOutgoingTriggerModeEnum";
import {
    SyncOutgoingTriggerModeEnumFromJSON,
    SyncOutgoingTriggerModeEnumToJSON,
} from "./SyncOutgoingTriggerModeEnum";
import type { UserMatchingModeEnum } from "./UserMatchingModeEnum";
import { UserMatchingModeEnumFromJSON, UserMatchingModeEnumToJSON } from "./UserMatchingModeEnum";

/**
 * Kerberos Source Serializer
 * @export
 * @interface PatchedKerberosSourceRequest
 */
export interface PatchedKerberosSourceRequest {
    /**
     * Source's display Name.
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    name?: string;
    /**
     * Internal source name, used in URLs.
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    slug?: string;
    /**
     *
     * @type {boolean}
     * @memberof PatchedKerberosSourceRequest
     */
    enabled?: boolean;
    /**
     * When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon.
     * @type {boolean}
     * @memberof PatchedKerberosSourceRequest
     */
    promoted?: boolean;
    /**
     * Flow to use when authenticating existing users.
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    authenticationFlow?: string | null;
    /**
     * Flow to use when enrolling new users.
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    enrollmentFlow?: string | null;
    /**
     *
     * @type {Array<string>}
     * @memberof PatchedKerberosSourceRequest
     */
    userPropertyMappings?: Array<string>;
    /**
     *
     * @type {Array<string>}
     * @memberof PatchedKerberosSourceRequest
     */
    groupPropertyMappings?: Array<string>;
    /**
     *
     * @type {PolicyEngineMode}
     * @memberof PatchedKerberosSourceRequest
     */
    policyEngineMode?: PolicyEngineMode;
    /**
     * How the source determines if an existing user should be authenticated or a new user enrolled.
     * @type {UserMatchingModeEnum}
     * @memberof PatchedKerberosSourceRequest
     */
    userMatchingMode?: UserMatchingModeEnum;
    /**
     *
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    userPathTemplate?: string;
    /**
     *
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    icon?: string;
    /**
     * How the source determines if an existing group should be used or a new group created.
     * @type {GroupMatchingModeEnum}
     * @memberof PatchedKerberosSourceRequest
     */
    groupMatchingMode?: GroupMatchingModeEnum;
    /**
     * Kerberos realm
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    realm?: string;
    /**
     * Custom krb5.conf to use. Uses the system one by default
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    krb5Conf?: string;
    /**
     * KAdmin server type
     * @type {KadminTypeEnum}
     * @memberof PatchedKerberosSourceRequest
     */
    kadminType?: KadminTypeEnum;
    /**
     * Sync users from Kerberos into authentik
     * @type {boolean}
     * @memberof PatchedKerberosSourceRequest
     */
    syncUsers?: boolean;
    /**
     * When a user changes their password, sync it back to Kerberos
     * @type {boolean}
     * @memberof PatchedKerberosSourceRequest
     */
    syncUsersPassword?: boolean;
    /**
     * Principal to authenticate to kadmin for sync.
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    syncPrincipal?: string;
    /**
     * Password to authenticate to kadmin for sync
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    syncPassword?: string;
    /**
     * Keytab to authenticate to kadmin for sync. Must be base64-encoded or in the form TYPE:residual
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    syncKeytab?: string;
    /**
     * Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    syncCcache?: string;
    /**
     * Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    spnegoServerName?: string;
    /**
     * SPNEGO keytab base64-encoded or path to keytab in the form FILE:path
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    spnegoKeytab?: string;
    /**
     * Credential cache to use for SPNEGO in form type:residual
     * @type {string}
     * @memberof PatchedKerberosSourceRequest
     */
    spnegoCcache?: string;
    /**
     * If enabled, the authentik-stored password will be updated upon login with the Kerberos password backend
     * @type {boolean}
     * @memberof PatchedKerberosSourceRequest
     */
    passwordLoginUpdateInternalPassword?: boolean;
    /**
     * When to trigger sync for outgoing providers
     * @type {SyncOutgoingTriggerModeEnum}
     * @memberof PatchedKerberosSourceRequest
     */
    syncOutgoingTriggerMode?: SyncOutgoingTriggerModeEnum;
}

/**
 * Check if a given object implements the PatchedKerberosSourceRequest interface.
 */
export function instanceOfPatchedKerberosSourceRequest(
    value: object,
): value is PatchedKerberosSourceRequest {
    return true;
}

export function PatchedKerberosSourceRequestFromJSON(json: any): PatchedKerberosSourceRequest {
    return PatchedKerberosSourceRequestFromJSONTyped(json, false);
}

export function PatchedKerberosSourceRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedKerberosSourceRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : json["name"],
        slug: json["slug"] == null ? undefined : json["slug"],
        enabled: json["enabled"] == null ? undefined : json["enabled"],
        promoted: json["promoted"] == null ? undefined : json["promoted"],
        authenticationFlow:
            json["authentication_flow"] == null ? undefined : json["authentication_flow"],
        enrollmentFlow: json["enrollment_flow"] == null ? undefined : json["enrollment_flow"],
        userPropertyMappings:
            json["user_property_mappings"] == null ? undefined : json["user_property_mappings"],
        groupPropertyMappings:
            json["group_property_mappings"] == null ? undefined : json["group_property_mappings"],
        policyEngineMode:
            json["policy_engine_mode"] == null
                ? undefined
                : PolicyEngineModeFromJSON(json["policy_engine_mode"]),
        userMatchingMode:
            json["user_matching_mode"] == null
                ? undefined
                : UserMatchingModeEnumFromJSON(json["user_matching_mode"]),
        userPathTemplate:
            json["user_path_template"] == null ? undefined : json["user_path_template"],
        icon: json["icon"] == null ? undefined : json["icon"],
        groupMatchingMode:
            json["group_matching_mode"] == null
                ? undefined
                : GroupMatchingModeEnumFromJSON(json["group_matching_mode"]),
        realm: json["realm"] == null ? undefined : json["realm"],
        krb5Conf: json["krb5_conf"] == null ? undefined : json["krb5_conf"],
        kadminType:
            json["kadmin_type"] == null ? undefined : KadminTypeEnumFromJSON(json["kadmin_type"]),
        syncUsers: json["sync_users"] == null ? undefined : json["sync_users"],
        syncUsersPassword:
            json["sync_users_password"] == null ? undefined : json["sync_users_password"],
        syncPrincipal: json["sync_principal"] == null ? undefined : json["sync_principal"],
        syncPassword: json["sync_password"] == null ? undefined : json["sync_password"],
        syncKeytab: json["sync_keytab"] == null ? undefined : json["sync_keytab"],
        syncCcache: json["sync_ccache"] == null ? undefined : json["sync_ccache"],
        spnegoServerName:
            json["spnego_server_name"] == null ? undefined : json["spnego_server_name"],
        spnegoKeytab: json["spnego_keytab"] == null ? undefined : json["spnego_keytab"],
        spnegoCcache: json["spnego_ccache"] == null ? undefined : json["spnego_ccache"],
        passwordLoginUpdateInternalPassword:
            json["password_login_update_internal_password"] == null
                ? undefined
                : json["password_login_update_internal_password"],
        syncOutgoingTriggerMode:
            json["sync_outgoing_trigger_mode"] == null
                ? undefined
                : SyncOutgoingTriggerModeEnumFromJSON(json["sync_outgoing_trigger_mode"]),
    };
}

export function PatchedKerberosSourceRequestToJSON(json: any): PatchedKerberosSourceRequest {
    return PatchedKerberosSourceRequestToJSONTyped(json, false);
}

export function PatchedKerberosSourceRequestToJSONTyped(
    value?: PatchedKerberosSourceRequest | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        name: value["name"],
        slug: value["slug"],
        enabled: value["enabled"],
        promoted: value["promoted"],
        authentication_flow: value["authenticationFlow"],
        enrollment_flow: value["enrollmentFlow"],
        user_property_mappings: value["userPropertyMappings"],
        group_property_mappings: value["groupPropertyMappings"],
        policy_engine_mode: PolicyEngineModeToJSON(value["policyEngineMode"]),
        user_matching_mode: UserMatchingModeEnumToJSON(value["userMatchingMode"]),
        user_path_template: value["userPathTemplate"],
        icon: value["icon"],
        group_matching_mode: GroupMatchingModeEnumToJSON(value["groupMatchingMode"]),
        realm: value["realm"],
        krb5_conf: value["krb5Conf"],
        kadmin_type: KadminTypeEnumToJSON(value["kadminType"]),
        sync_users: value["syncUsers"],
        sync_users_password: value["syncUsersPassword"],
        sync_principal: value["syncPrincipal"],
        sync_password: value["syncPassword"],
        sync_keytab: value["syncKeytab"],
        sync_ccache: value["syncCcache"],
        spnego_server_name: value["spnegoServerName"],
        spnego_keytab: value["spnegoKeytab"],
        spnego_ccache: value["spnegoCcache"],
        password_login_update_internal_password: value["passwordLoginUpdateInternalPassword"],
        sync_outgoing_trigger_mode: SyncOutgoingTriggerModeEnumToJSON(
            value["syncOutgoingTriggerMode"],
        ),
    };
}
