/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * 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 { ConsentStageModeEnum } from './ConsentStageModeEnum';
import {
    ConsentStageModeEnumFromJSON,
    ConsentStageModeEnumFromJSONTyped,
    ConsentStageModeEnumToJSON,
    ConsentStageModeEnumToJSONTyped,
} from './ConsentStageModeEnum';
import type { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

/**
 * ConsentStage Serializer
 * @export
 * @interface PatchedConsentStageRequest
 */
export interface PatchedConsentStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedConsentStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedConsentStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {ConsentStageModeEnum}
     * @memberof PatchedConsentStageRequest
     */
    mode?: ConsentStageModeEnum;
    /**
     * 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'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'mode': json['mode'] == null ? undefined : ConsentStageModeEnumFromJSON(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'],
        'flow_set': value['flowSet'] == null ? undefined : ((value['flowSet'] as Array<any>).map(FlowSetRequestToJSON)),
        'mode': ConsentStageModeEnumToJSON(value['mode']),
        'consent_expire_in': value['consentExpireIn'],
    };
}

