/* 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 { PatchedSettingsRequestFlags } from './PatchedSettingsRequestFlags';
import {
    PatchedSettingsRequestFlagsFromJSON,
    PatchedSettingsRequestFlagsFromJSONTyped,
    PatchedSettingsRequestFlagsToJSON,
    PatchedSettingsRequestFlagsToJSONTyped,
} from './PatchedSettingsRequestFlags';

/**
 * Settings Serializer
 * @export
 * @interface Settings
 */
export interface Settings {
    /**
     * Configure how authentik should show avatars for users.
     * @type {string}
     * @memberof Settings
     */
    avatars?: string;
    /**
     * Enable the ability for users to change their name.
     * @type {boolean}
     * @memberof Settings
     */
    defaultUserChangeName?: boolean;
    /**
     * Enable the ability for users to change their email address.
     * @type {boolean}
     * @memberof Settings
     */
    defaultUserChangeEmail?: boolean;
    /**
     * Enable the ability for users to change their username.
     * @type {boolean}
     * @memberof Settings
     */
    defaultUserChangeUsername?: boolean;
    /**
     * Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2).
     * @type {string}
     * @memberof Settings
     */
    eventRetention?: string;
    /**
     * Reputation cannot decrease lower than this value. Zero or negative.
     * @type {number}
     * @memberof Settings
     */
    reputationLowerLimit?: number;
    /**
     * Reputation cannot increase higher than this value. Zero or positive.
     * @type {number}
     * @memberof Settings
     */
    reputationUpperLimit?: number;
    /**
     * 
     * @type {any}
     * @memberof Settings
     */
    footerLinks?: any | null;
    /**
     * When enabled, all the events caused by a user will be deleted upon the user's deletion.
     * @type {boolean}
     * @memberof Settings
     */
    gdprCompliance?: boolean;
    /**
     * Globally enable/disable impersonation.
     * @type {boolean}
     * @memberof Settings
     */
    impersonation?: boolean;
    /**
     * Require administrators to provide a reason for impersonating a user.
     * @type {boolean}
     * @memberof Settings
     */
    impersonationRequireReason?: boolean;
    /**
     * Default token duration
     * @type {string}
     * @memberof Settings
     */
    defaultTokenDuration?: string;
    /**
     * Default token length
     * @type {number}
     * @memberof Settings
     */
    defaultTokenLength?: number;
    /**
     * 
     * @type {PatchedSettingsRequestFlags}
     * @memberof Settings
     */
    flags: PatchedSettingsRequestFlags;
}

/**
 * Check if a given object implements the Settings interface.
 */
export function instanceOfSettings(value: object): value is Settings {
    if (!('flags' in value) || value['flags'] === undefined) return false;
    return true;
}

export function SettingsFromJSON(json: any): Settings {
    return SettingsFromJSONTyped(json, false);
}

export function SettingsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Settings {
    if (json == null) {
        return json;
    }
    return {
        
        'avatars': json['avatars'] == null ? undefined : json['avatars'],
        'defaultUserChangeName': json['default_user_change_name'] == null ? undefined : json['default_user_change_name'],
        'defaultUserChangeEmail': json['default_user_change_email'] == null ? undefined : json['default_user_change_email'],
        'defaultUserChangeUsername': json['default_user_change_username'] == null ? undefined : json['default_user_change_username'],
        'eventRetention': json['event_retention'] == null ? undefined : json['event_retention'],
        'reputationLowerLimit': json['reputation_lower_limit'] == null ? undefined : json['reputation_lower_limit'],
        'reputationUpperLimit': json['reputation_upper_limit'] == null ? undefined : json['reputation_upper_limit'],
        'footerLinks': json['footer_links'] == null ? undefined : json['footer_links'],
        'gdprCompliance': json['gdpr_compliance'] == null ? undefined : json['gdpr_compliance'],
        'impersonation': json['impersonation'] == null ? undefined : json['impersonation'],
        'impersonationRequireReason': json['impersonation_require_reason'] == null ? undefined : json['impersonation_require_reason'],
        'defaultTokenDuration': json['default_token_duration'] == null ? undefined : json['default_token_duration'],
        'defaultTokenLength': json['default_token_length'] == null ? undefined : json['default_token_length'],
        'flags': PatchedSettingsRequestFlagsFromJSON(json['flags']),
    };
}

export function SettingsToJSON(json: any): Settings {
    return SettingsToJSONTyped(json, false);
}

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

    return {
        
        'avatars': value['avatars'],
        'default_user_change_name': value['defaultUserChangeName'],
        'default_user_change_email': value['defaultUserChangeEmail'],
        'default_user_change_username': value['defaultUserChangeUsername'],
        'event_retention': value['eventRetention'],
        'reputation_lower_limit': value['reputationLowerLimit'],
        'reputation_upper_limit': value['reputationUpperLimit'],
        'footer_links': value['footerLinks'],
        'gdpr_compliance': value['gdprCompliance'],
        'impersonation': value['impersonation'],
        'impersonation_require_reason': value['impersonationRequireReason'],
        'default_token_duration': value['defaultTokenDuration'],
        'default_token_length': value['defaultTokenLength'],
        'flags': PatchedSettingsRequestFlagsToJSON(value['flags']),
    };
}

