/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.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 { mapValues } from '../runtime';
import type { ConsentStageModeEnum } from './ConsentStageModeEnum';
import {
    ConsentStageModeEnumFromJSON,
    ConsentStageModeEnumFromJSONTyped,
    ConsentStageModeEnumToJSON,
    ConsentStageModeEnumToJSONTyped,
} from './ConsentStageModeEnum';
import type { FlowSet } from './FlowSet';
import {
    FlowSetFromJSON,
    FlowSetFromJSONTyped,
    FlowSetToJSON,
    FlowSetToJSONTyped,
} from './FlowSet';

/**
 * ConsentStage Serializer
 * @export
 * @interface ConsentStage
 */
export interface ConsentStage {
    /**
     * 
     * @type {string}
     * @memberof ConsentStage
     */
    readonly pk: string;
    /**
     * 
     * @type {string}
     * @memberof ConsentStage
     */
    name: string;
    /**
     * Get object type so that we know how to edit the object
     * @type {string}
     * @memberof ConsentStage
     */
    readonly component: string;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof ConsentStage
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof ConsentStage
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof ConsentStage
     */
    readonly metaModelName: string;
    /**
     * 
     * @type {Array<FlowSet>}
     * @memberof ConsentStage
     */
    flowSet?: Array<FlowSet>;
    /**
     * 
     * @type {ConsentStageModeEnum}
     * @memberof ConsentStage
     */
    mode?: ConsentStageModeEnum;
    /**
     * Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3).
     * @type {string}
     * @memberof ConsentStage
     */
    consentExpireIn?: string;
}



/**
 * Check if a given object implements the ConsentStage interface.
 */
export function instanceOfConsentStage(value: object): value is ConsentStage {
    if (!('pk' in value) || value['pk'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('component' in value) || value['component'] === undefined) return false;
    if (!('verboseName' in value) || value['verboseName'] === undefined) return false;
    if (!('verboseNamePlural' in value) || value['verboseNamePlural'] === undefined) return false;
    if (!('metaModelName' in value) || value['metaModelName'] === undefined) return false;
    return true;
}

export function ConsentStageFromJSON(json: any): ConsentStage {
    return ConsentStageFromJSONTyped(json, false);
}

export function ConsentStageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConsentStage {
    if (json == null) {
        return json;
    }
    return {
        
        'pk': json['pk'],
        'name': json['name'],
        'component': json['component'],
        'verboseName': json['verbose_name'],
        'verboseNamePlural': json['verbose_name_plural'],
        'metaModelName': json['meta_model_name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetFromJSON)),
        'mode': json['mode'] == null ? undefined : ConsentStageModeEnumFromJSON(json['mode']),
        'consentExpireIn': json['consent_expire_in'] == null ? undefined : json['consent_expire_in'],
    };
}

export function ConsentStageToJSON(json: any): ConsentStage {
    return ConsentStageToJSONTyped(json, false);
}

export function ConsentStageToJSONTyped(value?: Omit<ConsentStage, 'pk'|'component'|'verbose_name'|'verbose_name_plural'|'meta_model_name'> | 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(FlowSetToJSON)),
        'mode': ConsentStageModeEnumToJSON(value['mode']),
        'consent_expire_in': value['consentExpireIn'],
    };
}

