/* 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 { MutualTLSStageModeEnum } from './MutualTLSStageModeEnum';
import {
    MutualTLSStageModeEnumFromJSON,
    MutualTLSStageModeEnumFromJSONTyped,
    MutualTLSStageModeEnumToJSON,
    MutualTLSStageModeEnumToJSONTyped,
} from './MutualTLSStageModeEnum';
import type { CertAttributeEnum } from './CertAttributeEnum';
import {
    CertAttributeEnumFromJSON,
    CertAttributeEnumFromJSONTyped,
    CertAttributeEnumToJSON,
    CertAttributeEnumToJSONTyped,
} from './CertAttributeEnum';
import type { UserAttributeEnum } from './UserAttributeEnum';
import {
    UserAttributeEnumFromJSON,
    UserAttributeEnumFromJSONTyped,
    UserAttributeEnumToJSON,
    UserAttributeEnumToJSONTyped,
} from './UserAttributeEnum';
import type { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

/**
 * MutualTLSStage Serializer
 * @export
 * @interface MutualTLSStageRequest
 */
export interface MutualTLSStageRequest {
    /**
     * 
     * @type {string}
     * @memberof MutualTLSStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof MutualTLSStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {MutualTLSStageModeEnum}
     * @memberof MutualTLSStageRequest
     */
    mode: MutualTLSStageModeEnum;
    /**
     * Configure certificate authorities to validate the certificate against. This option has a higher priority than the `client_certificate` option on `Brand`.
     * @type {Array<string>}
     * @memberof MutualTLSStageRequest
     */
    certificateAuthorities?: Array<string>;
    /**
     * 
     * @type {CertAttributeEnum}
     * @memberof MutualTLSStageRequest
     */
    certAttribute: CertAttributeEnum;
    /**
     * 
     * @type {UserAttributeEnum}
     * @memberof MutualTLSStageRequest
     */
    userAttribute: UserAttributeEnum;
}



/**
 * Check if a given object implements the MutualTLSStageRequest interface.
 */
export function instanceOfMutualTLSStageRequest(value: object): value is MutualTLSStageRequest {
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('mode' in value) || value['mode'] === undefined) return false;
    if (!('certAttribute' in value) || value['certAttribute'] === undefined) return false;
    if (!('userAttribute' in value) || value['userAttribute'] === undefined) return false;
    return true;
}

export function MutualTLSStageRequestFromJSON(json: any): MutualTLSStageRequest {
    return MutualTLSStageRequestFromJSONTyped(json, false);
}

export function MutualTLSStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MutualTLSStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'mode': MutualTLSStageModeEnumFromJSON(json['mode']),
        'certificateAuthorities': json['certificate_authorities'] == null ? undefined : json['certificate_authorities'],
        'certAttribute': CertAttributeEnumFromJSON(json['cert_attribute']),
        'userAttribute': UserAttributeEnumFromJSON(json['user_attribute']),
    };
}

export function MutualTLSStageRequestToJSON(json: any): MutualTLSStageRequest {
    return MutualTLSStageRequestToJSONTyped(json, false);
}

export function MutualTLSStageRequestToJSONTyped(value?: MutualTLSStageRequest | 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': MutualTLSStageModeEnumToJSON(value['mode']),
        'certificate_authorities': value['certificateAuthorities'],
        'cert_attribute': CertAttributeEnumToJSON(value['certAttribute']),
        'user_attribute': UserAttributeEnumToJSON(value['userAttribute']),
    };
}

