/* 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 ConsentStageRequest
 */
export interface ConsentStageRequest {
    /**
     *
     * @type {string}
     * @memberof ConsentStageRequest
     */
    name: string;
    /**
     *
     * @type {ConsentModeEnum}
     * @memberof ConsentStageRequest
     */
    mode?: ConsentModeEnum;
    /**
     * Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3).
     * @type {string}
     * @memberof ConsentStageRequest
     */
    consentExpireIn?: string;
}

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

export function ConsentStageRequestFromJSON(json: any): ConsentStageRequest {
    return ConsentStageRequestFromJSONTyped(json, false);
}

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

export function ConsentStageRequestToJSON(json: any): ConsentStageRequest {
    return ConsentStageRequestToJSONTyped(json, false);
}

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

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