/* 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 PatchedMutualTLSStageRequest
 */
export interface PatchedMutualTLSStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedMutualTLSStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedMutualTLSStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {MutualTLSStageModeEnum}
     * @memberof PatchedMutualTLSStageRequest
     */
    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 PatchedMutualTLSStageRequest
     */
    certificateAuthorities?: Array<string>;
    /**
     * 
     * @type {CertAttributeEnum}
     * @memberof PatchedMutualTLSStageRequest
     */
    certAttribute?: CertAttributeEnum;
    /**
     * 
     * @type {UserAttributeEnum}
     * @memberof PatchedMutualTLSStageRequest
     */
    userAttribute?: UserAttributeEnum;
}



/**
 * Check if a given object implements the PatchedMutualTLSStageRequest interface.
 */
export function instanceOfPatchedMutualTLSStageRequest(value: object): value is PatchedMutualTLSStageRequest {
    return true;
}

export function PatchedMutualTLSStageRequestFromJSON(json: any): PatchedMutualTLSStageRequest {
    return PatchedMutualTLSStageRequestFromJSONTyped(json, false);
}

export function PatchedMutualTLSStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedMutualTLSStageRequest {
    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 : MutualTLSStageModeEnumFromJSON(json['mode']),
        'certificateAuthorities': json['certificate_authorities'] == null ? undefined : json['certificate_authorities'],
        'certAttribute': json['cert_attribute'] == null ? undefined : CertAttributeEnumFromJSON(json['cert_attribute']),
        'userAttribute': json['user_attribute'] == null ? undefined : UserAttributeEnumFromJSON(json['user_attribute']),
    };
}

export function PatchedMutualTLSStageRequestToJSON(json: any): PatchedMutualTLSStageRequest {
    return PatchedMutualTLSStageRequestToJSONTyped(json, false);
}

export function PatchedMutualTLSStageRequestToJSONTyped(value?: PatchedMutualTLSStageRequest | 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']),
    };
}

