/* 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 { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

/**
 * AuthenticatorDuoStage Serializer
 * @export
 * @interface AuthenticatorDuoStageRequest
 */
export interface AuthenticatorDuoStageRequest {
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof AuthenticatorDuoStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage.
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    configureFlow?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    friendlyName?: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    clientId: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    clientSecret: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    apiHostname: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    adminIntegrationKey?: string;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorDuoStageRequest
     */
    adminSecretKey?: string;
}

/**
 * Check if a given object implements the AuthenticatorDuoStageRequest interface.
 */
export function instanceOfAuthenticatorDuoStageRequest(value: object): value is AuthenticatorDuoStageRequest {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('clientId' in value) || value['clientId'] === undefined) return false;
    if (!('clientSecret' in value) || value['clientSecret'] === undefined) return false;
    if (!('apiHostname' in value) || value['apiHostname'] === undefined) return false;
    return true;
}

export function AuthenticatorDuoStageRequestFromJSON(json: any): AuthenticatorDuoStageRequest {
    return AuthenticatorDuoStageRequestFromJSONTyped(json, false);
}

export function AuthenticatorDuoStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticatorDuoStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'configureFlow': json['configure_flow'] == null ? undefined : json['configure_flow'],
        'friendlyName': json['friendly_name'] == null ? undefined : json['friendly_name'],
        'clientId': json['client_id'],
        'clientSecret': json['client_secret'],
        'apiHostname': json['api_hostname'],
        'adminIntegrationKey': json['admin_integration_key'] == null ? undefined : json['admin_integration_key'],
        'adminSecretKey': json['admin_secret_key'] == null ? undefined : json['admin_secret_key'],
    };
}

export function AuthenticatorDuoStageRequestToJSON(json: any): AuthenticatorDuoStageRequest {
    return AuthenticatorDuoStageRequestToJSONTyped(json, false);
}

export function AuthenticatorDuoStageRequestToJSONTyped(value?: AuthenticatorDuoStageRequest | 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)),
        'configure_flow': value['configureFlow'],
        'friendly_name': value['friendlyName'],
        'client_id': value['clientId'],
        'client_secret': value['clientSecret'],
        'api_hostname': value['apiHostname'],
        'admin_integration_key': value['adminIntegrationKey'],
        'admin_secret_key': value['adminSecretKey'],
    };
}

