/* 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 { FlowSet } from './FlowSet';
import {
    FlowSetFromJSON,
    FlowSetFromJSONTyped,
    FlowSetToJSON,
    FlowSetToJSONTyped,
} from './FlowSet';
import type { UserAttributeEnum } from './UserAttributeEnum';
import {
    UserAttributeEnumFromJSON,
    UserAttributeEnumFromJSONTyped,
    UserAttributeEnumToJSON,
    UserAttributeEnumToJSONTyped,
} from './UserAttributeEnum';

/**
 * MutualTLSStage Serializer
 * @export
 * @interface MutualTLSStage
 */
export interface MutualTLSStage {
    /**
     * 
     * @type {string}
     * @memberof MutualTLSStage
     */
    readonly pk: string;
    /**
     * 
     * @type {string}
     * @memberof MutualTLSStage
     */
    name: string;
    /**
     * Get object type so that we know how to edit the object
     * @type {string}
     * @memberof MutualTLSStage
     */
    readonly component: string;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof MutualTLSStage
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof MutualTLSStage
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof MutualTLSStage
     */
    readonly metaModelName: string;
    /**
     * 
     * @type {Array<FlowSet>}
     * @memberof MutualTLSStage
     */
    flowSet?: Array<FlowSet>;
    /**
     * 
     * @type {MutualTLSStageModeEnum}
     * @memberof MutualTLSStage
     */
    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 MutualTLSStage
     */
    certificateAuthorities?: Array<string>;
    /**
     * 
     * @type {CertAttributeEnum}
     * @memberof MutualTLSStage
     */
    certAttribute: CertAttributeEnum;
    /**
     * 
     * @type {UserAttributeEnum}
     * @memberof MutualTLSStage
     */
    userAttribute: UserAttributeEnum;
}



/**
 * Check if a given object implements the MutualTLSStage interface.
 */
export function instanceOfMutualTLSStage(value: object): value is MutualTLSStage {
    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 (!('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 MutualTLSStageFromJSON(json: any): MutualTLSStage {
    return MutualTLSStageFromJSONTyped(json, false);
}

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

export function MutualTLSStageToJSON(json: any): MutualTLSStage {
    return MutualTLSStageToJSONTyped(json, false);
}

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

