/* 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.
 */

/**
 * Password Expiry Policy Serializer
 * @export
 * @interface PasswordExpiryPolicyRequest
 */
export interface PasswordExpiryPolicyRequest {
    /**
     *
     * @type {string}
     * @memberof PasswordExpiryPolicyRequest
     */
    name: string;
    /**
     * When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged.
     * @type {boolean}
     * @memberof PasswordExpiryPolicyRequest
     */
    executionLogging?: boolean;
    /**
     *
     * @type {number}
     * @memberof PasswordExpiryPolicyRequest
     */
    days: number;
    /**
     *
     * @type {boolean}
     * @memberof PasswordExpiryPolicyRequest
     */
    denyOnly?: boolean;
}

/**
 * Check if a given object implements the PasswordExpiryPolicyRequest interface.
 */
export function instanceOfPasswordExpiryPolicyRequest(
    value: object,
): value is PasswordExpiryPolicyRequest {
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("days" in value) || value["days"] === undefined) return false;
    return true;
}

export function PasswordExpiryPolicyRequestFromJSON(json: any): PasswordExpiryPolicyRequest {
    return PasswordExpiryPolicyRequestFromJSONTyped(json, false);
}

export function PasswordExpiryPolicyRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PasswordExpiryPolicyRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"],
        executionLogging: json["execution_logging"] == null ? undefined : json["execution_logging"],
        days: json["days"],
        denyOnly: json["deny_only"] == null ? undefined : json["deny_only"],
    };
}

export function PasswordExpiryPolicyRequestToJSON(json: any): PasswordExpiryPolicyRequest {
    return PasswordExpiryPolicyRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        execution_logging: value["executionLogging"],
        days: value["days"],
        deny_only: value["denyOnly"],
    };
}
