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

/**
 * EmailStage Serializer
 * @export
 * @interface PatchedEmailStageRequest
 */
export interface PatchedEmailStageRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    name?: string;
    /**
     * When enabled, global Email connection settings will be used and connection settings below will be ignored.
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    useGlobalSettings?: boolean;
    /**
     *
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    host?: string;
    /**
     *
     * @type {number}
     * @memberof PatchedEmailStageRequest
     */
    port?: number;
    /**
     *
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    username?: string;
    /**
     *
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    password?: string;
    /**
     *
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    useTls?: boolean;
    /**
     *
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    useSsl?: boolean;
    /**
     *
     * @type {number}
     * @memberof PatchedEmailStageRequest
     */
    timeout?: number;
    /**
     *
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    fromAddress?: string;
    /**
     * Time the token sent is valid (Format: hours=3,minutes=17,seconds=300).
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    tokenExpiry?: string;
    /**
     *
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    subject?: string;
    /**
     *
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    template?: string;
    /**
     * Activate users upon completion of stage.
     * @type {boolean}
     * @memberof PatchedEmailStageRequest
     */
    activateUserOnSuccess?: boolean;
    /**
     *
     * @type {number}
     * @memberof PatchedEmailStageRequest
     */
    recoveryMaxAttempts?: number;
    /**
     * The time window used to count recent account recovery attempts. If the number of attempts exceed recovery_max_attempts within this period, further attempts will be rate-limited. (Format: hours=1;minutes=2;seconds=3).
     * @type {string}
     * @memberof PatchedEmailStageRequest
     */
    recoveryCacheTimeout?: string;
}

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

export function PatchedEmailStageRequestFromJSON(json: any): PatchedEmailStageRequest {
    return PatchedEmailStageRequestFromJSONTyped(json, false);
}

export function PatchedEmailStageRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedEmailStageRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : json["name"],
        useGlobalSettings:
            json["use_global_settings"] == null ? undefined : json["use_global_settings"],
        host: json["host"] == null ? undefined : json["host"],
        port: json["port"] == null ? undefined : json["port"],
        username: json["username"] == null ? undefined : json["username"],
        password: json["password"] == null ? undefined : json["password"],
        useTls: json["use_tls"] == null ? undefined : json["use_tls"],
        useSsl: json["use_ssl"] == null ? undefined : json["use_ssl"],
        timeout: json["timeout"] == null ? undefined : json["timeout"],
        fromAddress: json["from_address"] == null ? undefined : json["from_address"],
        tokenExpiry: json["token_expiry"] == null ? undefined : json["token_expiry"],
        subject: json["subject"] == null ? undefined : json["subject"],
        template: json["template"] == null ? undefined : json["template"],
        activateUserOnSuccess:
            json["activate_user_on_success"] == null ? undefined : json["activate_user_on_success"],
        recoveryMaxAttempts:
            json["recovery_max_attempts"] == null ? undefined : json["recovery_max_attempts"],
        recoveryCacheTimeout:
            json["recovery_cache_timeout"] == null ? undefined : json["recovery_cache_timeout"],
    };
}

export function PatchedEmailStageRequestToJSON(json: any): PatchedEmailStageRequest {
    return PatchedEmailStageRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        use_global_settings: value["useGlobalSettings"],
        host: value["host"],
        port: value["port"],
        username: value["username"],
        password: value["password"],
        use_tls: value["useTls"],
        use_ssl: value["useSsl"],
        timeout: value["timeout"],
        from_address: value["fromAddress"],
        token_expiry: value["tokenExpiry"],
        subject: value["subject"],
        template: value["template"],
        activate_user_on_success: value["activateUserOnSuccess"],
        recovery_max_attempts: value["recoveryMaxAttempts"],
        recovery_cache_timeout: value["recoveryCacheTimeout"],
    };
}
