/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { mapValues } from '../runtime';
import type { KadminTypeEnum } from './KadminTypeEnum';
import {
    KadminTypeEnumFromJSON,
    KadminTypeEnumFromJSONTyped,
    KadminTypeEnumToJSON,
    KadminTypeEnumToJSONTyped,
} from './KadminTypeEnum';
import type { PolicyEngineMode } from './PolicyEngineMode';
import {
    PolicyEngineModeFromJSON,
    PolicyEngineModeFromJSONTyped,
    PolicyEngineModeToJSON,
    PolicyEngineModeToJSONTyped,
} from './PolicyEngineMode';
import type { UserMatchingModeEnum } from './UserMatchingModeEnum';
import {
    UserMatchingModeEnumFromJSON,
    UserMatchingModeEnumFromJSONTyped,
    UserMatchingModeEnumToJSON,
    UserMatchingModeEnumToJSONTyped,
} from './UserMatchingModeEnum';
import type { GroupMatchingModeEnum } from './GroupMatchingModeEnum';
import {
    GroupMatchingModeEnumFromJSON,
    GroupMatchingModeEnumFromJSONTyped,
    GroupMatchingModeEnumToJSON,
    GroupMatchingModeEnumToJSONTyped,
} from './GroupMatchingModeEnum';

/**
 * 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;
    /**
     * 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;
    /**
     * 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;
}



/**
 * 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'],
        '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'],
        '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'],
    };
}

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'],
        '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'],
        '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'],
    };
}

