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

import type { ConsentModeEnum } from "./ConsentModeEnum";
import { ConsentModeEnumFromJSON, ConsentModeEnumToJSON } from "./ConsentModeEnum";

/**
 * ConsentStage Serializer
 * @export
 * @interface PatchedConsentStageRequest
 */
export interface PatchedConsentStageRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedConsentStageRequest
     */
    name?: string;
    /**
     *
     * @type {ConsentModeEnum}
     * @memberof PatchedConsentStageRequest
     */
    mode?: ConsentModeEnum;
    /**
     * Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3).
     * @type {string}
     * @memberof PatchedConsentStageRequest
     */
    consentExpireIn?: string;
}

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

export function PatchedConsentStageRequestFromJSON(json: any): PatchedConsentStageRequest {
    return PatchedConsentStageRequestFromJSONTyped(json, false);
}

export function PatchedConsentStageRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedConsentStageRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : json["name"],
        mode: json["mode"] == null ? undefined : ConsentModeEnumFromJSON(json["mode"]),
        consentExpireIn: json["consent_expire_in"] == null ? undefined : json["consent_expire_in"],
    };
}

export function PatchedConsentStageRequestToJSON(json: any): PatchedConsentStageRequest {
    return PatchedConsentStageRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        mode: ConsentModeEnumToJSON(value["mode"]),
        consent_expire_in: value["consentExpireIn"],
    };
}
