/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.12.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 { mapValues } from '../runtime';
import type { Config } from './Config';
import {
    ConfigFromJSON,
    ConfigFromJSONTyped,
    ConfigToJSON,
    ConfigToJSONTyped,
} from './Config';

/**
 * Base serializer class which doesn't implement create/update methods
 * @export
 * @interface AgentConfig
 */
export interface AgentConfig {
    /**
     * 
     * @type {string}
     * @memberof AgentConfig
     */
    readonly deviceId: string;
    /**
     * 
     * @type {number}
     * @memberof AgentConfig
     */
    readonly refreshInterval: number;
    /**
     * 
     * @type {string}
     * @memberof AgentConfig
     */
    readonly authorizationFlow: string | null;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof AgentConfig
     */
    readonly jwks: { [key: string]: any; };
    /**
     * 
     * @type {number}
     * @memberof AgentConfig
     */
    nssUidOffset: number;
    /**
     * 
     * @type {number}
     * @memberof AgentConfig
     */
    nssGidOffset: number;
    /**
     * 
     * @type {boolean}
     * @memberof AgentConfig
     */
    authTerminateSessionOnExpiry: boolean;
    /**
     * 
     * @type {Config}
     * @memberof AgentConfig
     */
    readonly systemConfig: Config;
}

/**
 * Check if a given object implements the AgentConfig interface.
 */
export function instanceOfAgentConfig(value: object): value is AgentConfig {
    if (!('deviceId' in value) || value['deviceId'] === undefined) return false;
    if (!('refreshInterval' in value) || value['refreshInterval'] === undefined) return false;
    if (!('authorizationFlow' in value) || value['authorizationFlow'] === undefined) return false;
    if (!('jwks' in value) || value['jwks'] === undefined) return false;
    if (!('nssUidOffset' in value) || value['nssUidOffset'] === undefined) return false;
    if (!('nssGidOffset' in value) || value['nssGidOffset'] === undefined) return false;
    if (!('authTerminateSessionOnExpiry' in value) || value['authTerminateSessionOnExpiry'] === undefined) return false;
    if (!('systemConfig' in value) || value['systemConfig'] === undefined) return false;
    return true;
}

export function AgentConfigFromJSON(json: any): AgentConfig {
    return AgentConfigFromJSONTyped(json, false);
}

export function AgentConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentConfig {
    if (json == null) {
        return json;
    }
    return {
        
        'deviceId': json['device_id'],
        'refreshInterval': json['refresh_interval'],
        'authorizationFlow': json['authorization_flow'],
        'jwks': json['jwks'],
        'nssUidOffset': json['nss_uid_offset'],
        'nssGidOffset': json['nss_gid_offset'],
        'authTerminateSessionOnExpiry': json['auth_terminate_session_on_expiry'],
        'systemConfig': ConfigFromJSON(json['system_config']),
    };
}

export function AgentConfigToJSON(json: any): AgentConfig {
    return AgentConfigToJSONTyped(json, false);
}

export function AgentConfigToJSONTyped(value?: Omit<AgentConfig, 'device_id'|'refresh_interval'|'authorization_flow'|'jwks'|'system_config'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'nss_uid_offset': value['nssUidOffset'],
        'nss_gid_offset': value['nssGidOffset'],
        'auth_terminate_session_on_expiry': value['authTerminateSessionOnExpiry'],
    };
}

