/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.12.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 { FlowSet } from './FlowSet';
import {
    FlowSetFromJSON,
    FlowSetFromJSONTyped,
    FlowSetToJSON,
    FlowSetToJSONTyped,
} from './FlowSet';

/**
 * AuthenticatorDuoStage Serializer
 * @export
 * @interface AuthenticatorDuoStage
 */
export interface AuthenticatorDuoStage {
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    readonly pk: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    name: string;
    /**
     * Get object type so that we know how to edit the object
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    readonly component: string;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    readonly metaModelName: string;
    /**
     * 
     * @type {Array<FlowSet>}
     * @memberof AuthenticatorDuoStage
     */
    flowSet?: Array<FlowSet>;
    /**
     * Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage.
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    configureFlow?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    friendlyName?: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    clientId: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    apiHostname: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStage
     */
    adminIntegrationKey?: string;
}

/**
 * Check if a given object implements the AuthenticatorDuoStage interface.
 */
export function instanceOfAuthenticatorDuoStage(value: object): value is AuthenticatorDuoStage {
    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;
    if (!('clientId' in value) || value['clientId'] === undefined) return false;
    if (!('apiHostname' in value) || value['apiHostname'] === undefined) return false;
    return true;
}

export function AuthenticatorDuoStageFromJSON(json: any): AuthenticatorDuoStage {
    return AuthenticatorDuoStageFromJSONTyped(json, false);
}

export function AuthenticatorDuoStageFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticatorDuoStage {
    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)),
        'configureFlow': json['configure_flow'] == null ? undefined : json['configure_flow'],
        'friendlyName': json['friendly_name'] == null ? undefined : json['friendly_name'],
        'clientId': json['client_id'],
        'apiHostname': json['api_hostname'],
        'adminIntegrationKey': json['admin_integration_key'] == null ? undefined : json['admin_integration_key'],
    };
}

export function AuthenticatorDuoStageToJSON(json: any): AuthenticatorDuoStage {
    return AuthenticatorDuoStageToJSONTyped(json, false);
}

export function AuthenticatorDuoStageToJSONTyped(value?: Omit<AuthenticatorDuoStage, '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)),
        'configure_flow': value['configureFlow'],
        'friendly_name': value['friendlyName'],
        'client_id': value['clientId'],
        'api_hostname': value['apiHostname'],
        'admin_integration_key': value['adminIntegrationKey'],
    };
}

